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

# GraphQL API

> Read and change sources, entries, cards, segments, destinations, media and more through one GraphQL endpoint.

The GraphQL API gives you one endpoint for almost everything you can do in Studio. You pick the fields you need, and one request can combine data from several parts of Occtoo, such as a source and its entries.

```text theme={null}
https://api.occtoo.com/graphql
```

Behind the endpoint, a gateway combines four services into one schema: configuration, data layer, destinations, and media. You do not need to know which service owns a field. The schema has about 77 queries and 143 mutations.

## Authentication

Send an [Application access token](https://docs.occtoo.com/api-reference/authentication/application-token.md) as a bearer token:

```http theme={null}
Authorization: Bearer <access-token>
```

Request the token with your tenant ID as the audience. The tenant comes from the token; you cannot choose it in the request.

Each field needs a scope, such as `read:sources` to read sources or `write:cards` to change managed tags. The scope names are the same as in the REST APIs. A field called without its scope returns an error in the response's `errors` list.

> [!NOTE]
>
> You can load the schema without a token. Every request for data needs one. Without a token, data fields fail with the error code `AUTH_NOT_AUTHENTICATED`.

## Explore the schema

* Browse every query, mutation and type in the reference under **Queries**, **Mutations** and **Types** in this section.
* Open [https://api.occtoo.com/graphql](https://api.occtoo.com/graphql) in a browser to use **Nitro**, an interactive GraphQL editor. Add your `Authorization` header in Nitro to run queries.
* Download the schema as SDL from `https://api.occtoo.com/graphql/schema.graphql`.
* Use introspection from any GraphQL client or code generator.

Every type, field and argument has a description. Read them in Nitro or in the SDL; they explain ids, defaults and limits for each field.

## Areas

Every query and mutation belongs to one area. The area is a `@tag` on the field, so you can find all fields of an area in the SDL or let a tool group them for you. Only `node` and `nodes` have no area.

```graphql theme={null}
dataSources(...): DataSourcesConnection @tag(name: "sources")
```

| Area | What it covers |
| - | - |
| `sources` | Sources, source properties, folders, data providers, imports, writing source entries and queued tasks |
| `entries` | Reading source, card and destination entries, changelogs and property terms |
| `cards` | Card definitions, relation definitions, lifecycles, and card import and export tasks |
| `segments` | Segments and segment definitions |
| `managed-tags` | Managed tag lists and their values |
| `destinations` | Destinations, API versions, endpoints, publishing and destination applications |
| `media` | Image conversion presets, conversions and file downloads |
| `events-and-metrics` | Event destinations, webhooks and metrics |
| `access` | Tenant applications, API keys, users and languages |
| `studio` | Studio settings, favorites, widgets and notifications |

## Next steps

> [card] [Getting started](https://docs.occtoo.com/api-reference/graphql/getting-started.md)
>
> Send your first query and mutation.

> [card] [Conventions](https://docs.occtoo.com/api-reference/graphql/conventions.md)
>
> Ids, paging, filtering, sorting and errors.


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