openapi: 3.0.0
info:
  version: 0.4.0
  title: API documentation
  description: >-
    The Enterspeed API are based on REST principles.


    Before you start you will need to [create an
    Enterspeed-account](https://app.enterspeed.com) and set up a tenant (a
    property for your website). Here you can create

    - A data source (provides you with an API key for the **Ingest API**).

    - An environment client (provides you with an API key for the **Delivery
    API** and **Query API**).

    - A domain (ensure the correct data gets fetched).


    🎉 Have fun using our API. Make sure to [contact
    us](https://www.enterspeed.com/contact) if you need any help. We're happy
    assist!
  x-logo:
    url: https://docs.enterspeed.com/img/logo.svg
    altText: Enterspeed Logo
  license:
    name: See Enterspeed Terms of service
    url: https://www.enterspeed.com/terms-of-service
tags:
  - name: Delivery
    description: >-
      The Delivery API is what you use to `GET` your data from Enterspeed to
      your frontend project. Before you can fetch your content from Enterspeed,
      you first need to create an **Environment client** which generates an API
      key. This is done under *Settings --> Environment settings*.


      You can find an example of how to fetch data [Umbraco & Next.js
      tutorial](https://docs.enterspeed.com/tutorials/umbraco-nextjs/fetching-data-in-nextjs).
  - name: Ingest
    description: >-
      The Ingest API is used to `POST` your current data sources into
      Enterspeed. Before you can start ingesting data, you'll need to create a
      **Data source** inside Enterspeed, which generates an API key. This is
      done under *Settings --> Data sources*.


      The Ingest API can also be used to `DELETE` already ingested data from
      Enterspeed.
  - name: Routes
    description: >-
      The Routes API is what you use to `GET` all available URL routes for a
      specific environment, which can be helpful for SSG (Static Site
      Generation) or creating a sitemap.


      Before you can fetch your routes from Enterspeed, you first need to create
      an **Environment client** which generates an API key. This is done under
      *Settings --> Environment settings*.


      **ℹ NOTE:** The `first` or `last` parameter is required and must be set
      between 100 - 500 (e.g. `first=250`). Both are not allowed at the same
      time.
  - name: Query
    description: >-
      The Query API is what you use to query items from your indexes.


      Before you can query your indexes from Enterspeed, you first need to
      create an **Environment client** which generates an API key. This is done
      under *Settings --> Environment settings*.
servers:
  - url: https://api.enterspeed.com
    description: General API
paths:
  /v2:
    servers:
      - url: https://delivery.enterspeed.com
        description: Delivery API
    get:
      summary: Get content by URL, IDs, or handles
      description: >
        Used to fetch views by a single URL and/or multiple IDs or handles in a
        single request. 


        *Note: The maximum url length is 4096 characters*
      tags:
        - Delivery
      operationId: getContent
      parameters:
        - name: url
          in: query
          description: |
            The URL to get data from.
            **Maximum**: 1   **Required**: false
          example: https://enterspeed.com/about-us/
          required: false
          schema:
            type: string
            default: ''
        - name: id
          in: query
          description: |
            Specific view ids to get data from.

            **Maximum**: unlimited  
            **Required**: false
          example: >-
            gid://Environment/f0edd7b7-23dd-4177-a98a-313127601e97/Source/32ebdcab-ae19-4a71-a09e-a93257b807b7/Entity/4573/ContentPage
          required: false
          schema:
            type: string
            default: ''
        - name: handle
          in: query
          description: >
            Specific handles to get data from. Handles will be returned in the
            __views__ object and must be unique.


            **Maximum**: unlimited  

            **Required**: false
          example: Navigation
          required: false
          schema:
            type: string
            default: ''
        - name: includeDuplicateViews
          in: query
          description: >
            By default, each view is returned only once. However, if you set
            includeDuplicateViews to true, the view will be returned for each
            matching requested handle
          example: 'true'
          schema:
            type: boolean
            default: false
          required: false
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/RouteResponse'
                  - $ref: '#/components/schemas/NoRouteFoundResponse'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: >-
            Forbidden. The X-Api-Key is valid but does not have the necessary
            permissions.
        '422':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TooManyUrlsResponse'
                  - $ref: '#/components/schemas/NoParametersResponse'
    post:
      summary: Get content by IDs, or handles
      description: >
        The Post version of the Delivery API is used to fetch many view by IDs
        or handles.


        *Note: The maximum handles and ids combined in one request is limited to
        1000*
      tags:
        - Delivery
      operationId: getContentPost
      parameters:
        - name: includeDuplicateViews
          in: query
          description: >
            By default, each view is returned only once. However, if you set
            includeDuplicateViews to true, the view will be returned for each
            matching requested handle
          example: 'true'
          schema:
            type: boolean
            default: false
          required: false
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients). 


            Note: The endpoint does not support `Transfer-Encoding: chunked`.
            `JsonContent` and `PostAsJsonAsync` in .NET will by default set the
            `Transfer-Encoding: chunked` header. Use types like e.g.
            `StringContent` or `ByteArrayContent` instead.
          schema:
            type: number
      requestBody:
        description: The ids or handles of the views to load
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/GetByIdsOrHandles'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                type: object
                oneOf:
                  - $ref: '#/components/schemas/ViewResponse'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: >-
            Forbidden. The X-Api-Key is valid but does not have the necessary
            permissions.
        '422':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/NoIdsOrHandlesParametersResponse'
  /ingest/v2/{originId}:
    post:
      summary: Save entity
      description: >
        Starting the process for saving the entity.


        This endpoint can be used in two ways:


        - **Raw**: The body contains the raw source entity and the required meta
        data is provided as header parameters.

        - **Simplified**: The source entity is given `properties` of the body
        which also includes meta data.
      tags:
        - Ingest
      operationId: saveEntity
      parameters:
        - name: originId
          in: path
          required: true
          description: >
            Id of the entity. Must be same format for all entities within the
            same source.

            Eg. integers, guids, etc.
          schema:
            type: string
            example: '1'
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your source.
          schema:
            type: string
            example: source-90880177-e9a1-47b3-9a40-7b728a6bafd8
        - name: X-Enterspeed-Type
          required: true
          in: header
          description: >
            The type or alias of the type of entity being send to process.

            Eg. blogList, blogPage, frontPage, etc.

            Only used for raw body


            The type is immutable after initial ingest. If an entity with the
            same originId already exists and the type differs, the ingest will
            be rejected with a type change error in the response. Type
            comparison is case-sensitive. To change the entity type, delete the
            entity and re-ingest with the new type, or use
            X-Enterspeed-Force-Type to override.
          schema:
            type: string
            example: product
        - name: X-Enterspeed-Force-Type
          required: false
          in: header
          description: >
            Optional header to override type immutability validation. Include
            this header to bypass the type immutability check and allow
            re-ingesting an entity with a different type. This is a destructive
            operation that rebuilds affected views. Use only when intentional
            type changes are required.


            The value needs to be one of `true`, `TRUE`, `1`.
          schema:
            type: string
            example: 'true'
        - name: X-Enterspeed-Url
          in: header
          description: >
            If the entity is routable send the URL. Skip if entity is not
            routable.

            Only used for raw body. 

            Note: The URL needs to begin with a leading slash.
          schema:
            type: string
            example: /product-1
        - name: X-Enterspeed-OriginParentId
          in: header
          description: |
            Allowed as null if no hierarchy exists.
            Only used for raw body
          schema:
            type: string
            example: '2'
        - name: X-Enterspeed-Redirects
          in: header
          description: >
            Comma separated list of URLs that redirects to the current page. Eg.
            https://enterspeed.com/product-1-old/ redirecting to
            https://enterspeed.com/product-1/.
          schema:
            type: string
            example: /product-old,/product-very-old
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients). 


            Note: The endpoint does not support `Transfer-Encoding: chunked`.
            `JsonContent` and `PostAsJsonAsync` in .NET will by default set the
            `Transfer-Encoding: chunked` header. Use types like e.g.
            `StringContent` or `ByteArrayContent` instead.
          schema:
            type: number
      requestBody:
        description: The entity to process
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Raw'
                - $ref: '#/components/schemas/Simplified'
      responses:
        '200':
          description: >-
            Valid request. Processing of posted entity has begun or source
            entity hasn't changed and won't be processed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 200
                  message:
                    type: string
                    example: Processing has been initiated.
              example:
                status: 200
                message: Processing has been initiated.
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '413':
          description: |
            Payload Too Large. The entity is too large to process.

            Returns ErrorApiResponse with status, errorCode, and message.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 413
                  message:
                    type: string
                    description: Error message explaining the payload size issue
                    example: >-
                      Source entity size exceeds 5,242,880B. Actual size
                      10,485,760B
                  errorCode:
                    type: string
                    example: s-1007
              example:
                status: 413
                message: Source entity size exceeds 5,242,880B. Actual size 10,485,760B
                errorCode: s-1007
        '422':
          description: >
            Unprocessable Entity. The request was well-formed but was unable to
            be followed due to semantic errors.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 422
                  message:
                    type: string
                    description: Error message explaining the validation failure
                    example: Invalid request
                  errorCode:
                    type: string
                    example: s-1001
                  errors:
                    type: object
                    description: Dictionary mapping field names to error message strings
                    additionalProperties:
                      type: string
              example:
                status: 422
                message: Invalid request
                errorCode: s-1001
                errors:
                  type: >-
                    Type cannot be changed from 'product' to 'productVariant'.
                    Use the X-Enterspeed-Force-Type header to override, or
                    delete the source entity first.
        '500':
          description: >
            Internal Server Error. Something went wrong on our end while
            processing the request.
          content:
            text/plain:
              schema:
                type: string
              example: Internal server error
    delete:
      summary: Delete entity
      description: |
        Starting the process for deleting the entity.
      tags:
        - Ingest
      operationId: deleteEntity
      parameters:
        - name: originId
          in: path
          required: true
          description: The originId to delete
          schema:
            type: string
            example: '1234'
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your source.
          schema:
            type: string
            example: source-90880177-e9a1-47b3-9a40-7b728a6bafd8
      responses:
        '200':
          description: Valid request. Processing of deleting the entity has begun.
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '404':
          description: No entity found with that id.
  /ingest/v2:
    post:
      summary: Save entities
      description: >
        Starting the process for saving entities.


        *Note: The bulk endpoint can take up to 50 entities in a single
        request.*


        *Note: The total size of the request body must not exceed 200 MB.*
      tags:
        - Ingest
      operationId: saveEntityBulk
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your source.
          schema:
            type: string
            example: source-90880177-e9a1-47b3-9a40-7b728a6bafd8
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients). 


            Note: The endpoint does not support `Transfer-Encoding: chunked`.
            `JsonContent` and `PostAsJsonAsync` in .NET will by default set the
            `Transfer-Encoding: chunked` header. Use types like e.g.
            `StringContent` or `ByteArrayContent` instead.
          schema:
            type: number
      requestBody:
        description: Array of entities to process
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkSimplified'
      responses:
        '200':
          description: >
            Valid request. Processing of posted entities has begun. 


            A successful response is returned if one or more entities were
            valid. Only if all entities are invalid a 422 response is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkIngestResult'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '422':
          description: >-
            Unprocessable request. The request was well-formed but was unable to
            be followed due to semantic errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkIngestResult'
    delete:
      summary: Delete entities
      description: >
        Starting the process for deleting entities.


        *Note: The bulk endpoint can take up to 50 entities in a single
        request.*
      tags:
        - Ingest
      operationId: deleteEntityBulk
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your source.
          schema:
            type: string
            example: source-90880177-e9a1-47b3-9a40-7b728a6bafd8
      requestBody:
        description: Array of originIds to delete
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkDelete'
      responses:
        '200':
          description: >
            Valid request. Processing of deleting the entities has begun.


            A successful response is returned if one or more entities were
            valid. Only if all entities are invalid a 422 response is returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 200
                  deletedSourceEntities:
                    type: array
                    example:
                      - p-5427
                  notFoundSourceEntities:
                    type: array
                    example:
                      - p-6724
                  errors:
                    type: object
                    example:
                      '1234':
                        - OriginId must be a string, not a number at position 3
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '404':
          description: No entity found with that id.
  /routes/v1:
    get:
      summary: Get Routes
      description: |
        Get all the routes for a specific environment.
      tags:
        - Routes
      operationId: getRoutes
      parameters:
        - name: first
          in: query
          description: >-
            Get the first of the paginated list, aka. get the list in ascending
            order.
          schema:
            type: number
            example: 100
        - name: last
          in: query
          description: >-
            Get the last of the paginated list, aka. get the list in descending
            order.
          schema:
            type: number
            example: 100
        - name: before
          in: query
          description: The cursor to get data before, eg. previous page.
          schema:
            type: number
        - name: after
          in: query
          description: The cursor to get data after, eg. next page.
          schema:
            type: number
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutesResponse'
              example:
                total: 16
                pageInfo:
                  hasNextPage: true
                  hasPreviousPage: false
                  startCursor: YmQ2YTY0NTgtZmU1Ny00MDZmLTlkMzgtNGNjMTczYWZmNzg2
                  endCursor: ZjJlNmY5NWYtOWM3ZS00N2I5LWI0N2ItMGY4M2YxYjMzZjQ1
                results:
                  - url: /about-us
                    redirect: null
                    updatedAt: '2021-05-21T10:22:21.262781Z'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: >-
            Forbidden. The X-Api-Key is valid but does not have the necessary
            permissions.
        '422':
          description: |
            Can be either of these: 
              * first and last is not allowed at the same time (Parameter 'first', 'last')
              * first or last must be set between 100 - 500 (Parameter 'first', 'last')
              * first must be set between 100 - 500 (Parameter 'first'')
              * last must be set between 100 - 500 (Parameter 'last')
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    example: 422
                  message:
                    type: string
                    example: >-
                      first and last is not allowed at the same time (Parameter
                      'first', 'last')
  /routes/v2:
    get:
      summary: Get Routes v2
      description: |
        Get all the routes for a specific environment with continuation token.
      tags:
        - Routes
      operationId: getRoutesV2
      parameters:
        - name: X-Continuation-Token
          in: header
          description: Continuation token to get the next page.
          schema:
            type: string
        - name: X-Api-Key
          in: header
          description: Api key to validate your environment.
          required: true
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutesV2Response'
              example:
                continuationToken: ZjJlNmY5NWYtOWM3ZS00N2I5LWI0N2ItMGY4M2YxYjMzZjQ1
                results:
                  - url: /
                    redirect: null
                    updatedAt: '2023-01-18T10:03:17.8862119Z'
                  - url: /fairy-tales/the-leap-frog/
                    redirect: /old-url/the-leap-frog/
                    updatedAt: '2023-07-03T13:23:41.0559142Z'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: >-
            Forbidden. The X-Api-Key is valid but does not have the necessary
            permissions.
  /v1/{indexAlias}:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      summary: Query items
      description: |
        The Query API is used to query items in an index.
      tags:
        - Query
      operationId: queryContentPost
      parameters:
        - name: indexAlias
          in: path
          required: true
          description: |
            The alias of the index to be queried.
          schema:
            type: string
            example: productIndex
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients).
          schema:
            type: number
      requestBody:
        description: >-
          The query object including things like filters, sorting and
          pagination.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestBody'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/QueryResponse'
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400Response'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: Forbidden. The API key does not have the necessary permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query403Response'
  /v1:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      summary: Multi query items
      description: >
        The Query API is used to query items in an index, with this endpoint up
        to 5 queries can be requested in a single payload, each query defining
        the index to perform the lookup in.
      tags:
        - Query
      operationId: queryMultiContentPost
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients).
          schema:
            type: number
      requestBody:
        description: >
          The query consists of a list of query objects, on the format just like
          when quering items in a single index, so refer to this section when
          looking into `filters`, `sorting`, `pagination` etc.


          The only thing that differs with these query objects, is an addition
          of an `index` and a `name` field, so you per query can define which
          index you want to perform the query against and also name the
          individual query. This means that this service can perform multiple
          queries on the same index, or perform queries on multiple indicies in
          one request, and also give you the ability to name queries for easier
          identification of the resulting result sets.


          ### Note

          The request payload can at most take 5 queries in one request.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestList'
      responses:
        '200':
          description: >
            When one or more queries results in a valid response a 200 response
            is returned.

            If any of the other requested queries fails, either due to
            validation errors or other issues, the error message will be
            returned as part of the response.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/QueryResponseExtendedList'
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400ExtendedResponseList'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: Forbidden. The API key does not have the necessary permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query403Response'
  /v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      summary: Query items from Auto Indexing source groups
      description: >
        Note: This endpoint is currently in preview


        The Query API is used to query items in an index, this endpoint lets you
        query items ingested to Auto Indexing source groups.
      tags:
        - Query
      operationId: queryAutoIndengPost
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients).
          schema:
            type: number
      requestBody:
        description: >
          The query uses the same format as the [Query items
          endpoint](#tag/Query/operation/queryContentPost) with the only
          exeption that `aliases` is not supported here.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestAutoIndexing'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/QueryAutoIndexingResponse'
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400Response'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: Forbidden. The API key does not have the necessary permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query403Response'
  /v1/source:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      summary: Multi query items from Auto Indexing source groups
      description: >
        Note: This endpoint is currently in preview


        The Query API is used to query items in an index, this endpoint lets you
        query items ingested to Auto Indexing source groups with up to 5 queries
        requested in a single payload, each query defining the source groups
        alias and source entity type to perform the lookup in.
      tags:
        - Query
      operationId: queryMultiAutoIndexingPost
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients).
          schema:
            type: number
      requestBody:
        description: >
          The query consists of a list of query objects, on the format just like
          when [quering items in a single
          index](#tag/Query/operation/queryContentPost), so refer to this
          section when looking into `filters`, `sorting`, `pagination` etc.


          The only thing that differs with these query objects, is an addition
          of an `sourceGroupAlias`, `sourceEntityType` and a `name` fields, so
          you per query can define which index you want to perform the query
          against and also name the individual query. This means that this
          service can perform multiple queries on the same index, or perform
          queries on multiple indicies in one request, and also give you the
          ability to name queries for easier identification of the resulting
          result sets.


          ### Note

          The request payload can at most take 5 queries in one request. 
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestMultiAutoIndexing'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                type: object
                $ref: '#/components/schemas/QueryMultiAutoIndexingListResponse'
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400AutoIndexingResponseList'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: Forbidden. The API key does not have the necessary permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query403Response'
components:
  schemas:
    ViewProperties:
      type: object
      example:
        title: Enterspeed
        logo: /media-path/enterspeed.svg
    GetByIdsOrHandles:
      type: object
      description: >-
        Both `ids` and `handles` are optional, but the request must contain at
        least one id or one handle.
      example:
        ids:
          - >-
            gid://Environment/290a1654-e380-487e-8ea0-8f9f2fff589c/Source/01gh7ed9-6912-485b-9595-cd1e0c4ce89c/Entity/1234/View/content
        handles:
          - content-1234
    QueryRequestBody:
      type: object
      description: >
        All root properties like, `filters`, `sort`, `pagination` and `facets`
        are optional.


        ### Filters

        `filters` are nested in one or two levels grouped in `and` or `or`.


        ```json

        "filters": {
          "and":  [
            {
              "field": "title",
              "operator": "equals",
              "value": "Enterspeed Hoodie"
            }
          ]
        }

        ```


        ```json

        "filters": {
          "or":  [
            {
              "field": "isInStock",
              "operator": "equals",
              "value": true
            },
            {
              "field": "allowPreorder",
              "operator": "equals",
              "value": true
            }
          ]
        }

        ```


        ```json

        "filters": {
          "and":  [
            {
              "field": "title",
              "operator": "equals",
              "value": "Enterspeed Hoodie"
            },
            {
              "or": [
                {
                  "field": "isInStock",
                  "operator": "equals",
                  "value": true
                },
                {
                  "field": "allowPreorder",
                  "operator": "equals",
                  "value": true
                }
              ]
            }
          ]
        }

        ```


        #### Operators


        **equals**

        ```json 

        {
          "field": "title",
          "operator": "equals",
          "value": "Enterspeed Hoodie",
          "caseInsensitive": true
        }

        ```


        **notEquals**

        ```json 

        {
          "field": "title",
          "operator": "notEquals",
          "value": "Enterspeed Hoodie",
          "caseInsensitive": true
        }

        ```


        **contains**


        Working on text or text list fields, it's possible to use wildcard
        annotations `*` if you want to query the fields only for specific words
        or sentences, no matter what comes before and after the phrase you
        search for. It's also possible to set if the search should be case
        insentitive by setting `caseInsensitive` to `true`.

        ```json 

        {
          "field": "title",
          "operator": "contains",
          "value": "*hoodie*",
          "caseInsensitive": true
        }

        ```


        Working on list fields on the other hand, the `contains` operator
        performs an equals on the list items, which will look for an exact match
        within the list. If working on text lists, it's also possible here to
        set if the search should be case insentitive by setting
        `caseInsensitive` to `true` as above.

        ```json 

        {
          "field": "categories",
          "operator": "contains",
          "value": "Hoodies",
          "caseInsensitive": true
        }

        ```


        **greaterThan**

        ```json 

        {
          "field": "price",
          "operator": "greaterThan",
          "value": 100
        }

        ```


        **greaterThanOrEquals**

        ```json 

        {
          "field": "price",
          "operator": "greaterThanOrEquals",
          "value": 100
        }

        ```


        **lessThan**

        ```json

        {
          "field": "price",
          "operator": "lessThan",
          "value": 100
        }

        ```


        **lessThanOrEquals**

        ```json

        {
          "field": "price",
          "operator": "lessThanOrEquals",
          "value": 100
        }

        ```


        **in**

        ```json

        {
          "field": "tag",
          "operator": "in",
          "value": ["shoes", "caps", "pants"],
        }

        ```


        ### Sorting

        `sort` is an array of objects defining the sort order. Each object
        defines the property to sort on and the direction. 


        If you have multiple sorting object the sorting will be in the order of
        the object. In the example below it would mean: first sort by
        `isInStock` in descending order and then by `title` in ascending order.


        #### Default values

        `field`: _updatedAt \

        `order`: desc


        For custom sorting, default `order` is `asc`.


        ```json

        "sort": [
          {
            "field": "isInStock",
            "order": "desc"
          },
          {
            "field": "title",
            "order": "asc"
          }
        ]

        ```


        ### Pagination

        `pagination` supports two modes: offset-based and token-based.


        #### Default values

        `page`: 0 \

        `pageSize`: 10


        #### Offset-based pagination

        Use `page` and `pageSize` to paginate by offset. The total number of
        reachable items is limited to 10.000 (`from + pageSize`). The maximum
        page size is 1.000. Use this method when you need to display the current
        page number, allow users to jump to a specific page, or navigate back to
        previous pages.


        ```json

        "pagination": {
          "page": 0,
          "pageSize": 20
        }

        ```


        #### Token-based pagination

        Use `nextPageToken` to paginate beyond the 10.000-item offset limit, or
        for more efficient iteration over large result sets. The token is
        returned in every response and is `null` when no further results exist.
        Pass it back in the next request to retrieve the next page. `page` is
        ignored when `nextPageToken` is provided. Use this method for
        integrations and bulk processing where you need to iterate the full
        result set — note that it does not expose the current page number or
        support navigating back to a previous page.


        **First request** — omit the token to get the first page:

        ```json

        "pagination": {
          "pageSize": 100
        }

        ```


        **Response** — includes `nextPageToken` alongside results:

        ```json

        {
          "totalResults": 5000,
          "results": [...],
          "nextPageToken": "WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0="
        }

        ```


        **Subsequent requests** — pass the token to get the next page:

        ```json

        "pagination": {
          "pageSize": 100,
          "nextPageToken": "WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0="
        }

        ```


        Repeat until `nextPageToken` is `null`.


        **Token scoping** — a `nextPageToken` is tied to the index it was issued
        for. Using it against a different index alias returns an `Invalid
        nextPageToken` error. Always use the token with the same index it came
        from.


        **Last page behaviour** — when the total number of results is an exact
        multiple of `pageSize`, the final page returns a full set of results
        with a non-null token. One additional request is needed to confirm there
        are no more results; that request returns an empty `results` array and a
        `null` token. This is expected — treat an empty response with `null`
        token as end-of-results, not an error.


        ### Aliases

        Using `aliases` in the query will return views for the provided schema
        aliases for each item in the result. The specific views returned for
        each item is the view created by the same source entity as the item. As
        views are returned, only schema aliases of full schemas are supported,
        as it's the only schema type that's creating views.


        This allows you to return different views for the same index. E.g. a
        productTile view or a productDetails view for a product index, whitout
        having to add all presentation data for both views to the index. You
        only need the data to filter and sort on.


        ```json

        "aliases": ["productTile"]

        ```


        ### Facets

        Using `facets` in the query allows for aggregated groupings of fields
        values used for facets. 


        A facet is requested by a required `field` name to do the aggregation
        on. There are options to add an optional `name` for the facet, and an
        optional `size` field to adjust the number of aggregated values returned
        - the size defaults to 10 and has a maximum of 100. The returned
        aggregated values are sorted by highest count first, i.e., requesting
        with a size of 5 would return the 5 facets with the highest count.


        All index schema types are supported for facet aggregation except the
        following: `object`, `integerRange`, `longRange`, `floatRange`,
        `doubleRange` and `dateRange`. 


        #### Default values

        `name`: The value of `field` \

        `size`: 10 


        ```json

        "facets": [
          {
            "name": "Categories",
            "field": "category",
            "size": 20
          },
          {
            "field": "isInStock"
          }
        ]

        ```
      example:
        filters:
          and:
            - field: title
              operator: contains
              value: '*hoodie*'
              caseInsensitive: true
            - or:
                - field: isInStock
                  operator: equals
                  value: true
                - field: allowPreorder
                  operator: equals
                  value: true
        aliases:
          - productTile
        facets:
          - name: Categories
            field: category
            size: 20
          - name: In Stock
            field: isInStock
        sort:
          - field: price
            order: asc
        pagination:
          page: 0
          pageSize: 20
    QueryRequestAutoIndexing:
      type: object
      example:
        filters:
          and:
            - field: locationId
              operator: equals
              value: warehouse-01
              caseInsensitive: true
        facets:
          - name: Location
            field: locationId
            size: 20
        sort:
          - field: stockAmount
            order: desc
        pagination:
          page: 0
          pageSize: 20
    QueryRequestMultiAutoIndexing:
      type: array
      description: >-
        List consisting of multiple queries using the extended query object
        format.
      example:
        - sourceGroupAlias: erp
          sourceEntityType: price
          name: priceData
          filters:
            and:
              - field: sku
                operator: equals
                value: p-1234
                caseInsensitive: true
          facets:
            - name: Is promotional
              field: isPromotional
              size: 20
          sort:
            - field: salesPrice
              order: desc
          pagination:
            page: 0
            pageSize: 20
        - sourceGroupAlias: erp
          sourceEntityType: inventory
          name: inventoryData
          filters:
            and:
              - field: locationId
                operator: equals
                value: warehouse-01
                caseInsensitive: true
          facets:
            - name: Location
              field: locationId
              size: 20
          sort:
            - field: stockAmount
              order: desc
          pagination:
            page: 0
            pageSize: 20
    QueryRequestList:
      type: array
      description: >-
        List consisting of multiple queries using the extended query object
        format.
      items:
        $ref: '#/components/schemas/QueryRequestExtendedBody'
      example:
        - index: products
          name: productData
          filters:
            and:
              - field: title
                operator: contains
                value: '*hoodie*'
                caseInsensitive: true
              - or:
                  - field: isInStock
                    operator: equals
                    value: true
                  - field: allowPreorder
                    operator: equals
                    value: true
          aliases:
            - productTile
          facets:
            - name: Categories
              field: category
              size: 20
            - name: In Stock
              field: isInStock
          sort:
            - field: price
              order: asc
          pagination:
            page: 0
            pageSize: 20
        - index: products
          name: facets
          facets:
            - name: Categories
              field: category
              size: 20
            - name: In Stock
              field: isInStock
          pagination:
            pageSize: 0
    QueryRequestExtendedBody:
      type: object
      example:
        index: products
        name: productData
        filters:
          and:
            - field: title
              operator: contains
              value: '*hoodie*'
              caseInsensitive: true
            - or:
                - field: isInStock
                  operator: equals
                  value: true
                - field: allowPreorder
                  operator: equals
                  value: true
        aliases:
          - productTile
        facets:
          - name: Categories
            field: category
            size: 20
          - name: In Stock
            field: isInStock
        sort:
          - field: price
            order: asc
        pagination:
          page: 0
          pageSize: 20
    Raw:
      type: object
      description: Headers required
      example:
        name: Official Enterspeed T-shirt
        price: 199.99
        inStock: true
        features:
          - name: color
            value: blue
          - name: size
            value: M
        information:
          short: Nice t-shirt
          long: Nice t-shirt in cotton.
      additionalProperties:
        description: |
          Property names:
            - cannot start with a digit
            - cannot consist only of underscores
            - can contain A-Z, a-z letters, digits and underscores
        anyOf:
          - type: string
          - type: number
          - type: boolean
          - type: array
          - type: object
    Simplified:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          description: >
            The type or alias of the type of entity being send to process. Eg.
            blogList, blogPage, frontPage, etc. Only used for raw body
        url:
          type: string
          description: |
            If the entity is routable send the URL. Otherwise leave as
            null.  

            Allowed as null if entity is not routable.

            Note: The URL needs to begin with a leading slash.
        originParentId:
          type: string
          example: '123'
          description: Allowed as null if no hierarchy exists.
        redirects:
          type: array
          description: >
            URLs that redirects to the current page. Eg.
            https://enterspeed.com/product-enterspeed-tshirt-old/ redirecting to
            https://enterspeed.com/product-enterspeed-tshirt/.
          items:
            type: string
            example: https://enterspeed.com/product-enterspeed-tshirt-old/
        properties:
          description: |
            Property names:
              - cannot start with a digit
              - cannot consist only of underscores
              - can contain A-Z, a-z letters, digits and underscores
          example:
            name: Official Enterspeed T-shirt
            price: 199.99
            inStock: true
            features:
              - name: color
                value: blue
              - name: size
                value: M
            information:
              short: Nice t-shirt
              long: Nice t-shirt in cotton
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
              - type: array
              - type: object
    BulkSimplified:
      type: array
      items:
        type: object
        required:
          - originId
          - type
        properties:
          originId:
            type: string
            description: >
              Id of the entity. Must be same format for all entities within the
              same source. Eg. integers, guids, etc.
          type:
            type: string
            description: >
              The type or alias of the type of entity being send to process. Eg.
              blogList, blogPage, frontPage, etc. Only used for raw body
          url:
            type: string
            description: |
              If the entity is routable send the URL. Otherwise leave as
              null.  

              Allowed as null if entity is not routable.

              Note: The URL needs to begin with a leading slash.
          originParentId:
            type: string
            example: '123'
            description: Allowed as null if no hierarchy exists.
          redirects:
            type: array
            description: >
              URLs that redirects to the current page. Eg.
              https://enterspeed.com/product-enterspeed-tshirt-old/ redirecting
              to https://enterspeed.com/product-enterspeed-tshirt/.
            items:
              type: string
              example: https://enterspeed.com/product-enterspeed-tshirt-old/
          properties:
            description: |
              Property names:
                - cannot start with a digit
                - cannot consist only of underscores
                - can contain A-Z, a-z letters, digits and underscores
      example:
        - type: product
          originId: p-5427
          properties:
            name: Official Enterspeed T-shirt
            price: 199.99
            inStock: true
            features:
              - name: color
                value: blue
              - name: size
                value: M
            information:
              short: Nice t-shirt
              long: Nice t-shirt in cotton
        - type: product
          originId: p-6724
          properties:
            name: Official Enterspeed Hoddie
            price: 249.95
            inStock: true
            features:
              - name: color
                value: blue
              - name: size
                value: M
            information:
              short: Nice hoddie
              long: Nice hoddie in cotton
    BulkDelete:
      type: object
      description: object with an array of strings with originIds to delete
      example:
        originIds:
          - p-5427
          - p-6724
    RouteResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              example: 200
              description: Returns code 200
        route:
          type: object
          $ref: '#/components/schemas/ViewProperties'
        views:
          type: object
          example:
            gid://Environment/f0edd7b7-23dd-4177-a98a-313127601e97/Source/32ebdcab-ae19-4a71-a09e-a93257b807b7/Entity/4573/BlogPostTile:
              title: How to increase performance
              image: /media-path/performance.jpg
              url: /blog/how-to-increase-performance/
            Navigation:
              items:
                - text: Contact us
                  link: /contact-us/
    ViewResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              example: 200
              description: Returns code 200
        views:
          type: object
          example:
            gid://Environment/290a1654-e380-487e-8ea0-8f9f2fff589c/Source/01gh7ed9-6912-485b-9595-cd1e0c4ce89c/Entity/1234/View/content:
              title: How to increase performance
              image: /media-path/performance.jpg
              url: /blog/how-to-increase-performance/
            content-1234:
              title: How to increase performance
              image: /media-path/performance.jpg
              url: /blog/how-to-increase-performance/
    QueryResponse:
      type: object
      properties:
        status:
          type: number
          example: 0
        totalResults:
          type: number
          example: 200
          description: The total number of results matched by query.
        results:
          type: array
          description: |
            List of items from the index matched by the query provided.

            Built in fields are prefixed with underscore (`_`).
          items:
            type: object
            example:
              sku: p-5427
              name: Running shoe
              url: /products/running-shoe/
              _originId: p-5427
              _sourceGuid: 9f741916-19e3-4791-9ebd-701634ba9b75
              _updatedAt: '2025-01-07T08:43:15.7351089Z'
              _views:
                productTile:
                  sku: p-5427
                  name: Running shoe
                  url: /products/running-shoe/
                  image: /media/running-shoe.webp
                  shortDescription: My short description of the product
                  price: 199.99
        facets:
          type: array
          description: List of aggregated field values based on the requested facet fields.
          items:
            type: object
            example:
              name: Categories
              field: category
              groups:
                - value: Caps
                  count: 8
                - value: Hoodies
                  count: 2
              isValid: true
        nextPageToken:
          type: string
          nullable: true
          description: >-
            Continuation token for the next page of results. Pass this value in
            the `pagination.nextPageToken` field of the next request. `null`
            when no further results exist.
          example: WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0=
    QueryAutoIndexingResponse:
      type: object
      properties:
        status:
          type: number
          example: 0
        totalResults:
          type: number
          example: 200
          description: The total number of results matched by query.
        results:
          type: array
          description: |
            List of items from the index matched by the query provided.

            Built in fields are prefixed with underscore (`_`).
          items:
            type: object
            example:
              sku: p-5427
              stockAmount: 20
              locationId: warehouse-01
              _originId: p-5427
              _sourceGuid: 9f741916-19e3-4791-9ebd-701634ba9b75
              _updatedAt: '2025-01-07T08:43:15.7351089Z'
        facets:
          type: array
          description: List of aggregated field values based on the requested facet fields.
          items:
            type: object
            example:
              name: Location
              field: locationId
              groups:
                - value: warehouse-01
                  count: 95
                - value: warehouse-02
                  count: 78
              isValid: true
        nextPageToken:
          type: string
          nullable: true
          description: >-
            Continuation token for the next page of results. Pass this value in
            the `pagination.nextPageToken` field of the next request. `null`
            when no further results exist.
          example: WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0=
    QueryMultiAutoIndexingResponse:
      type: object
      properties:
        status:
          type: number
          example: 0
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        totalResults:
          type: number
          example: 200
          description: The total number of results matched by query.
        results:
          type: array
          description: |
            List of items from the index matched by the query provided.

            Built in fields are prefixed with underscore (`_`).
          items:
            type: object
            example:
              sku: p-1234
              salesPrice: 20.5
              isPromotional: true
              _originId: p-1234
              _sourceGuid: 9f741916-19e3-4791-9ebd-701634ba9b75
              _updatedAt: '2025-01-07T08:43:15.7351089Z'
        facets:
          type: array
          description: List of aggregated field values based on the requested facet fields.
          items:
            type: object
            example:
              name: Is promotional
              field: isPromotional
              groups:
                - value: true
                  count: 85
                - value: false
                  count: 115
              isValid: true
        nextPageToken:
          type: string
          nullable: true
          description: >-
            Continuation token for the next page of results. Pass this value in
            the `pagination.nextPageToken` field of the next request. `null`
            when no further results exist.
          example: WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0=
    QueryResponseExtended:
      type: object
      properties:
        status:
          type: number
          example: 0
        index:
          type: string
          example: products
          description: The index name which were given for the query in the request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        totalResults:
          type: number
          example: 200
          description: The total number of results matched by query.
        results:
          type: array
          description: |
            List of items from the index matched by the query provided.

            Built in fields are prefixed with underscore (`_`).
          items:
            type: object
            example:
              sku: p-5427
              name: Running shoe
              url: /products/running-shoe/
              _originId: p-5427
              _sourceGuid: 9f741916-19e3-4791-9ebd-701634ba9b75
              _updatedAt: '2025-01-07T08:43:15.7351089Z'
              _views:
                productTile:
                  sku: p-5427
                  name: Running shoe
                  url: /products/running-shoe/
                  image: /media/running-shoe.webp
                  shortDescription: My short description of the product
                  price: 199.99
        facets:
          type: array
          description: List of aggregated field values based on the requested facet fields.
          items:
            type: object
            example:
              name: Categories
              field: category
              groups:
                - value: Caps
                  count: 8
                - value: Hoodies
                  count: 2
              isValid: true
        nextPageToken:
          type: string
          nullable: true
          description: >-
            Continuation token for the next page of results. Pass this value in
            the `pagination.nextPageToken` field of the next request. `null`
            when no further results exist.
          example: WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0=
    QueryResponseExtendedList:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/QueryResponseExtended'
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtended'
          - $ref: '#/components/schemas/Query403ResponseExtended'
    QueryMultiAutoIndexingListResponse:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/QueryMultiAutoIndexingResponse'
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtendedMultiAutoIndexing'
          - $ref: '#/components/schemas/Query403ResponseExtendedMultiAutoIndexing'
    Query400Response:
      type: object
      properties:
        message:
          type: string
          description: Erros message
          example: Query is not valid
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: 'Operator not implemented: equal'
        status:
          type: number
          example: 0
    Query403Response:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
    Query400ResponseExtended:
      type: object
      properties:
        index:
          type: string
          example: products
          description: The index name which were given for the query in the request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Query is not valid
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: 'Operator not implemented: equal'
        status:
          type: number
          example: 0
    Query403ResponseExtended:
      type: object
      properties:
        index:
          type: string
          example: products
          description: The index name which were given for the query in the request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Forbidden
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: Forbidden
        status:
          type: number
          example: 1
    Query400ResponseExtendedMultiAutoIndexing:
      type: object
      properties:
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Query is not valid
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: 'Operator not implemented: equal'
        status:
          type: number
          example: 0
    Query403ResponseExtendedMultiAutoIndexing:
      type: object
      properties:
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Forbidden
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: Forbidden
        status:
          type: number
          example: 1
    Query400ExtendedResponseList:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtended'
    Query400AutoIndexingResponseList:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtendedMultiAutoIndexing'
    NoIdsOrHandlesParametersResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              description: HttpStatus code 422
              example: 422
        message:
          type: string
          description: Missing id, handle or url query parameter
    NoParametersResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              description: HttpStatus code 422
              example: 422
        message:
          type: string
          description: Missing id, handle or url query parameter.
    TooManyUrlsResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              description: HttpStatus code 422
              example: 422
        message:
          type: string
          description: Request contains xxx url parameters. Maximum is 1.
    NoRouteFoundResponse:
      type: object
      properties:
        meta:
          type: object
          properties:
            status:
              type: number
              example: 404
              description: Returns code 404
        route:
          type: object
          example: null
          description: no route returned
        views:
          type: object
          example:
            gid://Environment/f0edd7b7-23dd-4177-a98a-313127601e97/Source/32ebdcab-ae19-4a71-a09e-a93257b807b7/Entity/4573/Navigation:
              items:
                - title: How to increase performance
                  url: /how-to-increase-performance/
    PageInfoResponse:
      type: object
      properties:
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          type: string
          description: |
            Cursor for the first element in the list.
        endCursor:
          type: string
          description: |
            Cursor for the last element in the list.
    PagedResult:
      type: object
      properties:
        total:
          type: number
        pageInfo:
          $ref: '#/components/schemas/PageInfoResponse'
        results:
          type: array
          items:
            $ref: '#/components/schemas/UrlRouteItem'
    PagedTokenResult:
      type: object
      properties:
        continuationToken:
          type: string
        results:
          type: array
          items:
            $ref: '#/components/schemas/UrlRouteItem'
    UrlRouteItem:
      type: object
      properties:
        url:
          type: string
        redirect:
          type: string
        updatedAt:
          type: string
    RoutesResponse:
      $ref: '#/components/schemas/PagedResult'
    RoutesV2Response:
      $ref: '#/components/schemas/PagedTokenResult'
    IngestMetadata:
      type: object
      description: Metadata about the ingest operation
      properties:
        ingestVersion:
          type: string
          description: The version of the ingest process
          example: '1.0'
        ingestFormat:
          type: string
          description: The format of the ingested data (Raw or Simplified)
          example: Raw
        systemInfo:
          type: string
          nullable: true
          description: Additional system information about the ingest operation
          example: null
        forceTypeOverwrite:
          type: boolean
          description: >-
            Indicates whether the X-Enterspeed-Force-Type header was present to
            bypass type immutability checks
          example: false
    BulkIngestResult:
      type: object
      description: >
        Response for bulk ingest operations, containing lists of changed,
        unchanged, and errored entities.


        **Note:** This schema applies to bulk operations only. For single entity
        ingest responses, see the `/ingest/v2/{originId}` endpoint
        documentation.
      properties:
        status:
          type: number
          description: >-
            HTTP status code (200 for partial/full success, 422 for all entities
            failed)
          example: 200
        changedSourceEntities:
          type: array
          items:
            type: string
          description: List of originIds for entities that were changed
          example:
            - p-5427
        unchangedSourceEntities:
          type: array
          items:
            type: string
          description: List of originIds for entities that were unchanged
          example:
            - p-6724
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Dictionary of originId to list of error messages
          example:
            '1234':
              - Validation failed
        ingestMetadata:
          $ref: '#/components/schemas/IngestMetadata'
