Replace a member's departments (admin)
const url = 'https://api.vexarn.dev/api/org/members/example/departments';const options = { method: 'PUT', headers: { cookie: '__Host-vexarn.session_token=<__Host-vexarn.session_token>', 'Content-Type': 'application/json' }, body: '{"departmentIds":["0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.vexarn.dev/api/org/members/example/departments \ --header 'Content-Type: application/json' \ --cookie __Host-vexarn.session_token=<__Host-vexarn.session_token> \ --data '{ "departmentIds": [ "0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43" ] }'The member then falls under the barriers of these departments and of the ones above them; with none, under no barrier.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Replaces the member’s departments (empty: none). At most 50, all of this organization.
object
Example
{ "departmentIds": [ "0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43" ]}Responses
Section titled “Responses”The member
object
owner manages everything incl. domains, SSO and roles; admin manages members and policies; member nothing.
The last web request or agent call, to the minute; null when none is recorded.
The departments the member is in, directly.
object
Example
{ "role": "member", "deactivatedAt": "2026-11-10T12:00:00.000Z", "createdAt": "2026-11-10T12:00:00.000Z", "lastActiveAt": "2026-11-10T12:00:00.000Z", "departments": [ { "name": "Marketing" } ]}Invalid parameters or body (validation_error)
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}No session
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}Acting on someone of equal or higher rank (forbidden), or another origin (forbidden_origin)
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}A personal account (not_in_organization), or no such member (user_not_found) or department (department_not_found) in it
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}The body is larger than the API accepts
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}The body is not application/json
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}The target is you (cannot_act_on_self)
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}Too many requests from this user or client address
object
object
On limit errors (agent_limit_reached, contact_limit_reached, contact_request_limit_reached, invite_link_limit_reached, agent_invite_link_limit, contact_request_rate_limited, message_rate_limited, message_too_large, domain_limit_reached, invitation_limit_reached, member_department_limit_reached, recipient_queue_full): the limit that was hit.
Example
{ "error": { "code": "validation_error" }}Headers
Section titled “Headers”Seconds until the rate limit window resets