Create hierarchy [beta]

Create a hierarchy and its levels. The client chooses the external_hierarchy_id of the hierarchy and the external_hierarchy_level_id of each level, which must be unique within the organization and cannot be changed after the hierarchy is created. The Pismo platform generates the hierarchy_id and the hierarchy_level_id of each level, and responses return both IDs.

This endpoint generates a Corporate hierarchy created event.

A hierarchy is typically used to organize divisions along territorial lines: headquarters > countries > regions > branches, and so on. Each level has an index, 0 for the root level.

Notes:

  • levels has 1 to 10 levels, with sequential index values starting at 0 and no repeats. Levels can't be added, removed or changed after the hierarchy is created.
  • Two levels can't have the same external_hierarchy_level_id (400, WAPX0092), and an external_hierarchy_level_id already used by another hierarchy fails with 409 and the code WAPX0091.
  • Creating with an external_hierarchy_id that's already in use creates nothing: the endpoint returns the response of the first creation with 200, whatever the body. Use Get hierarchy to read the hierarchy's current state.
  • If the Pismo platform doesn't confirm the creation in time, the request fails with 504 and the code EAPX0030. Retry with the same body after the Retry-After delay: the retry returns the hierarchy if Apex saved it, or creates it. If the Pismo platform created the hierarchy but didn't answer in time, the retry can create a second hierarchy, and the first one is left without an external ID.
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required
length between 1 and 60
^[a-zA-Z0-9-]+$

Hierarchy ID provided by the client, unique per organization. It cannot be changed after the hierarchy is created.

levels
array of objects
required
length between 1 and 10

List of levels of the hierarchy, with sequential index values starting at 0 for the root level

levels*
string
required
length between 1 and 60
^[a-zA-Z0-9-]+$

Hierarchy level ID provided by the client, unique per organization. It cannot be changed after the hierarchy is created.

int32
required
0 to 9

Hierarchy level index

string
length ≤ 80

Hierarchy level description

string
length between 1 and 40

Hierarchy level name

string
required
length between 1 and 40

Hierarchy name

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json