Supported GraphQL Operations
GraphQL API keys created in the Developer Portal and OAuth 2.0 access tokens can access the same supported subset of the GraphQL schema. The one exception is generateComponentToken, which is API-key only.
Not every query, mutation, or field is available with an API key or an OAuth token. Only the operations listed below are supported, and only the fields shown in their reference pages can be selected. If you need an operation that isn't listed here, contact support and we can add it.
Header
Send either credential as a bearer token.
An API key from the Developer Portal:
Authorization: Bearer ak_<environment>_<key-id>.<secret>
An OAuth 2.0 access token (see OAuth 2.0 Client Integration):
Authorization: Bearer <access-token>
Queries
| Query | Description |
|---|---|
attachment | Returns an attachment |
template | Returns a template |
document | Returns a document |
batch | Returns a batch |
group | Returns a group |
user | Returns a user, or the API-key user context when no ID is supplied |
task | Returns task status and report data |
recipient | Returns a document recipient |
Mutations
| Mutation | Description |
|---|---|
cancelDocument | Cancels a document if it has not been signed |
createTemplate | Creates a template and returns upload details |
createTemplateElement | Creates a new element (field) in a template |
createTemplateRole | Creates a new role in a template |
deleteTemplateElement | Deletes an element (field) from a template |
deleteTemplateRole | Deletes a role from a template |
generateComponentToken | Mints a short-lived token for authenticated widgets. API key only |
send | Sends one document |
sendBatch | Starts a batch send |
sendBatchDocument | Adds a document to a batch |
startBatch | Starts a prepared batch |
swapRoles | Swaps the position of two roles in a template |
updateTemplate | Updates a template's properties |
updateTemplateElement | Updates an element (field) in a template |
updateTemplateRole | Updates a role in a template |
Query Example
The examples use an API key. With OAuth, send your access token in the same Authorization header.
curl https://graphql.uk.legalesign.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ak_<environment>_<key-id>.<secret>" \
--data '{
"query": "query GetDocument($id: ID!) { document(id: $id) { id name status created recipients { id email status } } }",
"variables": { "id": "<document-id>" }
}'
Send Example
curl https://graphql.uk.legalesign.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ak_<environment>_<key-id>.<secret>" \
--data '{
"query": "mutation SendDocument($input: DocumentSendSettingsInput!) { send(input: $input) }",
"variables": {
"input": {
"groupId": "<group-id>",
"templateId": "<template-id>",
"title": "API Key Test Document",
"recipients": [
{
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"order": 0
}
]
}
}
}'
Choosing an Auth Mode
| Mode | Coverage | Header | Best for |
|---|---|---|---|
| API Key | Supported subset only | Authorization: Bearer <api-key> | Server-side automation and common send/read flows |
| OAuth 2.0 | Supported subset only (not generateComponentToken) | Authorization: Bearer <access-token> | Apps you build for your organisation's users, where each person signs in as themselves |
Use the auth badges on query and mutation reference pages to confirm whether a root operation supports API-key and OAuth authentication.