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

# Get a version's contract

> A published version's contract, or the draft (owner or admin) with its gaps.



## OpenAPI

````yaml get /api/data-apis/{name}/versions/{version}
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/data-apis/{name}/versions/{version}:
    get:
      tags:
        - Data APIs
      summary: Get a version's contract
      description: >-
        A published version's contract, or the draft (owner or admin) with its
        gaps.
      operationId: get_data_api_version_api_data_apis__name__versions__version__get
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z][a-z0-9_]{1,62}$
            description: The API's name.
            title: Name
          description: The API's name.
        - name: version
          in: path
          required: true
          schema:
            type: string
            pattern: ^(\d{1,6}|draft)$
            description: A version number, or 'draft'.
            title: Version
          description: A version number, or 'draft'.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataApiVersionDetail'
        '400':
          description: Invalid request.
        '403':
          description: Not allowed.
        '404':
          description: No such API or version.
        '409':
          description: Conflicts with the API's state.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many of your queries are running; see Retry-After.
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    DataApiVersionDetail:
      properties:
        version:
          type: integer
          title: Version
        status:
          $ref: '#/components/schemas/api__models__data_api_models__VersionStatus'
        context_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Context Hash
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        created_at:
          type: string
          format: date-time
          title: Created At
        published_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Published By
        published_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Published At
        retired_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Retired At
        contract:
          $ref: '#/components/schemas/DataApiContract-Output'
        gaps:
          items:
            $ref: '#/components/schemas/ContractGap'
          type: array
          title: Gaps
      type: object
      required:
        - version
        - status
        - created_at
        - contract
      title: DataApiVersionDetail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    api__models__data_api_models__VersionStatus:
      type: string
      enum:
        - draft
        - published
        - retired
      title: VersionStatus
      description: A version's lifecycle. Only ``draft`` can be edited.
    DataApiContract-Output:
      properties:
        grain:
          type: string
          title: Grain
          description: What one row means.
          default: ''
        columns:
          items:
            $ref: '#/components/schemas/ContractColumn-Output'
          type: array
          title: Columns
        default_sort:
          items:
            type: string
          type: array
          title: Default Sort
          description: Sort used when the caller gives none, e.g. ['-order_date'].
        default_page_size:
          type: integer
          maximum: 10000
          minimum: 1
          title: Default Page Size
          default: 100
        max_page_size:
          type: integer
          maximum: 10000
          minimum: 1
          title: Max Page Size
          default: 1000
        examples:
          items:
            $ref: '#/components/schemas/ContractExample'
          type: array
          title: Examples
        context_pack:
          anyOf:
            - $ref: '#/components/schemas/api__models__data_api_models__PackRef'
            - type: 'null'
        require_filter:
          type: boolean
          title: Require Filter
          description: >-
            Every call must narrow the rows with at least one eq, in or range
            filter: no full-table pages.
          default: false
      type: object
      title: DataApiContract
      description: What a version promises. Frozen once the version is published.
    ContractGap:
      properties:
        field:
          type: string
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - field
        - message
      title: ContractGap
      description: Something that has to be filled in before a version can be published.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContractColumn-Output:
      properties:
        name:
          type: string
          title: Name
          description: Column name in the source.
        type:
          type: string
          title: Type
          description: Trino type, as the source reports it.
        description:
          type: string
          title: Description
          description: What the column means.
          default: ''
        business_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Business Name
        nullable:
          type: boolean
          title: Nullable
          default: true
        is_key:
          type: boolean
          title: Is Key
          description: Part of the row's unique key (the grain).
          default: false
        filters:
          items:
            $ref: '#/components/schemas/api__models__data_api_models__FilterOp'
          type: array
          title: Filters
        sortable:
          type: boolean
          title: Sortable
          default: false
        glossary_terms:
          items:
            $ref: '#/components/schemas/api__models__data_api_models__GlossaryTermRef'
          type: array
          title: Glossary Terms
        tags:
          items:
            type: string
          type: array
          title: Tags
        sensitive:
          type: boolean
          title: Sensitive
          description: Carries a sensitive classification (PII, PHI, PCI, ...).
          default: false
        upstream:
          items:
            type: string
          type: array
          title: Upstream
          description: Source columns it is derived from (catalog.schema.table.column).
      type: object
      required:
        - name
        - type
      title: ContractColumn
      description: One column of a version's contract.
    ContractExample:
      properties:
        title:
          type: string
          title: Title
        params:
          additionalProperties:
            type: string
          type: object
          title: Params
      type: object
      required:
        - title
      title: ContractExample
      description: >-
        A worked call: what someone might ask, and the parameters that answer
        it.
    api__models__data_api_models__PackRef:
      properties:
        artifact_id:
          type: string
          title: Artifact Id
        version:
          type: string
          title: Version
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - artifact_id
        - version
      title: PackRef
      description: A context pack pinned to an exact version.
    api__models__data_api_models__FilterOp:
      type: string
      enum:
        - eq
        - ne
        - in
        - gt
        - gte
        - lt
        - lte
        - is_null
      title: FilterOp
      description: A filter a column accepts, as ``?col.op=value`` (``eq`` is ``?col=``).
    api__models__data_api_models__GlossaryTermRef:
      properties:
        urn:
          type: string
          title: Urn
        name:
          type: string
          title: Name
        definition:
          anyOf:
            - type: string
            - type: 'null'
          title: Definition
      type: object
      required:
        - urn
        - name
      title: GlossaryTermRef
      description: A DataHub glossary term on a column.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.