> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vocobase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a session

> Returns the same fields delivered by the `session.completed` partner webhook (transcript, recording, extraction, variables, agent name, status, duration, credits). Polling fallback for partners that can't accept inbound webhooks. Mints a fresh presigned `recording_url` on every call (valid 7 days). Authorization is by `partner_config_id` — partners can only read sessions started via their own v2 endpoints (`/sessions/webrtc` or `/calls/start`).



## OpenAPI

````yaml /openapi.json get /sessions/{id}
openapi: 3.1.0
info:
  title: Vocobase Partner API
  version: '2.0'
  description: >-
    API for managing voice AI agents, documents, and calls on the Vocobase
    platform.
servers:
  - url: https://api.vocobase.com/api/v2
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Config
    description: >-
      Read and update partner configuration, webhook settings, and telephony
      credentials.
  - name: Agents
    description: Create, read, update, and delete voice AI agents.
  - name: Voices
    description: >-
      List voice tiers, available voices, and stream preview audio for agent
      configuration.
  - name: Documents
    description: Upload, manage, and delete knowledge base documents.
  - name: Agent Documents
    description: Link and unlink documents to agents for knowledge base integration.
  - name: Calls
    description: Initiate outbound calls and view call history.
  - name: Phone Numbers
    description: >-
      Import DIDs, assign agents for inbound routing, and re-sync carrier
      Application bindings.
  - name: Inbound Routing Policies
    description: >-
      Define pre-answer routing decisions for inbound calls before AI sessions
      are created.
  - name: Telephony Connections
    description: Create, list, rename, and disconnect named V2 telephony connections.
  - name: VoiceLink Management
    description: Manage VoiceLink reseller clients, DID mapping, and readiness sync.
  - name: Projects
    description: Organize agents into projects. Every agent belongs to exactly one project.
  - name: Dictionaries
    description: Speech-recognition dictionary CRUD and agent attachment.
  - name: Sessions
    description: Browser-initiated WebRTC voice sessions for in-app voice agents.
paths:
  /sessions/{id}:
    get:
      tags:
        - Sessions
      summary: Get a session
      description: >-
        Returns the same fields delivered by the `session.completed` partner
        webhook (transcript, recording, extraction, variables, agent name,
        status, duration, credits). Polling fallback for partners that can't
        accept inbound webhooks. Mints a fresh presigned `recording_url` on
        every call (valid 7 days). Authorization is by `partner_config_id` —
        partners can only read sessions started via their own v2 endpoints
        (`/sessions/webrtc` or `/calls/start`).
      operationId: getSession
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Session ID (returned by `/sessions/webrtc` or `/calls/start`).
      responses:
        '200':
          description: Session retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      session_id:
                        type: string
                        format: uuid
                      agent_id:
                        type: string
                        format: uuid
                      agent_name:
                        type: string
                        nullable: true
                      status:
                        type: string
                        enum:
                          - active
                          - completed
                          - failed
                        description: >-
                          Lifecycle state. `active` while the bot is still
                          running.
                      duration_seconds:
                        type: integer
                        nullable: true
                        description: >-
                          Call duration in whole seconds. `null` until the
                          session ends.
                      credits_used:
                        type: number
                        description: Credits deducted for this session (display units).
                      processing_complete:
                        type: boolean
                        description: >-
                          `true` when the post-call pipeline (status flip,
                          transcript persist, recording upload, extraction) has
                          finished. Use when polling — `status: completed` +
                          `processing_complete: false` means the call ended but
                          decoration is still running.
                      pipeline_completed_at:
                        type: string
                        format: date-time
                        nullable: true
                        description: >-
                          Timestamp when the pipeline finished. `null` until the
                          pipeline completes (or on sessions created before this
                          field shipped — treat `null` + `status: completed` on
                          a pre-existing row as final).
                      transcript:
                        description: >-
                          Ordered conversation turns. Same shape as the
                          `session.completed` webhook payload. `null` until the
                          session ends.
                        nullable: true
                      recording_url:
                        type: string
                        format: uri
                        nullable: true
                        description: >-
                          Freshly-minted presigned recording URL (7-day window).
                          `null` if the agent did not have recording enabled or
                          the upload has not landed yet.
                      variables:
                        type: object
                        additionalProperties:
                          type: string
                        description: >-
                          Pre-call variable values used to render this session's
                          prompt and greeting. Empty object when none were
                          supplied.
                      started_at:
                        type: string
                        format: date-time
                      ended_at:
                        type: string
                        format: date-time
                        nullable: true
                      extraction:
                        type: object
                        description: >-
                          Post-call extraction result. Present only when the
                          agent has an `extraction_config` defined.
                      call:
                        type: object
                        description: >-
                          Call metadata. Present only for telephony sessions
                          started via `POST /calls/start`. Omitted for browser
                          WebRTC sessions.
                        properties:
                          call_id:
                            type: string
                            format: uuid
                          from_number:
                            type: string
                          to_number:
                            type: string
                          direction:
                            type: string
                          status:
                            type: string
                            description: >-
                              Call lifecycle/carrier status. Voicemail is
                              exposed through `disposition`, not `status`.
                          disposition:
                            type:
                              - string
                              - 'null'
                            enum:
                              - completed
                              - voicemail
                              - user_hangup_no_speech
                              - no_answer
                              - busy
                              - canceled
                              - blocked
                              - failed
                              - transferred
                              - null
                            description: >-
                              Final call outcome. Use `voicemail` to detect
                              carrier or bot voicemail outcomes.
                          answered_by:
                            type:
                              - string
                              - 'null'
                            enum:
                              - human
                              - machine
                              - unknown
                              - not_answered
                              - null
                            description: >-
                              Best-known answer classification. `machine`
                              indicates an answering machine or voicemail.
              example:
                success: true
                data:
                  session_id: s1234567-abcd-1234-abcd-123456789012
                  agent_id: a1234567-abcd-1234-abcd-123456789012
                  agent_name: Sales Assistant
                  status: completed
                  duration_seconds: 127
                  credits_used: 2.12
                  transcript:
                    - role: bot
                      content: Hello! How can I help?
                      timestamp: '2026-05-02T14:30:01.000Z'
                    - role: user
                      content: Tell me about your enterprise plan.
                      timestamp: '2026-05-02T14:30:04.000Z'
                  recording_url: >-
                    https://storage.googleapis.com/vocobase-recordings/rec_abc123.wav?X-Goog-Signature=...
                  variables:
                    callee_name: Sajal
                  started_at: '2026-05-02T14:30:00.000Z'
                  ended_at: '2026-05-02T14:32:07.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: UNAUTHORIZED
              message: Invalid or missing API key
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: NOT_FOUND
              message: Resource not found
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INTERNAL_ERROR
              message: An unexpected error occurred
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - success
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key in format: `rg_live_xxxx`. Pass as a Bearer token in the
        Authorization header.

````