Search headcount planning references

Operation ID: searchPlanningReferences

Group: People Management › Headcount Planning Context

Open in the interactive reference

POST /headcount-planning/references/search

Read-only: A read that takes its filters in the body. Changes nothing, and ignores Idempotency-Key.

Finds the identifiers that headcount planning endpoints take, one kind of reference per request. Send filters.kind, and filters.entityId for kinds that belong to an entity: fiscalYear, book, account and compensationBandSet. filters.text narrows the results to references whose label or code contains it, case-insensitively. Results are ordered by label and paged with an opaque cursor: pass pagination.nextCursor back as page.cursor. A page holds 50 references by default and at most 200.

Employees are the active employees of the entity and its subsidiaries when entityId is sent, and otherwise of every entity for a planning administrator, or of the entities of your department budgets and their subsidiaries for anyone else; send filters.includeInactiveEmployees true to include inactive and former employees. Departments, positions, locations, employment categories and currencies are shared across entities, so entityId does not narrow them. A caller who is not a planning administrator sees only the entities and departments of the department budgets they own or contribute to, and an entityId outside that scope answers ENTITY_NOT_FOUND exactly like an unknown one.

Accounts are the leaf profit-and-loss accounts of the entity's book. Compensation band sets are the draft and active sets of the entity. A fiscalYear reference's code is the value getPlanningContext takes as fiscalYear.

References aggregate several record types, so they carry no lastModifiedDate.

Every request needs the Api-Version header. A missing or empty header, or one naming no version, answers 400. A route that does not exist in the requested version answers 404.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.

Request body

Required, application/json: searchPlanningReferencesInput.

Field Type Required Description
filters object yes Which references to return. kind is required. Example: {"kind":"department","text":"eng"}.
filters.kind string yes The kind of reference to return. One of: "entity" (Legal entities a plan can be created for.), "fiscalYear" (Fiscal years of the entity's fiscal calendar. Needs entityId.), "department" (Active departments.), "position" (Active positions.), "location" (Work locations.), "employee" (Employees, for example budget owners.), "employmentCategory" (Employment categories.), "currency" (Currencies, with English names.), "book" (The accounting book of the entity. Needs entityId.), "account" (Leaf profit-and-loss accounts of the entity's book. Needs entityId.), "compensationBandSet" (Draft and active compensation band sets of the entity. Needs entityId.).
filters.entityId string no The identifier of the entity (a UUID). Required for kinds fiscalYear, book, account and compensationBandSet.
filters.text string no Matches references whose label or code contains this text, case-insensitively. Omit or send blank text to match every reference of the kind.
filters.includeInactiveEmployees boolean no Employees only. By default only active employees are returned. Send true to include inactive and former employees as well.
page object no Cursor and page size. Omit for the first page at the default size. Example: {"size":50}.
page.cursor string no The cursor from the previous response's pagination.nextCursor. Do not construct it. Omit for the first page.
page.size number no References per page. Defaults to 50. A value below 1 reads as 1, and a value above 200 reads as 200.
{
  "filters": {
    "kind": "department",
    "text": "eng"
  }
}

Response

200 Success

Under data (searchPlanningReferencesOutput):

Field Type Required Description
items array<object> yes The matching references, ordered by label. An empty array when nothing matches. Example: [{"kind":"department","id":"8c0e7d52-1f3a-4b6c-9d2e-5a4b3c2d1e0f","label":"Engineering","code":"ENG"}].
items[].kind string yes The kind of the reference, the kind you asked for.
items[].id string no The identifier of the referenced record (a UUID). Pass it wherever another endpoint takes this kind's id. Absent for kind fiscalYear, which has no record of its own: use its code.
items[].label string yes The display name of the reference.
items[].code string no The business code of the reference: the department code, position number, account number, ISO 4217 currency code, or the fiscal year value getPlanningContext takes. Absent when the kind has none.
items[].currency string no The ISO 4217 currency of an entity or compensation band set. Absent for other kinds.
pagination object yes Cursor and flag for fetching the next page. Example: {"hasMore":false}.
pagination.nextCursor string no Pass back as page.cursor. Absent on the last page.
pagination.hasMore boolean yes Whether a further page exists.
{
  "data": {
    "items": [
      {
        "kind": "department",
        "id": "8c0e7d52-1f3a-4b6c-9d2e-5a4b3c2d1e0f",
        "label": "Engineering",
        "code": "ENG"
      }
    ],
    "pagination": {
      "hasMore": false
    }
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Errors

Code Status
PLANNING_ACCESS_DENIED 400
ENTITY_REQUIRED 400
ENTITY_NOT_FOUND 400
INVALID_CURSOR 400

Statuses