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

# apiVersionsById

> Gets several API versions by global id. Fails when any id doesn't exist.



**query** `apiVersionsById(id: [ID!]!): [ApiVersion!]!`

## Arguments

**`id`**: `[ID!]!` (required)

Global ids of the versions (`ApiVersion.id`).

## Returns

`[ApiVersion!]!`

**`allowedOrigins`**: `[Origin]`

Web origins allowed to call the version's API from a browser (CORS). `*` allows any origin.

---

**`applications`**: `ApplicationsConnection`

Applications that can call the version's API, including tenant applications with access to it.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.
- `order`: `[ApplicationSortInput!]`
- `where`: `ApplicationFilterInput`

---

**`authentication`**: `AuthenticationOption!`

What callers of the version's API must send. See `AuthenticationOption`.

---

**`cardDefinitions`**: `CardDefinitionsConnection`

Card definitions the version's endpoints publish.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.

---

**`clusters`**: `ClustersConnection`

Clusters the version runs in, one per region.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.
- `where`: `ApiVersionClusterFilterInput`

---

**`createdAt`**: `DateTime!`

When the version was created (UTC).

---

**`createdBy`**: `UUID`

Id of the user or application that created the item. Null if not recorded.

---

**`defaultClusterId`**: `ID!`

Global id of the cluster the version runs in by default (`Cluster.id`).

---

**`defaultLanguage`**: `String!`

Output language the API uses when a request names none. One of the `value`s in `languages`.

---

**`destination`**: `Destination`

Destination the version belongs to.

---

**`destinationId`**: `ID!`

Global id of the destination the version belongs to (`Destination.id`).

---

**`elasticClusters`**: `ElasticClustersConnection`

Indexing clusters that hold the version's data.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.
- `where`: `ApiVersionElasticClusterFilterInput`

---

**`endpoints`**: `EndpointsConnection`

Endpoints of the version: the routes its API serves.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `hasPendingChanges`: `Boolean` — True lists only endpoints with changes not yet applied, false only those without. Null lists all.
- `last`: `Int` — Returns the last _n_ elements from the list.
- `order`: `[EndpointSortInput!]`
- `where`: `EndpointFilterInput`

---

**`etag`**: `Etag`

Version tag for optimistic concurrency. Pass back the value you last read when you change the item.

---

**`id`**: `ID!`

Global id of the version. `apiVersionById` and the version mutations take it.

---

**`indexerVersion`**: `IndexerVersion`

Indexer version the version uses. See `IndexerVersion`.

---

**`indexingMetrics`**: `ApiVersionIndexingMetrics`

Indexing progress of the version's data per region. Set the window with `where: { period: { eq: <hours> } }`; default 1 hour.

**Arguments:**

- `where`: `ApiVersionIndexingMetricsFilterInput`

---

**`isDeleted`**: `Boolean!`

True if the item is archived. Archived items are still returned unless you filter on `isDeleted`.

---

**`languages`**: `[KeyValuePairOfStringAndString!]!`

Languages the version's API serves. Each item is `{key, value}`: `key` is the source language code, `value` is the language code the API outputs (e.g. `en`).

---

**`lastModified`**: `DateTime!`

When the version last changed (UTC).

---

**`lastUpdatedBy`**: `UUID`

Id of the user or application that last changed the item. Null if not recorded.

---

**`publishingStatus`**: `WorkflowStatus!`

Step-by-step progress of the version's last full or partial publish. Its status is `UNKNOWN` when the version was never published, was only published as a preview, or its last publish is no longer kept; read `state` instead.

---

**`queuedChanges`**: `QueuedChangesConnection`

Segment changes to the version's endpoints that are queued and not yet applied.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.
- `order`: `[QueuedEndpointSegmentChangeSortInput!]`
- `where`: `QueuedEndpointSegmentChangeFilterInput`

---

**`revision`**: `Int!`

Change counter of what the version publishes. Starts at 1 and goes up when its languages change or `applyPendingVersionChanges` applies endpoint changes.

---

**`segments`**: `SegmentsConnection`

Segments used by the version's endpoints.

**Arguments:**

- `after`: `String` — Returns the elements in the list that come after the specified cursor.
- `before`: `String` — Returns the elements in the list that come before the specified cursor.
- `first`: `Int` — Returns the first _n_ elements from the list.
- `last`: `Int` — Returns the last _n_ elements from the list.

---

**`state`**: `ApiVersionState!`

Publishing state of the version. See `ApiVersionState`.

---

**`tenantId`**: `UUID!`

Id of the tenant that owns the item.

---

**`version`**: `Int!`

Version number within the destination, from 1 up. The version's API URL uses it as `v<version>`.

## Examples

```graphql Query
query ApiVersionsById($id: [ID!]!) {
  apiVersionsById(id: $id) {
    allowedOrigins
    applications {
      edges {
        cursor
        node {
          __typename
        }
      }
      nodes {
        accessToken {
          __typename
        }
        apiVersionId
        clientId
        clientSecret
        createdAt
        createdBy
      }
      pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
      }
      totalCount
    }
    authentication
    cardDefinitions {
      edges {
        cursor
        node {
          __typename
        }
      }
      nodes {
        activationStatus {
          __typename
        }
        activePropertySet {
          __typename
        }
        allowsEnrichment
        cardsCount
        createdAt
        createdByUser
      }
      pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
      }
      totalCount
    }
    clusters {
      edges {
        cursor
        node {
          __typename
        }
      }
      nodes {
        createdBy
        customerDisplayName
        customerSafeName
        etag
        id
        indexClusterUrl
      }
      pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
      }
    }
    createdAt
  }
}
```

```json Variables
{
  "id": [
    "id"
  ]
}
```

```json Response
{
  "data": {
    "apiVersionsById": [
      {
        "allowedOrigins": [
          "value"
        ],
        "applications": {
          "edges": [
            {
              "cursor": "string",
              "node": {
                "__typename": "Application"
              }
            }
          ],
          "nodes": [
            {
              "accessToken": {
                "__typename": "ApplicationAccessToken"
              },
              "apiVersionId": "value",
              "clientId": "string",
              "clientSecret": "string",
              "createdAt": "value",
              "createdBy": "value"
            }
          ],
          "pageInfo": {
            "endCursor": "string",
            "hasNextPage": true,
            "hasPreviousPage": true,
            "startCursor": "string"
          },
          "totalCount": 1
        },
        "authentication": "PROTECTED",
        "cardDefinitions": {
          "edges": [
            {
              "cursor": "string",
              "node": {
                "__typename": "CardDefinition"
              }
            }
          ],
          "nodes": [
            {
              "activationStatus": {
                "__typename": "WorkflowStatus"
              },
              "activePropertySet": {
                "__typename": "PropertySet"
              },
              "allowsEnrichment": true,
              "cardsCount": "value",
              "createdAt": "value",
              "createdByUser": "value"
            }
          ],
          "pageInfo": {
            "endCursor": "string",
            "hasNextPage": true,
            "hasPreviousPage": true,
            "startCursor": "string"
          },
          "totalCount": 1
        },
        "clusters": {
          "edges": [
            {
              "cursor": "string",
              "node": {
                "__typename": "Cluster"
              }
            }
          ],
          "nodes": [
            {
              "createdBy": "value",
              "customerDisplayName": "string",
              "customerSafeName": "string",
              "etag": "value",
              "id": "id",
              "indexClusterUrl": "string"
            }
          ],
          "pageInfo": {
            "endCursor": "string",
            "hasNextPage": true,
            "hasPreviousPage": true,
            "startCursor": "string"
          }
        },
        "createdAt": "value"
      }
    ]
  }
}
```


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