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

# endpointsById

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



**query** `endpointsById(id: [ID!]!): [Endpoint!]!`

## Arguments

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

Global ids of the endpoints (`Endpoint.id`).

## Returns

`[Endpoint!]!`

**`activeContent`**: `Any`

Content the endpoint serves now. Shape: `{analyzedQuery, content}`. `content` is what was set through `ContentSelectionInput`, with raw ids: `{id, properties: [{id, alias, facet: {header: [{key, value}], size}}], filters: [{segmentDefinitionId, include, exclude}], relations: [{id, alias, cardinality, order: {by, sort}, target: <same shape as content>}]}`. The server derives `analyzedQuery` from it. The card properties the endpoint exposes are `content.properties`, plus the `properties` of each relation's `target`. Enum values appear as `"Plural"` and `"Asc"`, not as the GraphQL values `PLURAL` and `ASC`. Example `content`: `{"id": "product", "properties": [{"id": "id", "alias": null, "facet": null}, {"id": "color", "alias": "colour", "facet": {"header": [{"key": "en", "value": "Color"}], "size": 50}}], "filters": [{"segmentDefinitionId": "season", "include": ["summer"], "exclude": null}], "relations": [{"id": "variants", "alias": "variants", "cardinality": "Plural", "order": {"by": "size", "sort": "Asc"}, "target": {"id": "variant", "properties": [{"id": "id", "alias": null, "facet": null}], "filters": [], "relations": []}}]}`.

---

**`apiVersion`**: `ApiVersion!`

API version the endpoint belongs to.

---

**`apiVersionId`**: `ID!`

Global id of the API version the endpoint belongs to (`ApiVersion.id`).

---

**`cardDefinitions`**: `CardDefinitionsConnection`

Card definitions in the endpoint's content (the root one and those reached through relations), in `activeContent` or `pendingContent`.

**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`: `EndpointCardDefinitionFilterInput`

---

**`description`**: `String!`

Free-text note about the endpoint.

---

**`displayName`**: `String!`

Label shown in Studio.

---

**`etag`**: `Etag`

Version tag for optimistic concurrency. Pass the value you last read to `updateEndpoint` or `discardPendingChanges`; a stale value fails the call.

---

**`facets`**: `[FacetConfiguration!]!`

Facet settings stored on the endpoint itself, used only when no root card property in `activeContent` has a `facet`. `createEndpoint` leaves this empty; set facets with `ContentPropertySelectionInput.facet` instead.

---

**`filterableFields`**: `[String!]!`

Names of the root card properties in `activeContent`, as the API outputs them (the alias, or the card property id), plus `_segments`. Derived by the server.

---

**`graphQlQuery`**: `String!`

Query over the tenant's cards that `activeContent` translates to. Generated by the server.

---

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

Global id of the endpoint. `endpointById`, `endpointsById` and the endpoint mutations take it.

---

**`pendingChanges`**: `[EndpointPendingChange!]!`

Differences between `pendingContent` and `activeContent`, one item per change. Empty when `pendingContent` is null.

---

**`pendingContent`**: `Any`

Content the endpoint serves once its pending changes are applied, shaped like `activeContent`. Null when there are no pending changes. `updateEndpoint` writes here while the version is published or publishing, and queued segment changes land here unless the version is `NEW`. `applyPendingVersionChanges` makes it the active content; `discardPendingChanges` drops it.

---

**`pendingContentDiff`**: `[EndpointPendingChange!]!`

> Deprecated: Use `pendingChanges` instead

---

**`queuedChanges`**: `QueuedChangesConnection`

Segment changes queued for the endpoint with `queueSegmentChangesForEndpoint` 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`

---

**`safeName`**: `String!`

Name of the endpoint in its version's API URL, in lowercase and unique within the version. Set when the endpoint is created; can't change.

---

**`searchableFields`**: `[String!]!`

The text and localized card properties among `filterableFields`. Derived by the server.

---

**`searchAliases`**: `[KeyValuePairOfStringAndString!]!`

Extra names for root card properties. Each item is `{key, value}`: `key` is the alias, `value` is the card property name it stands for. Callers of the destination API can write `@<key>` where a field name is expected. Not settable through this API.

---

**`segments`**: `SegmentsConnection`

Segments the endpoint's content filters on, in `activeContent` or `pendingContent`, on the root card or on related cards.

**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`: `EndpointSegmentFilterInput`

---

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

Id of the tenant that owns the endpoint.

## Examples

```graphql Query
query EndpointsById($id: [ID!]!) {
  endpointsById(id: $id) {
    activeContent
    apiVersion {
      allowedOrigins
      applications {
        edges {
          __typename
        }
        nodes {
          __typename
        }
        pageInfo {
          __typename
        }
        totalCount
      }
      authentication
      cardDefinitions {
        edges {
          __typename
        }
        nodes {
          __typename
        }
        pageInfo {
          __typename
        }
        totalCount
      }
      clusters {
        edges {
          __typename
        }
        nodes {
          __typename
        }
        pageInfo {
          __typename
        }
      }
      createdAt
    }
    apiVersionId
    cardDefinitions {
      edges {
        cursor
        node {
          __typename
        }
      }
      nodes {
        activationStatus {
          __typename
        }
        activePropertySet {
          __typename
        }
        allowsEnrichment
        cardsCount
        createdAt
        createdByUser
      }
      pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
      }
      totalCount
    }
    description
    displayName
  }
}
```

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

```json Response
{
  "data": {
    "endpointsById": [
      {
        "activeContent": "value",
        "apiVersion": {
          "allowedOrigins": [
            "value"
          ],
          "applications": {
            "edges": [
              {
                "__typename": "ApplicationsEdge"
              }
            ],
            "nodes": [
              {
                "__typename": "Application"
              }
            ],
            "pageInfo": {
              "__typename": "PageInfo"
            },
            "totalCount": 1
          },
          "authentication": "PROTECTED",
          "cardDefinitions": {
            "edges": [
              {
                "__typename": "CardDefinitionsEdge"
              }
            ],
            "nodes": [
              {
                "__typename": "CardDefinition"
              }
            ],
            "pageInfo": {
              "__typename": "PageInfo"
            },
            "totalCount": 1
          },
          "clusters": {
            "edges": [
              {
                "__typename": "ClustersEdge"
              }
            ],
            "nodes": [
              {
                "__typename": "Cluster"
              }
            ],
            "pageInfo": {
              "__typename": "PageInfo"
            }
          },
          "createdAt": "value"
        },
        "apiVersionId": "id",
        "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
        },
        "description": "string",
        "displayName": "string"
      }
    ]
  }
}
```


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