# GraphQL API

## Authentication

You must set the HTTP `Authorization` header to `Bearer <license key>` to use the REST APIs. For example, if your EqualTo Sheets license key is:

* `12345679-1234-1234-1234-123456789abc`

Then you should set the `Authorization` header to:

* `Bearer 12345679-1234-1234-1234-123456789abc`

See [Authentication in production](/authentication-in-production.md) for more information.

## List all workbooks

```graphql
query {
	workbooks {
		id
		name
	}
}
```

## Create a blank workbook

```graphql
mutation {
	createWorkbook {
		workbook {
			id
			name
		}
	}
}
```

## List the sheets in a specific workbook

```graphql
query {
	workbook(workbookId: "<workbook id>") {
		id
		name
		sheets {
			name
		}
	}
}
```

## View the contents of `A1` in the first sheet of a workbook

```graphql
query {
   workbook(workbookId: "<workbook id>") {
   	id
   	name
   	sheet(sheetIndex: 1) {
   		cell(ref: "A1") {
   			value {
   				boolean
   				text
   				number
   			}
   			formattedValue
   		}
   	}
   }
}
```

## Set cell `A1` in the first sheet of a workbook to `"300$"`

```graphql
mutation {
	setCellInput(workbookId:"<workbook id>", sheetIndex: 1, row: 1, col: 1, input: "300$") {
		__typename
	}
}
```

## Notes

The GraphiQL client also contains some auto-generated documentation on the API:

![](https://lh5.googleusercontent.com/gK7h5Y0M5iS3PVvKBkeR6AMU-Oj3-Lr6HyM1XVbJkdK2Mp5ffuQw56XEIgbBOCNgpyUm79IrA0w3SKVGww2CKBrfBinwH6JR0GID79w3zlMb_qdBGgFNFm5khpH-3mXKil6WfPtJp4nn_KjmKodX8g)

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.equalto.com/graphql-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
