Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

An organization API key, uk_sk_live_… or uk_sk_test_…. The environment is resolved from the stored key row on every request, never from a request parameter.

Every route behind this credential is rate limited per key — 1000 requests a minute — with a second ceiling of 3000 a minute across all the keys of one environment, so splitting your traffic across keys isolates it and minting more keys does not buy more of it. A test key can never spend a live key's allowance. Every response carries the current state in headers; see the rate-limits guide.

Headers

Idempotency-Key
string

A key you choose — a UUID, or your own identifier for the operation — that makes this write safe to retry. Send the same key again and you get the same response back: the same status, the same body, and Idempotent-Replay: true. The handler does not run a second time.

The key is scoped to your API key and the route, so keys never collide between environments or tenants. It is remembered for 24 hours. Reusing it for a different request is refused (422), and a second request arriving while the first is still running is refused too (409) — retry that one in a moment.

A request that failed with a 5xx or was rate limited leaves the key spendable: retry it with the same key.

Maximum string length: 255

Body

application/json
amount
integer
required

Signed and never zero. Negative is a correction.

Required range: -10000 <= x <= 10000
reason
string
required

What this line says on their own statement. Write it for them to read.

Maximum string length: 200
request_key
string
required

Required. Your handle for this grant. The same key never writes a second line.

Maximum string length: 200
contact_id
string<uuid>

The recipient. One of this or external_id.

external_id
string

Your own id for them. One of this or contact_id.

metric
string

The KEY of a metric to credit instead of the balance. Absent is the balance, which is what this endpoint did before metrics existed. It is a field here rather than a second endpoint because it is the same act: the same recipient, the same required request_key, the same line in the same ledger.

Response

A replay of a grant already made. Nothing was written.

granted
boolean

false.

duplicate
boolean

true.

contact_id
string<uuid>
balance
integer
metric
string | null

The metric that was credited, or null for the balance. balance beside it is the tally of whichever was moved.