The Department object

Attributes

id string

Unique identifier for the object.

created_at string

ISO 8601 timestamp of when the object was created.

updated_at string

ISO 8601 timestamp of when the object was last updated.

parent_id string
is_group boolean

Default: false

department_name string required
parent_department string
company string required
disabled boolean

Default: false

The Department object
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/setup/department/{id}

Retrieve a department

Retrieves the details of an existing department. Supply the unique department ID that was returned from a previous request.

Path parameters

id string required

The identifier of the department to retrieve.

Returns

Returns the department object if a valid identifier was provided.

GET /api/setup/department/{id}
curl https://api.overplane.dev/api/setup/department/department_abc123 \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/setup/department

List all departments

Returns a list of departments. The results are sorted by creation date, with the most recently created appearing first.

Query parameters

limit integer

Maximum number of objects to return. Default: 20.

offset integer

Number of objects to skip for pagination. Default: 0.

Returns

A paginated list of department objects.

GET /api/setup/department
curl https://api.overplane.dev/api/setup/department \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "data": [
    {
      "id": "department_abc123",
      "created_at": "2024-01-15T09: 30: 00Z",
      "updated_at": "2024-01-15T09: 30: 00Z",
      "parent_id": null,
      "is_group": false,
      "department_name": "department_name_example",
      "parent_department": "parent_department_example",
      "company": "Example Corp",
      "disabled": false
    }
  ],
  "has_more": false,
  "total": 1
}
POST /api/setup/department

Create a department

Creates a new department object.

Body parameters

parent_id string
is_group boolean

Default: false

department_name string required
parent_department string
company string required
disabled boolean

Default: false

Returns

Returns the newly created department object if the call succeeded.

POST /api/setup/department
curl https://api.overplane.dev/api/setup/department \
  -H "Authorization: Bearer sk_test_..." \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"department_name":"department_name_example","company":"Example Corp"}'
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
PATCH /api/setup/department/{id}

Update a department

Updates the specified department by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path parameters

id string required

The identifier of the department to update.

Body parameters

parent_id string
is_group boolean

Default: false

department_name string
parent_department string
company string
disabled boolean

Default: false

Returns

Returns the updated department object.

PATCH /api/setup/department/{id}
curl https://api.overplane.dev/api/setup/department/department_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X PATCH \
  -H "Content-Type: application/json" \
  -d '{"parent_id":null,"is_group":false}'
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
DELETE /api/setup/department/{id}

Delete a department

Permanently deletes a department. This cannot be undone.

Path parameters

id string required

The identifier of the department to delete.

Returns

Returns a confirmation that the department has been deleted.

DELETE /api/setup/department/{id}
curl https://api.overplane.dev/api/setup/department/department_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -X DELETE
Response
{
  "id": "department_abc123",
  "deleted": true
}
GET /api/setup/department/{id}/children

Get children

Returns the direct children of the specified node in the tree.

Path parameters

id string required

The identifier of the department to act on.

Returns

A list of direct child objects.

GET /api/setup/department/{id}/children
curl https://api.overplane.dev/api/setup/department/department_abc123/children \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/setup/department/{id}/ancestors

Get ancestors

Returns all ancestors from the immediate parent up to the root of the tree.

Path parameters

id string required

The identifier of the department to act on.

Returns

A list of ancestor objects from parent to root.

GET /api/setup/department/{id}/ancestors
curl https://api.overplane.dev/api/setup/department/department_abc123/ancestors \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}
GET /api/setup/department/{id}/descendants

Get descendants

Returns all descendants of the specified node in the tree.

Path parameters

id string required

The identifier of the department to act on.

Returns

A list of all descendant objects.

GET /api/setup/department/{id}/descendants
curl https://api.overplane.dev/api/setup/department/department_abc123/descendants \
  -H "Authorization: Bearer sk_test_..."
Response
{
  "id": "department_abc123",
  "created_at": "2024-01-15T09: 30: 00Z",
  "updated_at": "2024-01-15T09: 30: 00Z",
  "parent_id": null,
  "is_group": false,
  "department_name": "department_name_example",
  "parent_department": "parent_department_example",
  "company": "Example Corp",
  "disabled": false
}