Skip to content
campaiDeveloper
campai.com

Finance · Accounting · Budgets

POST/{organizationId}/{mandateId}/finance/accounting/budgets/{budgetId}Reads only

Get budget

Gets a budget by organization, mandate and budget ID, with an optional until month. Returns its planned lines, fiscal-year and comparison ranges, actuals for the comparison period and prior year, and monthly actuals for the full fiscal year. If until is omitted, the comparison runs through the end of the fiscal year.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller needs mandate.read and budget.read.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • budgetIdidrequired

Body

Content-Type: application/json

  • untilobject
    2 properties
    • yearintegerrequired

      2000–3000

    • monthIndexintegerrequired

      1–12

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/finance/accounting/budgets/YOUR_BUDGET_ID' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • budgetobject
    7 properties
    • _idid
    • mandateid
    • fiscalYearinteger

      2000–3000

    • statusstring
      draft approved
    • approvedAtstring · date-timenullable
    • approvedByobjectnullable

      A non-contact budget.approvedBy actor other than the current actor is masked without user.read.

      An API budget.approvedBy actor is masked without apiKey.read. If it is not the current actor, user.read is also needed.

    • linesobject[]

      at most 20000 items

      4 properties
      • accountinteger

        1–999999999

      • costCenternumbernullable

        1–99999999

      • amountinteger
      • monthsinteger[]nullable

        exactly 12 items · each at most 9999999999

  • fiscalYearRangeobject
    2 properties
    • fromobject
      2 properties
      • yearinteger

        2000–3000

      • monthIndexinteger

        1–12

    • toobject
      2 properties
      • yearinteger

        2000–3000

      • monthIndexinteger

        1–12

  • rangeobject
    2 properties
    • fromobject
      2 properties
      • yearinteger

        2000–3000

      • monthIndexinteger

        1–12

    • toobject
      2 properties
      • yearinteger

        2000–3000

      • monthIndexinteger

        1–12

  • actualsobject[]
    4 properties
    • accountinteger

      1–999999999

    • costCenternumbernullable

      1–99999999

    • amountinteger
    • previousAmountinteger
  • monthlyActualsobject[]
    4 properties
    • yearinteger
    • monthIndexinteger

      1–12

    • revenueinteger
    • expenseinteger
Response200
{
  "budget": {
    "_id": "000000000000000000000001",
    "mandate": "000000000000000000000001",
    "fiscalYear": 2000,
    "status": "draft",
    "approvedAt": "2026-06-15T22:30:00Z",
    "approvedBy": {
      "name": "string",
      "type": "user",
      "userId": "string",
      "image": {
        "resource": "string"
      }
    },
    "lines": [
      {
        "account": 1,
        "costCenter": 1,
        "amount": 1,
        "months": [
          1
        ]
      }
    ]
  },
  "fiscalYearRange": {
    "from": {
      "year": 2000,
      "monthIndex": 1
    },
    "to": {
      "year": 2000,
      "monthIndex": 1
    }
  },
  "range": {
    "from": {
      "year": 2000,
      "monthIndex": 1
    },
    "to": {
      "year": 2000,
      "monthIndex": 1
    }
  },
  "actuals": [
    {
      "account": 1,
      "costCenter": 1,
      "amount": 1,
      "previousAmount": 1
    }
  ],
  "monthlyActuals": [
    {
      "year": 1,
      "monthIndex": 1,
      "revenue": 1,
      "expense": 1
    }
  ]
}

Errors

Other errors

StatusErrorWhen
400The month is not part of the fiscal year of the budgetIf until is outside the budget's fiscal year, the response is 400 with routes.finance.accounting.budgets.untilOutsideFiscalYear.
404Budget was not foundIf the budget is not found, the response is 404 with routes.finance.accounting.budgets.notFound.
404Accounting plan is missing. Please make sure you have setup your finances app properly.If the accounting plan is missing, the response is 404 with finance.accounting.getAccountingPlan.notFound.
404Finances settings are missingIf finances settings are missing, the response is 404 with finance.settings.getFinancesSettings.notFound.

Errors nearly every request can meet are listed under Errors.