# Start a durable curation publication without waiting

`POST /v1/datasets/curation/publications`

- Base URL: `https://junction-api.qualiastudios.dev`
- Authentication: an API key in the `X-API-Key` header, or `Authorization: Bearer …`

## Parameters

- `account_id` (query, string | null (uuid)): Act on this account (active)

## Request body

Required: `application/json` `StartDatasetCurationPublicationBody`

## Responses

- `202` Successful Response: `application/json` `DatasetCurationPublicationOperationModel`
- `401` Invalid or missing API key: `application/json` `ErrorResponse`
- `422` Validation Error: `application/json` `HTTPValidationError`

## Schemas

```yaml
StartDatasetCurationPublicationBody:
  properties:
    idempotency_key:
      type: string
      format: uuid
    analysis_id:
      type: string
      format: uuid
    selection_digest:
      type: string
      pattern: ^[0-9a-f]{64}$
    audit_repo_id:
      type: string
      format: uuid
    expected:
      $ref: "#/components/schemas/PublicationExpectedHeadModel"
    definition_id:
      format: uuid
      type:
        - string
        - "null"
    name:
      type: string
      pattern: ^(?:[A-Za-z0-9][A-Za-z0-9._-]{0,127})?$
      default: ""
    description:
      type: string
      maxLength: 4096
      default: ""
    note:
      type: string
      maxLength: 4096
      default: ""
  additionalProperties: false
  type: object
  required:
    - idempotency_key
    - analysis_id
    - selection_digest
    - audit_repo_id
    - expected
  title: StartDatasetCurationPublicationBody
  description: Cold publication launch; the response is always a durable operation.
PublicationExpectedHeadModel:
  properties:
    generation:
      type: integer
      exclusiveMinimum: 0
    git_hash_algorithm:
      type: string
      enum:
        - sha1
        - sha256
    git_oid:
      type: string
      pattern: ^[0-9a-f]+$
    commit_id:
      type: string
      format: uuid
    pack_digest:
      type: string
      pattern: ^[0-9a-f]{64}$
  additionalProperties: false
  type: object
  required:
    - generation
    - git_hash_algorithm
    - git_oid
    - commit_id
    - pack_digest
  title: PublicationExpectedHeadModel
  description: Exact paired Git/lakehouse head used as a mutation fence.
DatasetCurationPublicationOperationModel:
  properties:
    idempotency_key:
      type: string
      format: uuid
    state:
      type: string
      enum:
        - queued
        - running
        - published
        - retryable
        - failed
    receipt:
      nullable: true
      allOf:
        - $ref: "#/components/schemas/DatasetCurationReceiptModel"
    failure_code:
      maxLength: 128
      minLength: 1
      type:
        - string
        - "null"
    failure_detail:
      maxLength: 65536
      minLength: 1
      type:
        - string
        - "null"
  additionalProperties: false
  type: object
  required:
    - idempotency_key
    - state
  title: DatasetCurationPublicationOperationModel
DatasetCurationReceiptModel:
  properties:
    idempotency_key:
      type: string
      format: uuid
    definition_id:
      type: string
      format: uuid
    version_id:
      type: string
      format: uuid
    version:
      type: integer
      exclusiveMinimum: 0
    included_episode_count:
      type: integer
      maximum: 100000
      exclusiveMinimum: 0
    excluded_episode_count:
      type: integer
      maximum: 100000
      minimum: 0
    evidence_digest:
      type: string
      pattern: ^[0-9a-f]{64}$
    audit_repo_id:
      type: string
      format: uuid
    audit_path:
      type: string
      maxLength: 4096
      minLength: 1
    audit_manifest_id:
      type: string
      pattern: ^[0-9a-f]{64}$
    git_generation:
      type: integer
      exclusiveMinimum: 0
    git_commit_id:
      type: string
      format: uuid
    git_hash_algorithm:
      type: string
      enum:
        - sha1
        - sha256
    git_oid:
      type: string
      pattern: ^[0-9a-f]+$
    git_snapshot_digest:
      type: string
      pattern: ^[0-9a-f]{64}$
    dataset_snapshot_id:
      type: string
      pattern: ^[0-9a-f]{64}$
    membership_hash:
      type: string
      pattern: ^[0-9a-f]{64}$
    norm_stats_hash:
      type: string
      pattern: ^[0-9a-f]{64}$
  additionalProperties: false
  type: object
  required:
    - idempotency_key
    - definition_id
    - version_id
    - version
    - included_episode_count
    - excluded_episode_count
    - evidence_digest
    - audit_repo_id
    - audit_path
    - audit_manifest_id
    - git_generation
    - git_commit_id
    - git_hash_algorithm
    - git_oid
    - git_snapshot_digest
    - dataset_snapshot_id
    - membership_hash
    - norm_stats_hash
  title: DatasetCurationReceiptModel
ErrorResponse:
  properties:
    detail:
      type: string
      description: Error message describing what went wrong
  type: object
  required:
    - detail
  title: ErrorResponse
  description: Standard error response.
HTTPValidationError:
  properties:
    detail:
      items:
        $ref: "#/components/schemas/ValidationError"
      type: array
  type: object
  title: HTTPValidationError
ValidationError:
  properties:
    loc:
      items:
        type:
          - string
          - integer
      type: array
      title: Location
    msg:
      type: string
      title: Message
    type:
      type: string
      title: Error Type
    input: {}
    ctx:
      type: object
      title: Context
  type: object
  required:
    - loc
    - msg
    - type
  title: ValidationError
```
