v1

latestOpenAPI 3.0.32026-07-26362271803.3 KB
Company Objects

List Departments

    Retrieve a list of departments with optional filtering and sorting.

    Each department includes metadata about its parent department (`parent`, `parent_name`),
    so parent/child department relationships can be reconstructed from the response.

    Supports including soft-deleted records for audit and recovery purposes.
    When include_deleted=true, returns ONLY deleted records instead of active records.
    Deleted records contain minimal data: 'id', 'is_deleted=true', 'deleted_at' timestamp,
    and 'last_modified_at'. When 'false' or omitted, returns ONLY active records.
    This provides clean separation between active and deleted data.
    
get/coa/api/department

Query parameters

include_deletedboolean

When set to 'true', returns ONLY deleted records instead of active records. Deleted records contain minimal data: 'id', 'is_deleted=true', 'deleted_at' timestamp, and 'last_modified_at'. When 'false' or omitted, returns ONLY active records. This provides clean separation between active and deleted data.

include_inactiveboolean

Include inactive departments in results

last_modified_at__gtestring

Filter for records modified on or after this timestamp. Format: ISO 8601 (e.g., '2024-01-01T00:00:00Z' or '2024-01-01'). Works with both active records and deleted records (filters by deletion time for deleted records).

last_modified_at__ltestring

Filter for records modified on or before this timestamp. Format: ISO 8601 (e.g., '2024-12-31T23:59:59Z' or '2024-12-31'). Works with both active records and deleted records (filters by deletion time for deleted records).

limitinteger

Number of results to return per page.

offsetinteger

The initial index from which to return the results.

qstring

Search query - searches by department name or code

sortstring

Sort order. Use field name for ascending, -field for descending. Supports multiple fields separated by comma. Default: name

Response

countinteger required
nextstring uri nullable
previousstring uri nullable

Example response

{
  "count": 123,
  "next": "http://api.example.org/accounts/?offset=400&limit=100",
  "previous": "http://api.example.org/accounts/?offset=200&limit=100"
}