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

# Publish Record

> Publish one or more versions of a content record to specified environments. Provide mappings of environment IDs to version IDs. Returns lists of which verson publish succeeded or failed.

Before calling this endpoint, make sure you’ve generated an API token and picked the correct domain. See [Authentication & Base URLs](/api-reference/authbaseurl).


## OpenAPI

````yaml PATCH /content/v2/content-models/{modelInternalName}/records/{contentModelDataId}/versions/publish
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://apis.experro.app
    description: Admin Server
  - url: https://{base-address}
    description: Custom Server
    variables:
      base-address:
        default: ''
        description: Enter your custom domain or server address.
security:
  - bearerAuth: []
paths:
  /content/v2/content-models/{modelInternalName}/records/{contentModelDataId}/versions/publish:
    patch:
      summary: Publish a Record Version to Environments
      description: >-
        Publish one or more versions of a content record to specified
        environments. Provide mappings of environment IDs to version IDs.
        Returns lists of which verson publish succeeded or failed.
      parameters:
        - $ref: '#/components/parameters/TenantIdHeader'
        - $ref: '#/components/parameters/WorkspaceIdHeader'
        - $ref: '#/components/parameters/EnvironmentIdHeader'
        - name: modelInternalName
          in: path
          required: true
          schema:
            type: string
          description: Internal name of the content model.
        - name: contentModelDataId
          in: path
          required: true
          schema:
            type: string
          description: Unique ID of the content record to publish.
        - $ref: '#/components/parameters/LocaleQryPrm'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version_data:
                  type: array
                  description: >-
                    Array mapping environment IDs to their respective version
                    IDs for publishing.
                  items:
                    type: object
                    properties:
                      environment_id:
                        type: string
                        description: Unique identifier of the environment to publish into.
                      version_id:
                        type: string
                        description: >-
                          Unique identifier for the version of the record to
                          publish.
                    required:
                      - environment_id
                      - version_id
              required:
                - version_data
      responses:
        '200':
          description: >-
            Publish operation results, with lists of succeeded and failed
            environment IDs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Indicates overall result of the publish request.
                  Data:
                    type: object
                    properties:
                      success:
                        type: array
                        description: List of version IDs for which publish succeeded.
                        items:
                          type: string
                          format: uuid
                      failures:
                        type: array
                        description: List of version IDs for which publish failed.
                        items:
                          type: string
                    required:
                      - success
                      - failures
                required:
                  - Status
                  - Data
        '400':
          description: Bad Request – e.g. missing `version_data` or invalid IDs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error404'
        '401':
          description: Unauthorized – Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error401'
        '500':
          description: Internal Server Error – an unexpected error on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error500'
      servers:
        - url: https://apis.experro.app
          description: Admin Server
components:
  parameters:
    TenantIdHeader:
      name: x-tenant-id
      in: header
      required: true
      schema:
        type: string
      description: Identifier for the tenant. Ensures data isolation per tenant.
    WorkspaceIdHeader:
      name: x-workspace-id
      in: header
      required: true
      schema:
        type: string
      description: >-
        Workspace identifier within the tenant. Scopes resources to a specific
        workspace.
    EnvironmentIdHeader:
      name: x-environment-id
      in: header
      required: true
      schema:
        type: string
        example: PRODUCTION-15a0f8c2-a5e8-4e40-ae74-cb1389d22f45-w49jkngj
      description: >-
        Unique identifier of the target environment. Used to scope the API call
        to a specific deployment environment.
    LocaleQryPrm:
      name: locale
      in: query
      description: Specifies the language or region for the response data
      required: true
      schema:
        type: string
  schemas:
    Error404:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
    Error401:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
    Error500:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````