Skip to main content

Endpoint

GET /v1/budget/allocations

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>

Example Request

curl https://grantex-auth-dd4mtrt2gq-uc.a.run.app/v1/budget/allocations \
  -H "Authorization: Bearer gx_..."

Response — 200 OK

{
  "allocations": [
    {
      "id": "ba_01HXYZ...",
      "grantId": "grnt_01HXYZ...",
      "initialBudget": 100.00,
      "remainingBudget": 94.50,
      "currency": "USD",
      "createdAt": "2026-04-05T12:00:00.000Z",
      "updatedAt": "2026-04-05T14:30:00.000Z"
    }
  ]
}

Response Fields

FieldTypeDescription
allocationsarrayArray of budget allocation objects
allocations[].idstringUnique budget allocation ID
allocations[].grantIdstringThe grant this budget is attached to
allocations[].initialBudgetnumberThe original budget amount
allocations[].remainingBudgetnumberCurrent remaining budget
allocations[].currencystringCurrency code
allocations[].createdAtstringISO-8601 creation timestamp
allocations[].updatedAtstringISO-8601 last update timestamp

Error Responses

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing API key

SDK Examples

import Grantex from '@grantex/sdk';

const grantex = new Grantex({ apiKey: 'gx_...' });

const { allocations } = await grantex.budgets.allocations();
for (const a of allocations) {
  console.log(`${a.grantId}: ${a.remainingBudget}/${a.initialBudget} ${a.currency}`);
}