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

# Get a document schema

> Retrieve a Terminal49 document schema for an extraction output, including the schema version and the structured payload contract for parsed fields.

<Info>
  **Beta Feature** - This endpoint is currently in beta. The API is stable, but the schema and behavior may evolve based on feedback.
</Info>


## OpenAPI

````yaml get /document_schemas/{id}
openapi: 3.0.0
info:
  title: Terminal49 API Reference
  version: 0.2.0
  contact:
    name: Terminal49 API support
    url: https://www.terminal49.com
    email: support@terminal49.com
  description: >-
    The Terminal 49 API offers a convenient way to programmatically track your
    shipments from origin to destination.


    Please enter your API key into the "Variables" tab before using these
    endpoints within Postman.
  x-label: Beta
  termsOfService: https://www.terminal49.com/terms
servers:
  - url: https://api.terminal49.com/v2
    description: Production
security:
  - authorization: []
tags:
  - name: Containers
  - name: Custom Field Definitions
  - name: Custom Field Options
  - name: Custom Fields
  - name: Shipments
  - name: Locations
  - name: Events
  - name: Tracking Requests
  - name: Webhooks
  - name: Webhook Notifications
  - name: Ports
  - name: Metro Areas
  - name: Terminals
  - name: Routing (Paid)
  - name: Documents
  - name: Email Submissions
  - name: Document Schemas
  - name: Search
paths:
  /document_schemas/{id}:
    get:
      tags:
        - Document Schemas
      summary: Get a document schema
      operationId: get-document_schemas-id
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: >-
            Schema id in full-version format, e.g.
            commercial_invoice@2026-03-23.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/document_schema'
                  links:
                    $ref: '#/components/schemas/link-self'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/error'
              examples:
                schema_not_found:
                  summary: Document schema not found
                  value:
                    errors:
                      - status: '404'
                        title: Not Found
                        detail: >-
                          Couldn't find DocumentSchema with
                          'id'=unknown@2026-03-23
components:
  schemas:
    document_schema:
      title: Document Schema
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - document_schema
        attributes:
          type: object
          properties:
            document_type:
              type: string
              description: >-
                Document type this schema applies to (for example,
                commercial_invoice).
            label:
              type: string
              description: Human-readable label for the document type.
            schema_version:
              type: string
              description: Public schema version identifier.
            full_version:
              type: string
              description: >-
                Fully-qualified schema version id (for example,
                commercial_invoice@2026-03-23).
            current:
              type: boolean
              description: Whether this schema version is currently active.
            draft:
              type: boolean
              description: Whether this schema version is marked as draft.
            active_at:
              type: string
              format: date-time
              nullable: true
              description: Timestamp when this schema version became active.
            schema_format:
              type: string
              enum:
                - json_schema
              description: Schema payload format.
            description:
              type: string
              nullable: true
              description: Optional notes describing this schema.
            schema_payload:
              type: object
              additionalProperties: true
              description: >-
                JSON Schema payload used to validate and describe extracted
                fields.
            created_at:
              type: string
              format: date-time
              description: When this schema record was created.
            updated_at:
              type: string
              format: date-time
              description: When this schema record was last updated.
        links:
          type: object
          properties:
            self:
              type: string
      required:
        - id
        - type
    link-self:
      title: link
      type: object
      properties:
        self:
          type: string
          format: uri
    error:
      title: Error model
      type: object
      properties:
        detail:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        source:
          type: object
          nullable: true
          properties:
            pointer:
              type: string
              nullable: true
            parameter:
              type: string
              nullable: true
        code:
          type: string
          nullable: true
        status:
          type: string
          nullable: true
        meta:
          type: object
          nullable: true
          additionalProperties: true
      required:
        - title
  securitySchemes:
    authorization:
      name: Authorization
      type: apiKey
      in: header
      description: >-
        Use a Terminal49 API key in the `Authorization` header with the `Token`
        prefix.


        `Authorization: Token YOUR_API_KEY`

````