---
title: "Create a grant."
method: POST
path: "/v2/grants"
tags: ["Grants"]
---

# Create a grant.

`POST /v2/grants`

## Headers

- `Idempotency-Key` string — Non-empty idempotency key for deduplicating write requests on the same route.

## Request body

- union — Create-grant request. Exactly one of metric_id or currency is required. Unknown JSON fields are rejected. When provided, expires_at must be after effective_at.
  - object
    - `description` string, nullable — Optional description. Maximum 2048 Unicode scalar values.
    - `account_id` string, required — LedgerUp account identifier.
    - `metric_id` string, required — LedgerUp metric identifier. Required when currency is omitted.
    - `currency` string — Three-letter ISO 4217-style currency code. Amount is expressed in major currency units, not minor units. Required when metric_id is omitted. Stored lowercase; metric_id remains null.
    - `amount` string, required — Decimal amount as a string.
    - `expires_at` integer — Unix timestamp in seconds.
    - `contract_v1_id` string, uuid, nullable — Optional public.contracts identifier.
    - `effective_at` integer, required — Unix timestamp in seconds.
  - object
    - `description` string, nullable — Optional description. Maximum 2048 Unicode scalar values.
    - `account_id` string, required — LedgerUp account identifier.
    - `metric_id` string — LedgerUp metric identifier. Required when currency is omitted.
    - `currency` string, required — Three-letter ISO 4217-style currency code. Amount is expressed in major currency units, not minor units. Required when metric_id is omitted. Stored lowercase; metric_id remains null.
    - `amount` string, required — Decimal amount as a string.
    - `expires_at` integer — Unix timestamp in seconds.
    - `contract_v1_id` string, uuid, nullable — Optional public.contracts identifier.
    - `effective_at` integer, required — Unix timestamp in seconds.

## Response `201`

Created.

- Grant
  - `id` string, required — LedgerUp grant identifier.
  - `description` string, nullable, required — Optional description. Maximum 2048 Unicode scalar values.
  - `account_id` string, required — LedgerUp account identifier.
  - `metric_id` string, nullable, required — LedgerUp metric identifier. Null for currency grants.
  - `currency` string, nullable, required — Three-letter lowercase currency code. Amount is expressed in major currency units, not minor units. Null for metric grants.
  - `amount` string, required — Decimal amount serialized as a string.
  - `expires_at` integer, required — Unix timestamp in seconds.
  - `accepted_at` integer, required — Unix timestamp in seconds.
  - `created_at` integer, required — Unix timestamp in seconds.
  - `updated_at` integer, required — Unix timestamp in seconds.
  - `status` 'active' | 'scheduled' | 'voided' | 'archived' | 'expired', required — Derived grant status. Voided and archived take precedence over expiration and scheduled activation.
  - `archived_at` integer, required — Unix timestamp in seconds.
  - `contract_v1_id` string, uuid, nullable, required — Optional public.contracts identifier.
  - `effective_at` integer, required — Unix timestamp in seconds.

## Other responses

- `400` — Bad request, invalid header, invalid amount/quantity/currency, or text validation failure.
- `401` — Missing or invalid API key.
- `403` — API key lacks the required permission, or reset was attempted outside the test namespace.
- `408` — Request exceeded the 30 second timeout.
- `409` — Duplicate idempotency key, uniqueness conflict, or foreign-key conflict.
- `413` — Request body exceeded the 256 KiB limit.
- `415` — Write request content type was not application/json.
- `422` — Semantically invalid request, such as a service period with start greater than end.
- `429` — Rate limit exceeded.
- `500` — Internal server error or queue failure.

---

[API](https://skmtc.dev/ledgerup/apis/ledgerup-api.md) · [All operations](https://skmtc.dev/ledgerup/apis/ledgerup-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ledgerup/ledgerup-api/revisions/be257191807b/schema)
