openapi: 3.1.0
info:
  title: Content Preview API
  version: 1.0.0
paths:
  /spaces/{space_id}:
    get:
      operationId: getASpace
      summary: Get a space
      description: Each space has a name, a set of locales, and metadata about the space.
      tags:
        - spaces
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/content_types:
    get:
      operationId: getTheContentModelOfASpace
      summary: Get the content model of a space
      tags:
        - contentTypes
      parameters:
        - name: space_id
          in: path
          description: ID of the space in form of a string
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/content_types/{content_type_id}:
    get:
      operationId: getAContentType
      summary: Get a content type
      tags:
        - contentTypes
      parameters:
        - name: space_id
          in: path
          description: ID of the space in form of a string
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: content_type_id
          in: path
          description: ID of the content type in form of a string
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/entries:
    get:
      operationId: getAllEntries
      summary: Get all entries
      description: >-
        Returns all entries in a space; linked items appear in the `includes` array when not already in `items`. The
        Preview API includes draft entries, but unresolved links are still excluded from `includes`.
      tags:
        - entries
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/entries/{entry_id}:
    get:
      operationId: getAnEntry
      summary: Get an entry
      description: The `include` array is not applicable while retrieving a single entry.
      tags:
        - entries
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: entry_id
          in: path
          description: Alphanumeric id of the entry to retrieve
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/assets:
    get:
      operationId: getAllAssets
      summary: Get all assets
      tags:
        - assets
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/assets/{asset_id}:
    get:
      operationId: getAnAsset
      summary: Get an asset
      tags:
        - assets
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string.
          required: true
          schema:
            type: string
        - name: asset_id
          in: path
          description: Alphanumeric id of the asset to retrieve.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/asset_keys:
    post:
      operationId: createAnAssetKey
      summary: Create an asset key
      description: >-
        Creates an asset key used to sign embargoed asset URLs for secure delivery. Specify an `expiresAt` Unix
        timestamp (maximum 48 hours ahead) to control key validity.
      tags:
        - assetKeys
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: A *preview* Content Preview API key.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                description: Any type
  /spaces/{space_id}/environments/{environment_id}/locales:
    get:
      operationId: getAllLocalesOfASpace
      summary: Get all locales of a space
      description: >-
        The locales endpoint returns a list of all created locales. One will have the flag `default` set to true and is
        the locale used in the CDA, and you specified no other locale in the request.
      tags:
        - locales
      parameters:
        - name: space_id
          in: path
          description: ID of the space in form of a string
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/tags:
    get:
      operationId: getAllTags
      summary: Get all tags
      description: Returns all the tags that exist in a given environment.
      tags:
        - tags
      parameters:
        - name: space_id
          in: path
          description: ID of the space in form of a string
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/tags/{tag_id}:
    get:
      operationId: getATag
      summary: Get a tag
      description: Returns a single tag based on the given identifier.
      tags:
        - tags
      parameters:
        - name: space_id
          in: path
          description: ID of the space in the form of a string
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: tag_id
          in: path
          description: ID of the tag in form of a string
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concepts/{taxonomy_cda_concept_id}:
    get:
      operationId: getAConcept
      summary: Get a concept
      description: Returns a single taxonomy concept by ID. Authenticate with a CPA access token — CDA tokens return 401.
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: taxonomy_cda_concept_id
          in: path
          description: ID of the concept
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concepts/{taxonomy_cda_concept_id}/ancestors:
    get:
      operationId: getAncestorsOfAConcept
      summary: Get ancestors of a concept
      description: Returns the ancestors of a concept. By default, only direct parents are returned (depth=1).
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: taxonomy_cda_concept_id
          in: path
          description: ID of the concept
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concepts/{taxonomy_cda_concept_id}/descendants:
    get:
      operationId: getDescendantsOfAConcept
      summary: Get descendants of a concept
      description: Returns the descendants of a concept. By default, only direct children are returned (depth=1).
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: taxonomy_cda_concept_id
          in: path
          description: ID of the concept
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concepts:
    get:
      operationId: getAllConcepts
      summary: Get all concepts
      description: >-
        Returns all taxonomy concepts for the organization, with cursor-based pagination. Filter by `conceptScheme`,
        `order`, `limit`, `pageNext`, and `pagePrev` query parameters.
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: Limits the maximum number of concepts returned (per page).
          required: false
          schema:
            type: string
        - name: pageNext
          in: query
          description: >-
            Pagination cursor from which to return the next page of concepts. Alternatively, just call the url at
            `pages.next` in the previous response.
          required: false
          schema:
            type: string
        - name: pagePrev
          in: query
          description: >-
            Pagination cursor from which to return the previous page of concepts. Alternatively, just use the full url
            from `pages.prev` in the previous response.
          required: false
          schema:
            type: string
        - name: conceptScheme
          in: query
          description: Return only concepts belonging to the specified concept scheme
          required: false
          schema:
            type: string
        - name: order
          in: query
          description: 'Options: _sys.createdAt_, _sys.updatedAt_, _prefLabel_'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concept-schemes/{taxonomy_cda_concept_scheme_id}:
    get:
      operationId: getAConceptScheme
      summary: Get a concept scheme
      description: Returns a single concept scheme based on the given identifier.
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: taxonomy_cda_concept_scheme_id
          in: path
          description: ID of the concept scheme
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/taxonomy/concept-schemes:
    get:
      operationId: getAllConceptSchemes
      summary: Get all concept schemes
      description: Returns all the concepts schemes that exist in a given organization.
      tags:
        - taxonomy
      parameters:
        - name: space_id
          in: path
          description: ID of the space
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: Limits the maximum number of concept schemes returned (per page).
          required: false
          schema:
            type: string
        - name: pageNext
          in: query
          description: >-
            Pagination cursor from which to return the next page of concept schemes. Alternatively, just call the url at
            `pages.next` in the previous response.
          required: false
          schema:
            type: string
        - name: pagePrev
          in: query
          description: >-
            Pagination cursor from which to return the previous page of concept schemes. Alternatively, just use the
            full url from `pages.prev` in the previous response.
          required: false
          schema:
            type: string
        - name: order
          in: query
          description: 'Options: _sys.createdAt_, _sys.updatedAt_, _prefLabel_'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/timeline/entries:
    get:
      operationId: getAllTimelineEntries
      summary: Get all timeline entries
      tags:
        - timeline
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: release
          in: query
          description: release id as a string.
          required: true
          schema:
            type: string
        - name: timestamp
          in: query
          description: timestamp in ISO datetime string.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/timeline/entries/{entry_id}:
    get:
      operationId: getATimelineEntry
      summary: Get a timeline entry
      tags:
        - timeline
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string
          required: true
          schema:
            type: string
        - name: entry_id
          in: path
          description: Alphanumeric id of the entry to retrieve
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: release
          in: query
          description: release id as a string.
          required: true
          schema:
            type: string
        - name: timestamp
          in: query
          description: timestamp in ISO datetime string.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/timeline/assets:
    get:
      operationId: getAllTimelineAssets
      summary: Get all timeline assets
      tags:
        - timeline
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: ''
          required: true
          schema:
            type: string
        - name: release
          in: query
          description: release id as a string.
          required: true
          schema:
            type: string
        - name: timestamp
          in: query
          description: timestamp in ISO datetime string.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
  /spaces/{space_id}/environments/{environment_id}/timeline/assets/{asset_id}:
    get:
      operationId: getATimelineAsset
      summary: Get a timeline asset
      tags:
        - timeline
      parameters:
        - name: space_id
          in: path
          description: Alphanumeric id of the space to retrieve.
          required: true
          schema:
            type: string
        - name: environment_id
          in: path
          description: ID of the environment in form of a string.
          required: true
          schema:
            type: string
        - name: asset_id
          in: path
          description: Alphanumeric id of the asset to retrieve.
          required: true
          schema:
            type: string
        - name: access_token
          in: query
          description: token description
          required: true
          schema:
            type: string
        - name: release
          in: query
          description: release id as a string.
          required: true
          schema:
            type: string
        - name: timestamp
          in: query
          description: timestamp in ISO datetime string.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK - Request successful
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  description: Any type
servers:
  - url: https://preview.contentful.com
    description: Preview API server
