## Authenticate

To run a query, first set your access token in the **Authorization** header field at the top of the playground:

```
Authorization: Bearer <your-token>
```

There are two ways to get a token:

- **API key**: exchange it for a token through your auth provider’s client-credentials grant. See [Manage API keys](https://docs.firstresonance.io/api-reference/authentication/api-keys).
- **OAuth 2.0**: complete the authorization code flow and use the resulting access token. See [Authenticate with OAuth 2.0](https://docs.firstresonance.io/api-reference/authentication/oauth).

The playground stores tokens locally in your browser and sends them only to the ION API.

## Quick start

Run this query first to confirm your token works:

```
query Me {
  me {
    id
    name
    email
    organization {
      id
      domain
    }
  }
}
```

A successful response means your token is valid for the tenant in `organization.domain`. If you get an `errors[]` payload instead, see [Error codes](https://docs.firstresonance.io/api-reference/error-codes).

## What you can do here

The playground runs mutations against the live API. Use a [sandbox tenant](https://docs.firstresonance.io/api-reference/sandbox) when prototyping mutations so you don’t change production data.

- **Schema explorer**: click any type to see its fields, arguments, and return types. Hover over a field to see its description.
- **Autocomplete**: start typing a field and the playground suggests valid completions for the current selection set.
- **Variables panel**: pass query variables as JSON instead of hardcoding them in the query body.
- **Headers panel**: set **Authorization** and other custom headers.
- **History**: the playground saves every query you run locally. Re-run or share a saved query with teammates.
- **Schema docs sidebar**: type `__schema` or `__type` to run an introspection query and inspect the schema.

## Example Queries and Mutations

See [Example requests](https://docs.firstresonance.io/api-reference/examples).

## GraphQL Schema reference

The full GraphQL schema is also checked into this repository as [`schema.graphql`](https://docs.firstresonance.io/schema.graphql). There are three ways to explore the schema:

1. **In the playground**: click around the schema explorer.
2. **In the file**: open `schema.graphql` in your editor.
3. **By introspection**: run `query { __schema { types { name kind } } }` from the playground.

To find which query or mutation powers a page, open your browser’s developer tools, go to the **Network** tab, and click around in ION. The app shows the exact queries, mutations, and filters it sends.
