> For the complete documentation index, see [llms.txt](https://calctree.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://calctree.gitbook.io/docs/integrations/graphql-api.md).

# GraphQL API

Learn about building apps and integrations on top of CalcTree's API

## Endpoint&#x20;

CalcTree's GraphQL endpoint is:

```bash
https://graph.calctree.com/graphql
```

## Authentication <a href="#authentication" id="authentication"></a>

Right now we support personal API keys for authentication. Check out this [page](/docs/integrations/graphql-api/generating-an-api-key.md) to see how to create one.

Headers for your API calls should look like this:

```json
headers: {
          "Content-Type": "application/json",
          "x-api-key": apiKey,
        }
```

## Page & Workspace IDs

You'll need your page and workspace IDs to connect to pages in your workspace from an external tool. Both can be found in the URL of a page, which take the form:

```bash
https://app.calctree.com/edit/workspaceID/pageID
```

### Page ID

As well as in the page URL, you can find your pageID on the RHS integrations pane of your page.

<figure><img src="https://94933883-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1yC9mBIPsA0bB8PMGaq%2Fuploads%2FO7MrUR83uqNUFdCYnCdA%2Fworkspaces_b3647c8a-2395-4cd0-9f77-27ae5fb2366d_pages_6fd16232-39e3-44a9-aee2-d6ad375698b0_images_3f38bf85-9b99-4ee0-beef-cfa3778dcdf0.jpeg?alt=media&amp;token=06d0e5d0-75fd-4827-a217-399985bba53c" alt="" width="563"><figcaption></figcaption></figure>

### Workspace ID

Your workspaceID can be found in the URL of the page you're in, in a given workspace. \
\
For example, for this URL:

```bash
https://app.calctree.com/edit/ae3d7998-a4c7-41c1-abfd-fb3f07a80f21/ilxbKtbDgAHQWimUKM3bh
```

The workspaceID would be `ae3d7998-a4c7-41c1-abfd-fb3f07a80f21`*.*

## Queries and Mutations

The API allows for two different types of calls, [queries](/docs/integrations/graphql-api/queries.md) and [mutations](broken://pages/2YPmw8K6VUHYIN6MVvNI).

### Queries

The API supports query calls that let you inspect elements in CalcTree, mainly data and calculations (pages). See this page for details and examples of available queries.
