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

# API

> API reference for Contentful GraphQL: every `contentfulgraphql.api.*` operation with input and output types.

Every `contentfulgraphql.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## Get Cma Token

### getCmaToken

`getCmaToken`

Get the stored Contentful access token, space ID, and environment ID

**Risk:** `read`

```ts theme={null}
await corsair.contentfulgraphql.api.getCmaToken({});
```

**Input:** *empty object*

**Output**

| Name             | Type     | Required | Description |
| ---------------- | -------- | -------- | ----------- |
| `space_id`       | `string` | Yes      | —           |
| `environment_id` | `string` | No       | —           |

***

## Graph Ql Content Api Persisted Query

### graphQlContentApiPersistedQuery

`graphQlContentApiPersistedQuery`

Run an automatic persisted query (APQ) against the Contentful GraphQL Content API using a SHA-256 hash

**Risk:** `read`

```ts theme={null}
await corsair.contentfulgraphql.api.graphQlContentApiPersistedQuery({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `query`         | `string` | No       | —           |
| `sha256Hash`    | `string` | No       | —           |
| `variables`     | `object` | No       | —           |
| `operationName` | `string` | No       | —           |

<AccordionGroup>
  <Accordion title="variables full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `data` | `object` | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Graph Ql Content Api Query

### graphQlContentApiQuery

`graphQlContentApiQuery`

Run a GraphQL query against the Contentful GraphQL Content API for the configured space and environment

**Risk:** `read`

```ts theme={null}
await corsair.contentfulgraphql.api.graphQlContentApiQuery({});
```

**Input**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `query`         | `string` | Yes      | —           |
| `variables`     | `object` | No       | —           |
| `operationName` | `string` | No       | —           |

<AccordionGroup>
  <Accordion title="variables full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

**Output**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `data` | `object` | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
    }
    ```
  </Accordion>
</AccordionGroup>

***
