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.
API-key access is a subset
API-key support is field-level. Your operation must start from an API-key-enabled root query or mutation, and the nested fields you select must also be available to API-key authentication.
Header
Send the Developer Portal key as a bearer token:
Authorization: Bearer ak_<environment>_<key-id>.<secret>
API-Key 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 |
API-Key Mutations
| Mutation | Description |
|---|---|
cancelDocument | Cancels a document if it has not been signed |
createTemplate | Creates a template and returns upload details |
send | Sends one document |
sendBatch | Starts a batch send |
sendBatchDocument | Adds a document to a batch |
startBatch | Starts a prepared batch |
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
| Mode | Coverage | Header | Best for |
|---|---|---|---|
| SRP | Full GraphQL schema | Authorization: Bearer <access-token> | Complete integrations |
| API Key | Supported subset only | Authorization: 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.