Add people to a department (admin; an admin places members only)
const url = 'https://api.vexarn.dev/api/org/departments/example/members';const options = { method: 'POST', headers: { cookie: '__Host-vexarn.session_token=<__Host-vexarn.session_token>', 'Content-Type': 'application/json' }, body: '{"userIds":["5f0c8e2a9b7d4c1e"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vexarn.dev/api/org/departments/example/members \ --header 'Content-Type: application/json' \ --cookie __Host-vexarn.session_token=<__Host-vexarn.session_token> \ --data '{ "userIds": [ "5f0c8e2a9b7d4c1e" ] }'They then fall under the rules of this department and of the ones above it. Recorded in the security log.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”People of the organization to add to the department directly, at most 100 per call; people already in it stay. A person may be in at most 50 departments.
object
Example
{ "userIds": [ "5f0c8e2a9b7d4c1e" ]}Responses
Section titled “Responses”The department
object
The department above; null for a top-level one.
People in this department directly, not in the ones below; null for a plain member (head-counts are for admins and owners).
Example
{ "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" }}Your role is below admin, or an admin placing someone of equal or higher rank: only an owner places owners and admins (forbidden, recorded in the security log), or a change came from another origin than the web app (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 department (department_not_found) or member (user_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" }}A person is in the most departments allowed (member_department_limit_reached, with limit)
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" }}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