# Sign API for coding agents

Read this before writing code that calls Sign API.

- **Docs.** Every page is Markdown at `<page>.md`; the index is `/llms.txt` and the API reference
  is in `/llms-api.txt`. The OpenAPI document is at `https://api.signapi.lumin.example/v1/openapi.yaml`.
- **Compatibility.** Sign API accepts SignatureAPI v1 requests unchanged. Code and SDKs written
  for SignatureAPI work after changing the base URL to `https://api.signapi.lumin.example/v1` and the API key.
- **Keys.** Send the key in `X-API-Key`. Read it from the environment (`SIGNAPI_KEY`); never
  hard-code it, print it, log it or commit it. Use a test key (`key_test_…`) while developing:
  test envelopes send no email and cost nothing.
- **Envelopes are asynchronous.** Create returns `status: processing`. Wait for webhooks
  (`envelope.completed`, `recipient.completed`) instead of polling in a tight loop.
- **Errors.** Branch on the HTTP status or on the last segment of the problem `type`, never on
  `title` or `detail`. Retry `429` after `Retry-After` and `5xx` with backoff; don't retry other `4xx`.
- **Webhooks.** Verify `webhook-signature` against the raw body, answer `2xx` quickly and ignore
  repeated `webhook-id`s.
- **Personal data.** Recipient names, emails and documents are personal data. Don't log them.
- **CLI.** `signapi` prints NDJSON and is safe for agents: `signapi init` sets up a test key,
  `signapi listen --forward-to <url>` delivers test webhooks locally.
