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

# Publish a destination version

> Publishes a new version, or the pending endpoint content of a published one. Returns 202 with `state` `Updating`; read `publications/latest` or the version until `state` is `Published`. 409: the version has no endpoint, a publish already runs, or the version is stopped or being deleted.



## OpenAPI

````yaml /api-reference/openapi/configuration.json post /v1/destinations/{destinationId}/versions/{version}/publications
openapi: 3.2.0
info:
  title: Configuration API
  description: >-
    Manages applications, sources, source properties, source folders, managed
    tags and their values, card definitions, their segments and relation
    definitions; manages destinations, their versions and endpoints, and
    publishes versions; and authors, previews and activates card lifecycles.
    Card property changes are saved as pending changes and take effect when the
    card definition is activated. Source property changes and source deletion
    can finish asynchronously. The tenant comes from the access token.
    Successful responses return the resource itself; lists return a page with
    `items`, the `after` cursor for the next page and, when asked for,
    `totalCount` (`limit` default 50, max 200; lifecycle lists default 25, max
    100). Application updates replace the settings and need the latest `etag`;
    secrets are returned only when created. Errors are problem details
    (`application/problem+json`). Values are PascalCase in REST and UPPER_CASE
    in GraphQL.
  version: 1.0.0
servers:
  - url: https://api.occtoo.com
security: []
tags:
  - name: Applications
  - name: Card definitions
  - name: Card exports
  - name: Destination endpoints
  - name: Destination versions
  - name: Destinations
  - name: Languages
  - name: Lifecycles
  - name: Managed tag values
  - name: Managed tags
  - name: Relation definitions
  - name: Segments
  - name: Sources
paths:
  /v1/destinations/{destinationId}/versions/{version}/publications:
    post:
      tags:
        - Destination versions
      summary: Publish a destination version
      description: >-
        Publishes a new version, or the pending endpoint content of a published
        one. Returns 202 with `state` `Updating`; read `publications/latest` or
        the version until `state` is `Published`. 409: the version has no
        endpoint, a publish already runs, or the version is stopped or being
        deleted.
      operationId: PublishDestinationVersion
      parameters:
        - name: destinationId
          in: path
          description: Id of the destination (e.g. `catalogue`).
          required: true
          schema:
            type: string
        - name: version
          in: path
          description: Version number of the destination (e.g. `1`).
          required: true
          schema:
            pattern: ^-?(?:0|[1-9]\d*)$
            type: integer
            format: int32
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DestinationVersionResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/HttpValidationProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying.
              schema:
                minimum: 1
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - kindeOAuth: []
        - bearerAuth: []
        - apiKey: []
components:
  schemas:
    DestinationVersionResponse:
      required:
        - version
        - id
        - state
        - revision
        - authentication
        - allowedOrigins
        - languages
        - defaultLanguage
        - description
        - stopReason
        - etag
        - createdAt
        - updatedAt
      type: object
      properties:
        version:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: >-
            The version number, starting at 1. Part of the URL of the published
            API.
          format: int32
        id:
          type: string
          description: The identifier access tokens for a protected version are issued for.
          format: uuid
        state:
          $ref: '#/components/schemas/ApiVersionState'
          description: >-
            Where the version is in its life: `New` until first published,
            `Published` when live. See `ApiVersionState`.
        revision:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Grows each time the published content of the version changes.
          format: int32
        authentication:
          $ref: '#/components/schemas/AuthenticationOption'
          description: >-
            Whether callers of the published API need an access token. See
            `AuthenticationOption`.
        allowedOrigins:
          type: array
          items:
            type: string
          description: Origins browsers may call the published API from. `*` allows any.
        languages:
          type: array
          items:
            $ref: '#/components/schemas/DestinationVersionLanguage'
          description: The languages the published API serves.
        defaultLanguage:
          type: string
          description: The `language` used when a caller sends none.
        description:
          type:
            - 'null'
            - string
          description: Free text describing this version.
        stopReason:
          type: array
          items:
            type: string
          description: Why the version is stopped. Empty unless `state` is `Stopped`.
        etag:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - integer
            - string
          description: Version of this resource to send in `If-Match`.
          format: uint32
        createdAt:
          type: string
          description: When the version was created.
          format: date-time
        updatedAt:
          type: string
          description: When the version last changed.
          format: date-time
      description: >-
        One version of a destination's API, with its access and language
        settings.
    HttpValidationProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type:
            - 'null'
            - string
        title:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
    ApiVersionState:
      enum:
        - New
        - PreviewPublishStarted
        - Preview
        - PublishStarted
        - Published
        - DeleteStarted
        - Deleted
        - Stopped
        - PublishFailed
        - Updating
        - Operational
        - Restarting
      description: >-
        Describes the publishing state of an API version. The version's API
        answers reads in every state except `NEW`, `DELETE_STARTED` and
        `DELETED`. `PUBLISHED` is live and settled; `PREVIEW_PUBLISH_STARTED`,
        `UPDATING`, `OPERATIONAL`, `RESTARTING` and `DELETE_STARTED` are in
        progress; `PUBLISH_FAILED` failed.
      x-enum-descriptions:
        New: Created and never published. The API doesn't answer yet.
        PreviewPublishStarted: >-
          In progress: a publish started with `isPreview: true`. Ends
          `PUBLISHED` or `PUBLISH_FAILED`.
        Preview: No longer used.
        PublishStarted: No longer used.
        Published: 'Live: publishing finished and the API serves the version''s data.'
        DeleteStarted: >-
          In progress: `deleteApiVersion` is tearing the version down. Ends
          `DELETED`.
        Deleted: Deleted. The API no longer answers.
        Stopped: >-
          Stopped by `stopVersion`: the API still answers, but data changes no
          longer reach it. `restartVersionPublish` resumes it.
        PublishFailed: >-
          Failed: the last publish didn't finish. `publishingStatus` shows the
          failed step; run `publishVersion` again.
        Updating: >-
          In progress: `publishVersion` is publishing the version or its
          changes. Moves on to `OPERATIONAL` or `PUBLISHED`.
        Operational: >-
          In progress: the API answers while its data is still loading. Ends
          `PUBLISHED`.
        Restarting: >-
          In progress: `restartVersionPublish` is rebuilding the published data.
          Ends `PUBLISHED`.
    AuthenticationOption:
      enum:
        - Protected
        - AllowAnonymous
      description: Sets how callers of a destination version's API authenticate.
      x-enum-descriptions:
        Protected: >-
          Callers send a bearer token issued to one of the version's
          applications (`Application.accessToken`) or an API key of the tenant.
        AllowAnonymous: >-
          Callers need no credentials. The default when `createApiVersion`
          doesn't set one.
    DestinationVersionLanguage:
      required:
        - language
        - sourceLanguage
      type: object
      properties:
        language:
          type: string
          description: The language code callers of the published API send.
        sourceLanguage:
          type: string
          description: The language of the card data served for it.
      description: One language a destination version serves.
  securitySchemes:
    kindeOAuth:
      type: oauth2
      description: >-
        Sign in with the existing Occtoo Studio identity and selected
        organization.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.occtoo.com/oauth2/auth?audience=https%3A%2F%2Fapi-weu.occtoo.com
          tokenUrl: https://auth.occtoo.com/oauth2/token
          scopes:
            openid: Authenticate the user with OpenID Connect.
            profile: Read the user's basic profile.
            email: Read the user's email address.
            offline: Refresh the access token without another interactive sign-in.
          x-usePkce: SHA-256
          x-scalar-redirect-uri: https://api.occtoo.com/docs/
    bearerAuth:
      type: http
      description: >-
        Tenant-scoped Occtoo access token, including Kinde machine-to-machine
        application tokens.
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      description: Occtoo organization API key.
      name: x-api-key
      in: header

````

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