openapi: 3.1.0
info:
  title: ONE Platform Public API - Reference Data
  version: 1.0.0
  license:
    name: ATACCAMA PROPRIETARY/CONFIDENTIAL
    url: https://www.ataccama.com
servers:
  - url: https://{your-environment}.ataccama.one/api
    description: Ataccama ONE Cloud API endpoint
    variables:
      your-environment:
        default: your-environment
        description: Your environment identifier from the Cloud Portal
security:
  - JWT: []
paths:
  /reference-data/v1/tables:
    get:
      tags:
        - Reference data
      description: Lists published Tables.
      summary: List Tables
      operationId: ListTables
      parameters:
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of tables to return per page
        - name: search
          in: query
          schema:
            type: string
          description: Search criteria for table name
      responses:
        '200':
          description: Paginated list of Tables
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TablesListResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}:
    get:
      tags:
        - Reference data
      description: Retrieves a published Table
      operationId: GetTable
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
          description: A Table object
        '404':
          $ref: '#/components/responses/NotFound'
      summary: Get Table
  /reference-data/v1/tables/{tableUrn}/draft/publish:
    post:
      tags:
        - Reference data
      description: |
        Publishes draft changes to create a new immutable published dataset.
        Optionally accepts a filter to publish only specific records.
        If no filter is provided, all eligible draft records are published.
      summary: Publish draft changes
      operationId: PublishDraftChanges
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishInput'
        required: false
      responses:
        '200':
          description: Changes published successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishResult'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
  /reference-data/v1/tables/{tableUrn}/draft:
    get:
      tags:
        - Reference data
      description: Retrieves a draft dataset definition.
      operationId: GetDraftDataset
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DraftDataset'
          description: Draft dataset definition
        '404':
          $ref: '#/components/responses/NotFound'
      summary: Get draft dataset
  /reference-data/v1/tables/{tableUrn}/draft/records:
    get:
      tags:
        - Reference data
      description: Lists records from a Table draft.
      summary: List Table draft records
      operationId: ListTableDraftRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      responses:
        '200':
          description: Paginated list of draft records with state information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      tags:
        - Reference data
      description: Creates multiple new records in Table draft.
      operationId: CreateTableDraftRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkRecordCreateInput'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
          description: Records created
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      summary: Create records in Table draft
  /reference-data/v1/tables/{tableUrn}/draft/records/batch:
    post:
      tags:
        - Reference data
      description: Updates multiple existing records in Table draft in a single batch operation.
      operationId: BatchUpdateTableDraftRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkRecordUpdateInput'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
          description: Records updated
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      summary: Batch update Table draft records
  /reference-data/v1/tables/{tableUrn}/draft/records/filter:
    post:
      tags:
        - Reference data
      description: Filters records from a Table draft based on specified criteria.
      summary: Filter Table draft records
      operationId: FilterTableDraftRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordFilterRequest'
        required: true
      responses:
        '200':
          description: Paginated list of filtered draft records with state information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/draft/records/{recordUrn}:
    delete:
      tags:
        - Reference data
      description: Deletes a record from Table draft.
      operationId: DeleteTableDraftRecord
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: recordUrn
          required: true
          schema:
            $ref: '#/components/schemas/RecordUrn'
          description: Record URN identifier
      responses:
        '204':
          description: Record deleted
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      summary: Delete Table draft record
  /reference-data/v1/tables/{tableUrn}/records:
    get:
      tags:
        - Reference data
      description: Lists records from a published Table.
      summary: List published Table records
      operationId: ListPublishedTableRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      responses:
        '200':
          description: Paginated list of records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/records/filter:
    post:
      tags:
        - Reference data
      description: Filters records from a published Table based on specified criteria.
      summary: Filter published Table records
      operationId: FilterPublishedTableRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordFilterRequest'
        required: true
      responses:
        '200':
          description: Paginated list of filtered records
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/draft/review:
    post:
      tags:
        - Reference data
      description: |
        Submits draft changes for review by creating a review dataset.
        Optionally accepts a filter to submit only specific records.
        If no filter is provided, all eligible draft records are submitted.
        Returns the review dataset ID which can be used to access review records.
      summary: Submit draft changes for review
      operationId: SubmitDraftForReview
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitForReviewInput'
        required: true
      responses:
        '201':
          description: Review created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewCreatedResponse'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
  /reference-data/v1/tables/{tableUrn}/reviews/{reviewDatasetUrn}:
    get:
      tags:
        - Reference data
      description: Gets information about a specific review dataset
      summary: Get review information
      operationId: GetReviewInfo
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: reviewDatasetUrn
          required: true
          schema:
            $ref: '#/components/schemas/ReviewUrn'
          description: Review dataset URN identifier
      responses:
        '200':
          description: Review information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewInfo'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/reviews/{reviewDatasetUrn}/records:
    get:
      tags:
        - Reference data
      description: Lists records from a review dataset with state information
      summary: List review records
      operationId: ListReviewRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: reviewDatasetUrn
          required: true
          schema:
            $ref: '#/components/schemas/ReviewUrn'
          description: Review dataset URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      responses:
        '200':
          description: Paginated list of review records with state information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/reviews/{reviewDatasetUrn}/records/filter:
    post:
      tags:
        - Reference data
      description: Filters records from a review dataset based on specified criteria
      summary: Filter review records
      operationId: FilterReviewRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: reviewDatasetUrn
          required: true
          schema:
            $ref: '#/components/schemas/ReviewUrn'
          description: Review dataset URN identifier
        - name: after
          in: query
          schema:
            type: string
          description: Cursor for forward pagination. Encoded string representing the position after which to fetch results.
        - name: before
          in: query
          schema:
            type: string
          description: Cursor for backward pagination. Encoded string representing the position before which to fetch results.
        - name: size
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
            maximum: 100
          description: Number of records to return per page
        - name: attributeNames
          in: query
          schema:
            type: array
            items:
              type: string
          description: Specific attributes to include in response
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecordFilterRequest'
        required: true
      responses:
        '200':
          description: Paginated list of filtered review records with state information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecordsWithStateResponse'
        '404':
          $ref: '#/components/responses/NotFound'
  /reference-data/v1/tables/{tableUrn}/reviews/{reviewDatasetUrn}/approve:
    post:
      tags:
        - Reference data
      description: |
        Approves records in the review dataset.
        Optionally accepts a filter to approve only specific records.
        If no filter is provided, all records in the review are approved.
      summary: Approve review records
      operationId: ApproveReviewRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: reviewDatasetUrn
          required: true
          schema:
            $ref: '#/components/schemas/ReviewUrn'
          description: Review dataset URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewRecordsResolutionInput'
        required: false
      responses:
        '200':
          description: Records approved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewRecordsResolutionResult'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
  /reference-data/v1/tables/{tableUrn}/reviews/{reviewDatasetUrn}/reject:
    post:
      tags:
        - Reference data
      description: |
        Rejects records in the review dataset.
        Optionally accepts a filter to reject only specific records.
        If no filter is provided, all records in the review are rejected.
      summary: Reject review records
      operationId: RejectReviewRecords
      parameters:
        - in: path
          name: tableUrn
          required: true
          schema:
            $ref: '#/components/schemas/TableUrn'
          description: Table URN identifier
        - in: path
          name: reviewDatasetUrn
          required: true
          schema:
            $ref: '#/components/schemas/ReviewUrn'
          description: Review dataset URN identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewRecordsResolutionInput'
        required: false
      responses:
        '200':
          description: Records rejected successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewRecordsResolutionResult'
        '403':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    ReferenceDataPaginationMetadata:
      type: object
      description: Pagination metadata for cursor-based pagination following Public API guidelines
      properties:
        prev:
          type:
            - string
            - 'null'
          description: Cursor for previous page. Use with 'before' query parameter. Null on first page.
        next:
          type:
            - string
            - 'null'
          description: Cursor for next page. Use with 'after' query parameter. Null on last page.
        total:
          type: integer
          description: Total count of items (optional)
    TableUrn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:table:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A URN identifying a Table resource in the Reference Data API.

        Format: urn:ata:{tenant}:reference-data:table:{uuid}

        Example: urn:ata:your-tenant:reference-data:table:123e4567-e89b-12d3-a456-426614174000
      example: urn:ata:your-tenant:reference-data:table:123e4567-e89b-12d3-a456-426614174000
    DatasetAttribute:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
          description: Discriminator for attribute type
      required:
        - name
        - type
      discriminator:
        propertyName: type
        mapping:
          DATA: '#/components/schemas/DataAttribute'
          REFERENCE: '#/components/schemas/ReferenceAttribute'
    DataAttributeType:
      type: string
      enum:
        - STRING
        - LONG
        - INTEGER
        - DOUBLE
        - BOOLEAN
        - DATE
        - DATETIME
    DataAttribute:
      allOf:
        - $ref: '#/components/schemas/DatasetAttribute'
        - type: object
          properties:
            dataType:
              $ref: '#/components/schemas/DataAttributeType'
          required:
            - dataType
    ReferenceAttribute:
      allOf:
        - $ref: '#/components/schemas/DatasetAttribute'
        - type: object
          properties:
            referencedTableUrn:
              $ref: '#/components/schemas/TableUrn'
          required:
            - referencedTableUrn
    Table:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/TableUrn'
        name:
          type: string
        description:
          type: string
          description: RichText
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/DatasetAttribute'
        totalRecordsCount:
          type: integer
          format: int64
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - name
        - createdAt
        - attributes
        - totalRecordsCount
    TablesListResponse:
      type: object
      description: Paginated response for tables list following cursor-based pagination standard
      properties:
        meta:
          $ref: '#/components/schemas/ReferenceDataPaginationMetadata'
        data:
          type: array
          description: Array of table objects
          items:
            $ref: '#/components/schemas/Table'
      required:
        - meta
        - data
    ProblemDetail:
      type: object
      properties:
        type:
          type: string
          description: Error type identifier
          example: RESOURCE_NOT_FOUND
        title:
          type: string
          description: Short, human-readable summary of the problem
          example: Resource Not Found
        detail:
          type: string
          description: Detailed specific explanation of the problem
          example: The requested resource with ID '12345' was not found.
    RecordFilter:
      type: object
      properties:
        and:
          type: array
          items:
            $ref: '#/components/schemas/RecordFilter'
        or:
          type: array
          items:
            $ref: '#/components/schemas/RecordFilter'
        recordUrn:
          $ref: '#/components/schemas/IdFilter'
        state:
          $ref: '#/components/schemas/StateFilter'
        attribute:
          $ref: '#/components/schemas/DataAttributeFilter'
    Urn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:[a-z0-9\-]+:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A Uniform Resource Name (URN) for Public API resources following RFC 8141.

        Format: urn:ata:{tenant}:{realm}:{resource-type}:{uuid}

        Components:
        - scheme: 'urn' (fixed)
        - namespace: 'ata' (Ataccama namespace identifier)
        - tenant: Tenant identifier from authentication context
        - realm: Realm identifier (eg. reference-data)
        - resource-type: Type of resource (eg. table, draft, published, etc.)
        - uuid: UUID (v4 or v7) of the resource
      example: urn:ata:acme-corp:reference-data:table:123e4567-e89b-12d3-a456-426614174000
    IdFilter:
      type: object
      properties:
        in:
          type: array
          items:
            $ref: '#/components/schemas/Urn'
        notIn:
          type: array
          items:
            $ref: '#/components/schemas/Urn'
    RecordState:
      type: string
      enum:
        - NEW
        - CHANGED
        - DELETED
        - UNCHANGED
        - REVIEW
    StateFilter:
      type: object
      properties:
        in:
          type: array
          items:
            $ref: '#/components/schemas/RecordState'
        notIn:
          type: array
          items:
            $ref: '#/components/schemas/RecordState'
    StringFilter:
      type: object
      properties:
        contains:
          type: string
        notContains:
          type: string
        equals:
          type: string
        notEquals:
          type: string
        isEmpty:
          type: boolean
        isNotEmpty:
          type: boolean
        in:
          type: array
          items:
            type: string
        notIn:
          type: array
          items:
            type: string
    NumberFilter:
      type: object
      properties:
        equals:
          type: number
          format: float
        notEquals:
          type: number
          format: float
        greater:
          type: number
          format: float
        greaterOrEqual:
          type: number
          format: float
        less:
          type: number
          format: float
        lessOrEqual:
          type: number
          format: float
        isEmpty:
          type: boolean
        isNotEmpty:
          type: boolean
        in:
          type: array
          items:
            type: number
            format: float
        notIn:
          type: array
          items:
            type: number
            format: float
    DateFilter:
      type: object
      properties:
        equals:
          type: string
          format: date-time
        notEquals:
          type: string
          format: date-time
        after:
          type: string
          format: date-time
        onOrAfter:
          type: string
          format: date-time
        before:
          type: string
          format: date-time
        onOrBefore:
          type: string
          format: date-time
        isEmpty:
          type: boolean
        isNotEmpty:
          type: boolean
        in:
          type: array
          items:
            type: string
            format: date-time
        notIn:
          type: array
          items:
            type: string
            format: date-time
    BooleanFilter:
      type: object
      properties:
        equals:
          type: boolean
        notEquals:
          type: boolean
        isEmpty:
          type: boolean
        isNotEmpty:
          type: boolean
    DataAttributeFilter:
      type: object
      properties:
        attributeName:
          type: object
          properties:
            equals:
              type: string
              description: Attribute name to filter on
        string:
          $ref: '#/components/schemas/StringFilter'
        number:
          $ref: '#/components/schemas/NumberFilter'
        date:
          $ref: '#/components/schemas/DateFilter'
        boolean:
          $ref: '#/components/schemas/BooleanFilter'
        referencing:
          $ref: '#/components/schemas/RecordFilter'
      required:
        - attributeName
    PublishInput:
      type: object
      description: Input for publishing draft changes
      properties:
        filter:
          $ref: '#/components/schemas/RecordFilter'
          description: Optional filter to publish only specific records. If omitted, all eligible records are published.
    PublishedUrn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:published:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A URN identifying a Published dataset resource in the Reference Data API.

        Format: urn:ata:{tenant}:reference-data:published:{uuid}

        Example: urn:ata:your-tenant:reference-data:published:323e4567-e89b-12d3-a456-426614174002
      example: urn:ata:your-tenant:reference-data:published:323e4567-e89b-12d3-a456-426614174002
    PublishResult:
      type: object
      required:
        - publishedDatasetUrn
        - publishedAt
      properties:
        publishedDatasetUrn:
          $ref: '#/components/schemas/PublishedUrn'
          description: URN of the newly created published dataset
        publishedAt:
          type: string
          format: date-time
          description: Timestamp when the dataset was published
    DraftUrn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:draft:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A URN identifying a Draft dataset resource in the Reference Data API.

        Format: urn:ata:{tenant}:reference-data:draft:{uuid}

        Example: urn:ata:your-tenant:reference-data:draft:223e4567-e89b-12d3-a456-426614174001
      example: urn:ata:your-tenant:reference-data:draft:223e4567-e89b-12d3-a456-426614174001
    Dataset:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/DraftUrn'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/DatasetAttribute'
        totalRecordsCount:
          type: integer
          format: int64
      required:
        - id
        - attributes
    DraftDataset:
      allOf:
        - $ref: '#/components/schemas/Dataset'
        - type: object
    RecordUrn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:record:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A URN identifying a Record resource in the Reference Data API.

        Format: urn:ata:{tenant}:reference-data:record:{uuid}

        Example: urn:ata:your-tenant:reference-data:record:523e4567-e89b-12d3-a456-426614174004
      example: urn:ata:your-tenant:reference-data:record:523e4567-e89b-12d3-a456-426614174004
    RecordValue:
      type: object
      properties:
        name:
          type: string
        value:
          description: Value of the record attribute (can be any scalar type)
        recordUrn:
          $ref: '#/components/schemas/RecordUrn'
          description: Referenced record URN (for referencing attributes only)
      required:
        - name
    Record:
      type: object
      description: Base record with ID and values (used for published records)
      properties:
        id:
          $ref: '#/components/schemas/RecordUrn'
          description: Record URN identifier (Set by the system, cannot be edited)
        values:
          type: array
          items:
            $ref: '#/components/schemas/RecordValue'
          description: Record attribute values
      required:
        - id
        - values
    RecordWithState:
      allOf:
        - $ref: '#/components/schemas/Record'
        - type: object
          description: Record with state information (used for draft and review records)
          properties:
            state:
              $ref: '#/components/schemas/RecordState'
              description: Record state (NEW, CHANGED, DELETED, UNCHANGED, REVIEW)
          required:
            - state
    RecordsWithStateResponse:
      type: object
      description: Paginated response for records with state information (draft and review records) following cursor-based pagination standard
      properties:
        meta:
          $ref: '#/components/schemas/ReferenceDataPaginationMetadata'
        data:
          type: array
          description: Array of record objects with state information
          items:
            $ref: '#/components/schemas/RecordWithState'
      required:
        - meta
        - data
    RecordCreateInput:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/RecordValue'
      required:
        - values
    BulkRecordCreateInput:
      type: object
      properties:
        records:
          type: array
          items:
            $ref: '#/components/schemas/RecordCreateInput'
      required:
        - records
    RecordUpdateInput:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/RecordValue'
      required:
        - values
    BulkRecordUpdateInput:
      type: object
      properties:
        records:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/RecordUpdateInput'
              - type: object
                properties:
                  id:
                    $ref: '#/components/schemas/RecordUrn'
                required:
                  - id
      required:
        - records
    RecordFilterRequest:
      type: object
      description: Request body for filtering records with envelope wrapper
      properties:
        filter:
          $ref: '#/components/schemas/RecordFilter'
      required:
        - filter
    RecordsResponse:
      type: object
      description: Paginated response for records following cursor-based pagination standard
      properties:
        meta:
          $ref: '#/components/schemas/ReferenceDataPaginationMetadata'
        data:
          type: array
          description: Array of record objects
          items:
            $ref: '#/components/schemas/Record'
      required:
        - meta
        - data
    ReviewTaskPriority:
      type: string
      description: Priority level of a task
      enum:
        - LOW
        - MEDIUM
        - HIGH
        - CRITICAL
    SubmitForReviewInput:
      type: object
      required:
        - name
        - priority
      description: Input for submitting draft changes for review
      properties:
        name:
          type: string
          description: Name/title of the review task
          minLength: 1
          maxLength: 255
        priority:
          $ref: '#/components/schemas/ReviewTaskPriority'
          description: Priority level of the review task
        description:
          type: string
          description: Detailed description of the changes being submitted for review
          maxLength: 4000
        filter:
          $ref: '#/components/schemas/RecordFilter'
          description: Optional filter to submit only specific records for review. If omitted, all eligible records are submitted.
    ReviewUrn:
      type: string
      format: uri
      pattern: ^urn:ata:[a-z0-9][a-z0-9\-]{0,62}:reference-data:review:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      description: |
        A URN identifying a Review dataset resource in the Reference Data API.

        Format: urn:ata:{tenant}:reference-data:review:{uuid}

        Example: urn:ata:your-tenant:reference-data:review:423e4567-e89b-12d3-a456-426614174003
      example: urn:ata:your-tenant:reference-data:review:423e4567-e89b-12d3-a456-426614174003
    ReviewCreatedResponse:
      type: object
      required:
        - reviewDatasetUrn
        - taskMetadata
        - createdAt
      description: Response when a review is created, includes task metadata for the review task
      properties:
        reviewDatasetUrn:
          $ref: '#/components/schemas/ReviewUrn'
          description: URN of the review dataset
        taskMetadata:
          type: object
          description: Metadata for the review task
          required:
            - name
            - priority
          properties:
            name:
              type: string
              description: Name/title of the review task
            priority:
              $ref: '#/components/schemas/ReviewTaskPriority'
              description: Priority level of the review task
            description:
              type: string
              description: Description of the changes under review
        createdAt:
          type: string
          format: date-time
          description: When the review was created
    ReviewInfo:
      type: object
      required:
        - reviewDatasetUrn
        - createdAt
      description: Information about a review dataset
      properties:
        reviewDatasetUrn:
          $ref: '#/components/schemas/ReviewUrn'
          description: URN of the review dataset
        createdAt:
          type: string
          format: date-time
          description: When the review was created
    ReviewRecordsResolutionInput:
      type: object
      description: Input for approving or rejecting review records
      properties:
        filter:
          $ref: '#/components/schemas/RecordFilter'
          description: Optional filter to approve/reject only specific records. If omitted, all records in the review are affected.
    ReviewRecordsResolutionResult:
      type: object
      required:
        - affectedRecordCount
      properties:
        affectedRecordCount:
          type: integer
          description: Number of records that were approved or rejected
          minimum: 0
  responses:
    NotFound:
      description: Resource not found
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetail'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - RESOURCE_NOT_FOUND
                    description: Error type identifier for not found resources
                required:
                  - type
          example:
            type: RESOURCE_NOT_FOUND
            title: Resource Not Found
            detail: Table '01924b84-6f7e-7c0c-8f9d-3a2b4c5d6e7f' was not found
    Unauthorized:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetail'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - UNAUTHORIZED
                    description: Error type identifier for unauthorized access
                required:
                  - type
          example:
            type: UNAUTHORIZED
            title: Unauthorized
            detail: Authentication is required to access this resource.
    Conflict:
      description: Conflict - request conflicts with current state
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetail'
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - CONFLICT
                    description: Error type identifier for conflict errors
                required:
                  - type
          example:
            type: CONFLICT
            title: Conflict
            detail: The request could not be completed due to a conflict with the current state of the resource.
