Skip to content
Docs

Overview

Same project credentials

X-Gray-Project-Id plus Bearer gray_sk_… for token reads and transaction writes.

Overview

App reads and transaction writes use the same project credentials as Cloud: a project id and secret from Console › API keys.

  • X-Gray-Project-Id — your proj_… id
  • Authorization: Bearer gray_sk_… — project secret

Keep the secret on your backend. POST/PATCH bodies need Content-Type: application/json.

Example

Request
curl -sS "https://ledger.gray3.io/v1/tokens?limit=5" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret"

Who can do what

  • Project key — list/get tokens; list/get/create/patch transactions scoped to that project.
  • Project keys can read tokens. The token registry is managed by Gray3 and cannot be modified with a project key.

Auth errors

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

CodeHTTPWhen
unauthorized401Missing or invalid project ID or secret key
forbidden403This operation is not available to project keys.
rate_limit_exceeded429IP, project, write, or burst limit hit (retryable)
json
{
  "error": {
    "code": "unauthorized",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}