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

# Getting an API key

> Create a workspace key, verify it without generating a document and rotate it safely.

## Create and store a key

Sign in to your [DocKiln workspace](https://dockiln.io/app), open **Settings → API keys**, and create a named key such as `invoice-worker`. Copy the full value when it appears. DocKiln stores a hash, so a lost key requires a replacement.

Save the key server-side as `DOCKILN_API_KEY`. Set `DOCKILN_URL` to the origin of the instance that issued it. Keep the credential out of client-side JavaScript and URLs.

## Verify workspace access

```bash theme={null}
curl --fail-with-body -sS "$DOCKILN_URL/v1/usage" \
  -H "Authorization: Bearer $DOCKILN_API_KEY"
```

A successful response includes `used`, `quota` and `resetsAt`. This read creates no document. A **401** indicates a missing or invalid credential. A **403** on a settings endpoint means that operation requires a signed-in account session.

## Rotate a key

Create a replacement, update your server secret and run the usage request again. Revoke the former key after your integration has switched. Revocation is permanent. In the 1.1 build, [disable a key temporarily](https://docs.dockiln.io/api-reference/rename-enable-or-disable-a-key.md) when you need a reversible pause.


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