Skip to main content

Endpoint

GET /v1/budget/balance/:grantId

Authentication

Requires a developer API key in the Authorization header.

Request Headers

HeaderValue
AuthorizationBearer <api_key>

Path Parameters

ParameterTypeDescription
grantIdstringThe grant ID to look up

Example Request

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

Response — 200 OK

{
  "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
idstringBudget allocation ID
grantIdstringThe grant this budget is attached to
initialBudgetnumberThe original budget amount
remainingBudgetnumberCurrent remaining budget
currencystringCurrency code
createdAtstringISO-8601 creation timestamp
updatedAtstringISO-8601 last update timestamp

Error Responses

StatusCodeDescription
401UNAUTHORIZEDInvalid or missing API key
404NOT_FOUNDNo budget allocation found for this grant

SDK Examples

import Grantex from '@grantex/sdk';

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

const balance = await grantex.budgets.balance('grnt_01HXYZ...');
console.log(balance.remainingBudget); // 94.50