Set what applies between two departments in the current mode (admin)
const url = 'https://api.vexarn.dev/api/org/barriers';const options = { method: 'PUT', headers: { cookie: '__Host-vexarn.session_token=<__Host-vexarn.session_token>', 'Content-Type': 'application/json' }, body: '{"a":"0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43","b":"5e2d8c71-3a4b-4f9e-8d6c-1b7a0f2e9c35","mode":"both"}'};
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/barriers \ --header 'Content-Type: application/json' \ --cookie __Host-vexarn.session_token=<__Host-vexarn.session_token> \ --data '{ "a": "0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43", "b": "5e2d8c71-3a4b-4f9e-8d6c-1b7a0f2e9c35", "mode": "both" }'Members of a department that does not see another neither find its members nor message them (recipient_not_found); their messages not yet fetched are held. The rule covers the departments below both sides. Recorded in the security log.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”What applies between departments a and b in the current mode; replaces whatever was set for the pair in it. Not between a department and itself, its ancestor or its descendant.
object
Rules of the current mode. Open mode: none (they see each other), both (neither sees the other), a_cannot_see_b / b_cannot_see_a (one way). Closed mode: none (no permission), both (they see each other), a_sees_b / b_sees_a (one way).
Example
{ "a": "0b9f2a4e-6c1d-4f3a-9e8b-2d5c7a1f0e43", "b": "5e2d8c71-3a4b-4f9e-8d6c-1b7a0f2e9c35", "mode": "both"}Responses
Section titled “Responses”Every barrier rule after the change
object
open: everyone sees everyone except where a barrier stands. closed: people see only those who share a department line with them (the same department, or any department above or below theirs) and departments a permission rule allows. People in no department are never restricted.
The rules of the current mode. Open: each rule reads “members of fromId and of the departments below it do not see members of toId and of the departments below it”. Closed: “members of fromId and below see members of toId and below”. Two ways is two rules. The rules of the other mode are kept and apply again when it is switched back. At most 5000 of each kind.
object
Example
{ "mode": "open"}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 (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 in it (department_not_found)
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 organization has the most barrier rules allowed (barrier_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" }}The two are the same department, or one is above the other (barrier_invalid)
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