Endpoint
Authentication
Requires a developer API key in theAuthorization header.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer <api_key> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
grantId | string | Yes | The grant to attach a budget to |
initialBudget | number | Yes | The initial budget amount (must be positive) |
currency | string | No | Currency code (default "USD") |
Example Request
Response — 201 Created
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique budget allocation ID |
grantId | string | The grant this budget is attached to |
initialBudget | number | The initial budget amount |
remainingBudget | number | Current remaining budget (equals initialBudget on creation) |
currency | string | Currency code |
createdAt | string | ISO-8601 creation timestamp |
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | Missing grantId or initialBudget not positive |
| 401 | UNAUTHORIZED | Invalid or missing API key |
| 404 | NOT_FOUND | Grant not found or does not belong to developer |
| 409 | CONFLICT | Budget allocation already exists for this grant |