> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-fjmorr-1782499519-e1e0dbe.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get an authorization session

> Returns the current status of an in-flight authorization session. The optional wait_seconds query param (1-25, default 1) keeps the request open up to that many seconds, returning early if the session completes. Poll until status is COMPLETED. This endpoint returns status only, not the access token.



## OpenAPI

````yaml /langsmith/headless-fleet-openapi.json get /v1/fleet/auth-sessions/{session_id}
openapi: 3.0.0
info:
  contact: {}
  description: >
    The Fleet API is a headless interface for building and running agents —
    create and configure agents, manage their connections and secrets, run
    threads, and wire up triggers.


    Paths are service-native (e.g. `/v1/fleet/agents`). Self-hosted deployments
    reach them through the gateway under an `/api` prefix (e.g.
    `/api/v1/fleet/agents`).


    ## Authentication


    Every request must carry **one** credential:


    | Scheme | Header | Value |

    | --- | --- | --- |

    | API key | `X-Api-Key` | A LangSmith API key (`lsv2_…`). |

    | Session token | `Authorization` | `Bearer <session JWT>`. |


    Workspace-scoped endpoints additionally require **`X-Tenant-Id`**, set to
    the workspace (tenant) UUID the request operates in. Organization- and
    identity-scoped endpoints omit it.


    ## Errors


    Errors follow [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) (Problem
    Details) and use one JSON shape across every endpoint:


    ```json

    {
      "type": "about:blank",
      "code": "agent_not_found",
      "detail": "No agent exists with that ID.",
      "status": 404
    }

    ```


    - `type` — URI identifying the error type. Currently always `about:blank`
    (the RFC 7807 default); branch on `code`, not `type`.

    - `code` — stable, machine-readable identifier. Branch on this rather than
    matching `detail`.

    - `detail` — human-readable explanation. Proxied endpoints also echo it as
    `message`.

    - `status` — mirrors the HTTP status code.


    | Status | Meaning |

    | --- | --- |

    | `400` | Malformed request or failed validation. |

    | `401` | Missing or invalid credentials. |

    | `403` | Authenticated, but not permitted to access this resource. |

    | `404` | The resource does not exist or is not visible to your workspace. |

    | `409` | Conflicts with current state (e.g. a duplicate). |

    | `422` | Well-formed but semantically invalid. |

    | `500` | Unexpected server error. |

    | `502` / `503` | An upstream dependency failed or was unavailable. Retries
    are usually safe. |


    ## Pagination


    List endpoints return a fixed-size page and an opaque cursor:


    ```json

    { "items": [ ], "next_cursor": "eyJ…" }

    ```


    - `page_size` — items per page, `1`–`100` (default `20`).

    - `cursor` — pass the previous response's `next_cursor` to fetch the next
    page. An absent or empty `next_cursor` means there are no more results.


    Cursors are opaque — don't construct or parse them.
  title: Fleet API
  version: v1
servers:
  - url: /
security: []
tags:
  - name: agents
  - name: agent connections
  - name: threads
  - name: skills
  - name: auth
  - name: integrations
  - name: secrets
  - name: models
  - name: tenants
  - name: users
paths:
  /v1/fleet/auth-sessions/{session_id}:
    get:
      tags:
        - auth
      summary: Get an authorization session
      description: >-
        Returns the current status of an in-flight authorization session. The
        optional wait_seconds query param (1-25, default 1) keeps the request
        open up to that many seconds, returning early if the session completes.
        Poll until status is COMPLETED. This endpoint returns status only, not
        the access token.
      parameters:
        - description: Authorization session ID
          name: session_id
          in: path
          required: true
          schema:
            type: string
        - description: Long-poll window in seconds (1-25, default 1)
          name: wait_seconds
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.GetSessionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.errorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.errorResponse'
        '403':
          description: Session belongs to another organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.errorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.errorResponse'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/auth.errorResponse'
      security:
        - API_Key: []
        - Tenant_ID: []
        - Bearer_Auth: []
components:
  schemas:
    auth.GetSessionResponse:
      type: object
      properties:
        id:
          type: string
        status:
          $ref: '#/components/schemas/auth.SessionStatus'
    auth.errorResponse:
      type: object
      properties:
        code:
          type: string
        detail:
          type: string
        status:
          type: integer
        type:
          type: string
    auth.SessionStatus:
      type: string
      enum:
        - PENDING
        - COMPLETED
        - CONNECTION_REQUIRED
        - TOKEN_EXPIRED
      x-enum-varnames:
        - SessionStatusPending
        - SessionStatusCompleted
        - SessionStatusConnectionRequired
        - SessionStatusTokenExpired
  securitySchemes:
    API_Key:
      description: LangSmith API key (`lsv2_...`).
      type: apiKey
      name: X-Api-Key
      in: header
    Tenant_ID:
      description: Workspace (tenant) UUID the request operates in.
      type: apiKey
      name: X-Tenant-Id
      in: header
    Bearer_Auth:
      description: Session JWT, sent as `Bearer <token>`.
      type: apiKey
      name: Authorization
      in: header

````