List departments

Departments of the account with their parent department.

GET https://cotlet.dev/api/v1/ispring/departments

read

Returns the department tree of the Users section. Every user belongs to exactly one department. Department Administrators see only the departments they manage and their sub-departments. Use department_id in list_users and add_users_by_email.

Parameters

Parameters: list_departments
NameTypeDescription
query string string Part of the department name.

Request

cURL
curl https://cotlet.dev/api/v1/ispring/departments \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("ispring", "list_departments")
Node.js
const result = await cotlet.call('ispring', 'list_departments');
CLI
cotlet call ispring list_departments

Example response

JSON

{
  "departments": [
    {
      "department_id": "d_10",
      "name": "Sales",
      "parent": "Company"
    },
    {
      "department_id": "d_11",
      "name": "Support",
      "parent": "Company"
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.