Returns every operator currently assigned to the given department within the current organization. Each entry includes the membership id, operator id, department id, and the operator's display name, email, and status (joined from operators/users). The departments feature must be enabled.
/api/departments/{id}/membersOrganization API key supplied as Authorization: Bearer convor_sk_....
In: header
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
{
"data": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"operatorId": "373c4133-3dda-4217-938b-a5730b9cc41a",
"departmentId": "a3452d1e-b055-4677-aa66-858ddc0a1f59",
"displayName": "string",
"email": "string",
"status": "string"
}
]
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}curl --request GET \
'https://api.convor.io/api/departments/00000000-0000-4000-8000-000000000000/members' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer convor_sk_...'const response = await fetch("https://api.convor.io/api/departments/00000000-0000-4000-8000-000000000000/members", {
method: "GET",
headers: {
"Accept": "application/json",
"Authorization": "Bearer convor_sk_..."
},
});
const contentType = response.headers.get("content-type") ?? "";
const data = response.status === 204
? null
: contentType.includes("json")
? await response.json()
: contentType.startsWith("text/")
? await response.text()
: await response.blob();
if (!response.ok) {
const message = typeof data === "object" && data !== null
&& "error" in data && typeof data.error === "object"
&& data.error !== null && "message" in data.error
? String(data.error.message)
: "Convor API request failed (" + response.status + ")";
throw new Error(message);
}
console.log(data);Was this page helpful?
List departments for the organization
Lists departments for the current organization. The departments feature must be enabled for the organization before this endpoint can be used. Results are ordered alphabetically by department name.
Remove an operator from a department
Removes an operator from the given department within the current organization. Admin access is required, and the departments feature must be enabled. The operator and department are identified by their path ids and the membership is deleted. Returns 200 with `{ success: true, deleted: true }` regardless of whether a matching membership row existed. Access requires an active organization administrator session or an organization API key with the `departments:write` scope. API-key calls also require the automation API module. Data is isolated to the authenticated organization; identifiers from another organization or site are not disclosed.