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

# Unpublish Record

> Remove one or more versions of a content record from specified environments. Supply mappings of environment IDs to version IDs to unpublish. Returns lists of successfully unpublished and failed version IDs.

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/unpublish
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/unpublish:
    patch:
      summary: Unpublish Record Versions from Environments
      description: >-
        Remove one or more versions of a content record from specified
        environments. Supply mappings of environment IDs to version IDs to
        unpublish. Returns lists of successfully unpublished and failed version
        IDs.
      parameters:
        - $ref: '#/components/parameters/TenantIdHeader'
        - $ref: '#/components/parameters/WorkspaceIdHeader'
        - $ref: '#/components/parameters/EnvironmentIdHeader'
        - name: modelInternalName
          in: path
          required: true
          schema:
            type: string
          description: The 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
              description: Mappings of environments to versions to unpublish.
              properties:
                version_data:
                  description: List of `{ environment_id, version_id }` pairs to unpublish.
                  type: array
                  items:
                    type: object
                    properties:
                      environment_id:
                        type: string
                        description: Environment from which to remove the version.
                      version_id:
                        type: string
                        description: Version identifier to unpublish.
                    required:
                      - environment_id
                      - version_id
              required:
                - version_data
      responses:
        '200':
          description: >-
            Unpublish operation results, listing succeeded and failed
            environment IDs.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    description: Overall result of the unpublish request.
                  Data:
                    type: object
                    properties:
                      success:
                        type: array
                        description: Version IDs successfully unpublished.
                        items:
                          type: string
                          format: uuid
                      failures:
                        type: array
                        description: Version IDs where unpublish failed.
                        items:
                          type: string
                    required:
                      - success
                      - failures
                required:
                  - Status
                  - Data
        '400':
          description: >-
            Bad Request – e.g. missing `title`, invalid unique ID format, or
            forbidden field change.
          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

````