Skip to main content
The GraphQL API authenticates with an API key. A key belongs to one tenant: every query made with it reads that tenant’s data and nothing else. A query cannot name a tenant.

Send the key

Send the key in the Authorization header:
X-Darpan-Gql-Key: dgql_9bPq… is accepted as well. A session cookie or login_key does not authenticate this endpoint.

Get a key

A Darpan super-admin creates keys for a tenant. Each key has a label that names the agent or integration using it, and may have an expiry date. The key is shown once, when it is created; Darpan stores only its SHA-256 digest and cannot show it again. Ask your Darpan administrator to rotate or disable a key; there is no self-service key endpoint.

When a key is refused

A missing, unknown, disabled or expired key gets the same response, so a refusal does not reveal which check failed:
With no key at all the message is missing API key.

Keep keys safe

Store a key as a secret (for example in an environment variable such as DARPAN_GQL_KEY), never in source control. A key reads a tenant’s audit findings and run results; treat it like a password.