Skip to main content

API Key GraphQL Reference

GraphQL API keys created in the Developer Portal can access a supported subset of the GraphQL schema. SRP remains the full-schema authentication method.

Not all operations are available

Not every query, mutation, or field is available with an API key. 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.

Send the Developer Portal key as a bearer token:

Authorization: Bearer ak_<environment>_<key-id>.<secret>

API-Key Queries

QueryDescription
attachmentReturns an attachment
templateReturns a template
documentReturns a document
batchReturns a batch
groupReturns a group
userReturns a user, or the API-key user context when no ID is supplied
taskReturns task status and report data
recipientReturns a document recipient

API-Key Mutations

MutationDescription
cancelDocumentCancels a document if it has not been signed
createTemplateCreates a template and returns upload details
createTemplateElementCreates a new element (field) in a template
createTemplateRoleCreates a new role in a template
deleteTemplateElementDeletes an element (field) from a template
deleteTemplateRoleDeletes a role from a template
generateComponentTokenMints a short-lived token for authenticated widgets
sendSends one document
sendBatchStarts a batch send
sendBatchDocumentAdds a document to a batch
startBatchStarts a prepared batch
swapRolesSwaps the position of two roles in a template
updateTemplateUpdates a template's properties
updateTemplateElementUpdates an element (field) in a template
updateTemplateRoleUpdates a role in a template

Query Example

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

ModeCoverageHeaderBest for
SRPFull GraphQL schemaAuthorization: Bearer <access-token>Complete integrations
API KeySupported subset onlyAuthorization: Bearer <api-key>Server-side automation and common send/read flows

Use the auth badges on query and mutation reference pages to confirm whether a root operation supports API-key authentication.

Export This Article

Save a copy of this page as PDF or plain text.