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

# Get Session

> Retrieve metadata for a specific delivery session.



## OpenAPI

````yaml GET /v1/sessions/{id}
openapi: 3.1.0
info:
  title: Desmo API
  description: >-
    API for accessing Desmo sessions and proof-of-delivery insights. Requires a
    secret API key (`sk_...`) for authentication.
  version: 1.0.0
servers:
  - url: https://api.getdesmo.io
    description: Production
security:
  - desmoKey: []
paths:
  /v1/sessions/{id}:
    get:
      summary: Get session
      description: Retrieve metadata for a specific delivery session.
      operationId: getSession
      parameters:
        - name: id
          in: path
          description: The session ID (e.g., `sess_abc123def456`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Session details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Session'
              example:
                id: sess_ce7f77e71be24f1b
                organizationId: 1428fcc7-119e-4397-9668-d5645b8166a8
                deliveryId: DELIVERY_123
                externalRiderId: DRIVER_42
                status: completed
                sessionType: drop
                env: live
                address:
                  line1: 123 Main St
                  city: Bangalore
                  state: Karnataka
                  postalCode: '560001'
                  country: IN
                  lat: 12.9716
                  lng: 77.5946
                device:
                  platform: android
                  sdkVersion: 1.0.2
                  model: Pixel 7
                  osVersion: '14'
                startLocation:
                  lat: 12.945
                  lng: 77.5795
                createdAt: '2025-01-15T10:00:00Z'
                endedAt: '2025-01-15T10:05:00Z'
        '401':
          description: Invalid or missing API key
        '403':
          description: Secret key required
        '404':
          description: Session not found
components:
  schemas:
    Session:
      type: object
      properties:
        id:
          type: string
          description: 'Unique session ID (format: sess_xxx)'
        organizationId:
          type: string
          description: Your organization ID
        deliveryId:
          type: string
          description: Your internal delivery/order ID
        externalRiderId:
          type: string
          nullable: true
          description: External rider/driver ID from customer's system
        status:
          $ref: '#/components/schemas/SessionStatus'
        sessionType:
          $ref: '#/components/schemas/SessionType'
        env:
          $ref: '#/components/schemas/Environment'
        address:
          $ref: '#/components/schemas/Address'
        device:
          $ref: '#/components/schemas/Device'
        startLocation:
          $ref: '#/components/schemas/Location'
        sensorAvailability:
          $ref: '#/components/schemas/SensorAvailability'
        createdAt:
          type: string
          format: date-time
          description: When the session started
        endedAt:
          type: string
          format: date-time
          nullable: true
          description: When the session ended (null if still recording)
      required:
        - id
        - organizationId
        - deliveryId
        - sessionType
        - status
        - env
        - createdAt
    SessionStatus:
      type: string
      enum:
        - recording
        - completed
        - failed
      description: Current status of the session
    SessionType:
      type: string
      enum:
        - pickup
        - drop
        - transit
      description: Type of delivery session
    Environment:
      type: string
      enum:
        - sandbox
        - live
      description: Environment the session belongs to
    Address:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
          nullable: true
        city:
          type: string
        state:
          type: string
        postalCode:
          type: string
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code
        lat:
          type: number
          format: float
        lng:
          type: number
          format: float
        rawAddress:
          type: string
    Device:
      type: object
      properties:
        platform:
          type: string
          enum:
            - ios
            - android
        sdkVersion:
          type: string
          nullable: true
        model:
          type: string
          nullable: true
        osVersion:
          type: string
          nullable: true
        appVersion:
          type: string
          nullable: true
      required:
        - platform
    Location:
      type: object
      properties:
        lat:
          type: number
          format: float
        lng:
          type: number
          format: float
      required:
        - lat
        - lng
    SensorAvailability:
      type: object
      description: Reports which sensors are available on the device
      properties:
        hasAccelerometer:
          type: boolean
        hasGyroscope:
          type: boolean
        hasGravity:
          type: boolean
        hasRotationVector:
          type: boolean
        hasBarometer:
          type: boolean
        hasGps:
          type: boolean
        hasMagnetometer:
          type: boolean
  securitySchemes:
    desmoKey:
      type: apiKey
      in: header
      name: Desmo-Key
      description: Secret API key (starts with `sk_sandbox_` or `sk_live_`)

````