Departments

Create, update, delete, and list departments and teams.

Departments

Departments and teams are rows on the OrgUnit object.

Object idb7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f
Business keycode

See Overview for authentication.

To place a member in a department, update that member with orgUnitId. See Members.

Endpoint summary

MethodPath
POST/api/v1/mdata/mobject/{orgUnitId}
PUT/api/v1/mdata/{rowId}
DELETE/api/v1/mdata/{rowId}
POST/api/v1/mdata/mobject/{orgUnitId}/resolved-data

orgUnitId in create and list paths is the OrgUnit object id above. {rowId} on update and delete is the id of one department or team row.


Create a department or team

POST /api/v1/mdata/mobject/b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "data": {
    "code": "ENG",
    "name": "Engineering",
    "org_unit_type": "e1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02",
    "parent_id": null
  }
}
FieldDescription
codeShort unique id, max 50 characters. Business key
nameDisplay name, max 255 characters
org_unit_typePicklist item UUID. See the table below
parent_idParent OrgUnit row id. Omit or send null for a top-level unit

org_unit_type values:

NameId
BUe1f8d5c4-4362-8f70-9a01-5b6c7d8e9f01
DEPARTMENTe1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02
TEAMe1f8d5c4-4362-8f70-9a01-5b6c7d8e9f05
PROJECTe1f8d5c4-4362-8f70-9a01-5b6c7d8e9f03
COST_CENTERe1f8d5c4-4362-8f70-9a01-5b6c7d8e9f04

Response 200

{
  "id": "99999999-9999-9999-9999-999999999999",
  "mobjectId": "b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f",
  "data": {
    "code": "ENG",
    "name": "Engineering",
    "org_unit_type": "e1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02"
  },
  "createdAt": "2026-10-30T05:20:00.000Z",
  "updatedAt": "2026-10-30T05:20:00.000Z"
}
StatusBody
400{ "message": "..." }
404Empty body when the object id is unknown

Update a department or team

Path {rowId} is the OrgUnit row id. The OrgUnit object id goes in the body as mobjectId.

PUT /api/v1/mdata/94aecc51-793a-4576-b92b-134bc62c0079
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "mobjectId": "b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f",
  "data": {
    "code": "Eng1",
    "name": "Engineer",
    "org_unit_type": "e1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02",
    "parent_id": null
  },
  "relationships": []
}
FieldRequiredDescription
mobjectIdyesOrgUnit object id (b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f)
datayesFields to update. Same keys as create: code, name, org_unit_type, parent_id
relationshipsnoRelated-row payload. Send [] when unused

Response 200

{
  "id": "94aecc51-793a-4576-b92b-134bc62c0079",
  "mobjectId": "b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f",
  "data": {
    "code": "Eng1",
    "name": "Engineer",
    "org_unit_type": "e1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02",
    "parent_id": null,
    "updated_by": "73784163-0fca-4f3e-864f-1bcc6bf51578"
  }
}
StatusBody
400{ "message": "..." } when mobjectId is missing or the update is invalid
404Empty body when the row is not found

Delete a department or team

DELETE /api/v1/mdata/b91740c1-a256-4001-93c0-a7bf4ac9c13c?mObjectId=b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f
Authorization: Bearer YOUR_API_TOKEN
QueryRequiredDescription
mObjectIdyesOrgUnit object id (b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f)

Deletes the row and cascades related child records.

Response 204 — empty body.

StatusBody
404Empty body when the row is not found

List departments and teams

Filters, sort, and pagination are in the JSON body. Column projection is the repeated fields query parameter. id is always included.

POST /api/v1/mdata/mobject/b7c4a1e2-903f-4b2d-8c61-0a1b2c3d4e5f/resolved-data?fields=id&fields=code&fields=name&fields=org_unit_type&fields=parent_id
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "sort": [{ "field": "name", "direction": "ASC" }],
  "pagination": { "page": 0, "size": 500 }
}
Body fieldDescription
sort{ "field", "direction" }. direction is ASC or DESC. Default direction is ASC
pagination{ "page", "size" }. Omit it to return rows up to the server cap
filtersOptional query filters
searchOptional contains search
searchFieldsFields search is applied to

Response 200. Each cell is { "k", "v", "fv" }: raw value, resolved value, and formatted value.

{
  "data": [
    {
      "id": { "k": "99999999-9999-9999-9999-999999999999", "v": "99999999-9999-9999-9999-999999999999" },
      "code": { "k": "ENG", "v": "ENG", "fv": "ENG" },
      "name": { "k": "Engineering", "v": "Engineering", "fv": "Engineering" },
      "org_unit_type": {
        "k": "e1f8d5c4-4362-8f70-9a01-5b6c7d8e9f02",
        "v": "DEPARTMENT",
        "fv": "DEPARTMENT"
      },
      "parent_id": { "k": null, "v": null }
    }
  ],
  "meta": {
    "paginated": true,
    "page": 0,
    "size": 500,
    "totalElements": 1,
    "totalPages": 1,
    "truncated": false
  }
}