Authentication
SendPromptly uses bearer API keys scoped to a project. Your app uses the plaintext key shown once when you create it in the dashboard.
Header format
| |
Required ingestion headers
AuthorizationIdempotency-KeyContent-Type: application/jsonAccept: application/json
Idempotency-Key is required on both POST /api/v1/receipt and POST /api/v1/result. Reuse the same key only when retrying the exact same request body.
Security best practices
- Generate separate keys for distinct deployments or modes, for example
Production key,Staging worker, orCI validation. - Store tokens in a secret manager, never in source control.
- Restrict usage to backend services; do not expose tokens in browsers or mobile apps.
- Rotate tokens on a regular schedule and after any suspected leak.
Rotation workflow
- Create a new API key on the project.
- Deploy backend changes to use the new token.
- Verify successful
receiptandresultcalls. - Revoke the old token after confirmation.
Common authentication failures
401 unauthorized: bearer token is missing, malformed, revoked, or does not match any project.400 missing_idempotency_key: theIdempotency-Keyheader is missing.406 missing_accept_headeror406 not_acceptable: the request does not allowapplication/json.415 unsupported_media_type: the request is not sent as JSON.
Hardening checklist
- Keep repair callback secrets and API keys in separate secret entries.
- Log token fingerprint metadata internally, not full token values.
- Alert on repeated auth failures so you catch misconfigured deployments quickly.
For complete request examples, see Quickstart and API Reference.