> ## Documentation Index
> Fetch the complete documentation index at: https://developers.drpn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphQL API overview

> Read-only GraphQL API for agents and integrations: audit runs and reconciliation results for one tenant.

The GraphQL API is Darpan's external, read-only API. An API key belongs to one tenant, and every query reads only that tenant's data.

| | |
| - | - |
| Endpoint | `POST https://api.drpn.ai/rest/s1/graphql/public` on hosted Darpan; a self-hosted instance uses its own backend URL |
| Schema (SDL) | `GET https://api.drpn.ai/rest/s1/graphql/sdl`, no key needed |
| Authentication | An API key in the `Authorization: Bearer dgql_…` header. See [Authentication](https://developers.drpn.ai/graphql/authentication.md) |
| Operations | Queries only. A mutation is rejected |

> [!TIP]
>
> New here? [Test your API key](https://developers.drpn.ai/graphql/quickstart.md) takes five minutes. To find the right query for a question, start from [Common tasks](https://developers.drpn.ai/graphql/tasks.md).

## What you can read

| You want | Query |
| - | - |
| This morning's audit: can it be trusted, what is open, every statement | [`auditReport`](https://developers.drpn.ai/graphql/queries/audit-report) |
| One finding in full: records, evidence, fix, history | [`auditFinding`](https://developers.drpn.ai/graphql/queries/audit-finding) |
| Every finding, filtered and paged | [`findings`](https://developers.drpn.ai/graphql/queries/findings) |
| Reconciliation runs, newest first, or one by id | [`reconciliationResults`](https://developers.drpn.ai/graphql/queries/reconciliation-results), [`reconciliationResult`](https://developers.drpn.ai/graphql/queries/reconciliation-result) |

The audit queries return the same documents as Darpan's JSON (`darpan.audit.report/v1`, `darpan.audit.finding/v1`), with one difference: GraphQL has no maps with dynamic keys, so a keyed object in the JSON is a list here, and each element carries its key (`categories: [{ id: "orders", … }]`).

## Make a request

```bash theme={null}
curl -s https://api.drpn.ai/rest/s1/graphql/public \
  -H "Authorization: Bearer $DARPAN_GQL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ auditReport(audit: \"month-close\") { health { complete summary } summary { open pending } } }"}'
```

Every response has the same envelope: `data`, `errors` and `extensions.cost`. See [Errors](https://developers.drpn.ai/graphql/errors.md) and [Cost and throttling](https://developers.drpn.ai/graphql/cost-and-throttling.md). To send it without a terminal, use the [API explorer](https://developers.drpn.ai/graphql/explorer.md).

## Fixing what a finding reports

The API has no mutations. Fix a record in the system it lives in (NetSuite, the OMS, Shopify) with your own tools. Darpan's next scheduled check looks at the record again and closes the finding when the check no longer reports it.

## JSON-RPC

`/rpc/json` is the API of Darpan's own app. It is internal and not documented here. Integrations use GraphQL.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.