> ## 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.

# A version's context envelope

> The contract, DataHub's context and the live state, resolved as you.

``format=markdown`` (or ``Accept: text/markdown``) is for agents;
``format=odcs`` is an Open Data Contract Standard v3 document.



## OpenAPI

````yaml get /api/data/{name}/{version}/context
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/{name}/{version}/context:
    get:
      tags:
        - Data consumer
      summary: A version's context envelope
      description: |-
        The contract, DataHub's context and the live state, resolved as you.

        ``format=markdown`` (or ``Accept: text/markdown``) is for agents;
        ``format=odcs`` is an Open Data Contract Standard v3 document.
      operationId: data_api_context_api_data__name___version__context_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: ^(v\d{1,6}|draft)$
            description: '''v<number>'', or ''draft'' (owner only).'
            title: Version
          description: '''v<number>'', or ''draft'' (owner only).'
        - name: format
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                pattern: ^(json|markdown|odcs)$
              - type: 'null'
            title: Format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextEnvelope'
            text/markdown: {}
            application/yaml: {}
        '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:
    ContextEnvelope:
      properties:
        api:
          type: string
          title: Api
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
        version:
          type: integer
          title: Version
        status:
          $ref: '#/components/schemas/api__models__data_api_models__VersionStatus'
        context_hash:
          type: string
          title: Context Hash
        endpoint:
          type: string
          title: Endpoint
        source:
          type: string
          title: Source
        grain:
          type: string
          title: Grain
        columns:
          items:
            $ref: '#/components/schemas/EnvelopeColumn'
          type: array
          title: Columns
        default_sort:
          items:
            type: string
          type: array
          title: Default Sort
        default_page_size:
          type: integer
          title: Default Page Size
        max_page_size:
          type: integer
          title: Max Page Size
        examples:
          items:
            $ref: '#/components/schemas/ContractExample'
          type: array
          title: Examples
        pinned:
          $ref: '#/components/schemas/PinnedContext'
        live:
          $ref: '#/components/schemas/LiveContext'
        pack:
          anyOf:
            - $ref: '#/components/schemas/PackContext'
            - type: 'null'
        notes:
          items:
            type: string
          type: array
          title: Notes
      type: object
      required:
        - api
        - title
        - description
        - version
        - status
        - context_hash
        - endpoint
        - source
        - grain
        - columns
        - default_sort
        - default_page_size
        - max_page_size
        - examples
        - pinned
        - live
      title: ContextEnvelope
      description: Everything a consumer needs to use a version correctly.
    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.
    EnvelopeColumn:
      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).
        masked:
          anyOf:
            - type: string
            - type: 'null'
          title: Masked
          description: The caller's mask on this column, if any.
        profile:
          anyOf:
            - $ref: '#/components/schemas/ColumnProfile'
            - type: 'null'
        dq_failing:
          items:
            type: string
          type: array
          title: Dq Failing
        deprecated:
          anyOf:
            - $ref: '#/components/schemas/Deprecation'
            - type: 'null'
      type: object
      required:
        - name
        - type
      title: EnvelopeColumn
    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.
    PinnedContext:
      properties:
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        owners:
          items:
            $ref: '#/components/schemas/Owner'
          type: array
          title: Owners
        links:
          items:
            $ref: '#/components/schemas/Link'
          type: array
          title: Links
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
        data_product:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Product
        properties:
          additionalProperties:
            type: string
          type: object
          title: Properties
        upstream_tables:
          items:
            type: string
          type: array
          title: Upstream Tables
        documents:
          items:
            $ref: '#/components/schemas/Link'
          type: array
          title: Documents
      type: object
      title: PinnedContext
      description: |-
        What DataHub said about the source when the version was published.

        Also the API's title and description at publish, so a later rename
        doesn't change what a published version says about itself.
    LiveContext:
      properties:
        as_of:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: As Of
        row_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Row Count
        dq:
          anyOf:
            - $ref: '#/components/schemas/DataQualitySummary'
            - type: 'null'
        incidents:
          items:
            $ref: '#/components/schemas/Incident'
          type: array
          title: Incidents
        deprecations:
          items:
            $ref: '#/components/schemas/Deprecation'
          type: array
          title: Deprecations
        warnings:
          items:
            type: string
          type: array
          title: Warnings
      type: object
      title: LiveContext
      description: Resolved per request (briefly cached).
    PackContext:
      properties:
        name:
          type: string
          title: Name
        version:
          type: string
          title: Version
        text:
          type: string
          title: Text
      type: object
      required:
        - name
        - version
        - text
      title: PackContext
    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
    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.
    ColumnProfile:
      properties:
        null_fraction:
          anyOf:
            - type: number
            - type: 'null'
          title: Null Fraction
        distinct_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Distinct Count
        min:
          anyOf:
            - type: string
            - type: 'null'
          title: Min
          description: Numeric columns only.
        max:
          anyOf:
            - type: string
            - type: 'null'
          title: Max
          description: Numeric columns only.
      type: object
      title: ColumnProfile
    Deprecation:
      properties:
        target:
          type: string
          title: Target
          description: A table, or table.column.
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        decommission_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Decommission At
      type: object
      required:
        - target
      title: Deprecation
    Owner:
      properties:
        name:
          type: string
          title: Name
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
      type: object
      required:
        - name
      title: Owner
    Link:
      properties:
        url:
          type: string
          title: Url
        label:
          type: string
          title: Label
      type: object
      required:
        - url
        - label
      title: Link
    DataQualitySummary:
      properties:
        status:
          type: string
          enum:
            - pass
            - warn
            - fail
            - unknown
          title: Status
        table:
          anyOf:
            - type: string
            - type: 'null'
          title: Table
        checked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Checked At
        passed:
          type: integer
          title: Passed
          default: 0
        total:
          type: integer
          title: Total
          default: 0
        failing:
          items:
            type: string
          type: array
          title: Failing
      type: object
      required:
        - status
      title: DataQualitySummary
    Incident:
      properties:
        title:
          type: string
          title: Title
        table:
          type: string
          title: Table
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
      type: object
      required:
        - title
        - table
      title: Incident
  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.