PUT /v1/departments/distribution-rules
PUT
/v1/departments/distribution-rules
const url = 'https://seu-endereco-da-api/v1/departments/distribution-rules';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"rules":[{"filter":{},"conditions":{},"departmentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","ownerFieldKey":"example"}]}'};
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://seu-endereco-da-api/v1/departments/distribution-rules \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "rules": [ { "filter": {}, "conditions": {}, "departmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ownerFieldKey": "example" } ] }'Permissão que a Chave de acesso precisa: Gerenciar departamentos (departments:manage).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
rules
required
Array<object>
object
filter
required
object
key
additional properties
any
conditions
object
key
additional properties
any
departmentId
string format: uuid
ownerFieldKey
string
Example generated
{ "rules": [ { "filter": {}, "conditions": {}, "departmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "ownerFieldKey": "example" } ]}Responses
Seção intitulada “Responses”Media typeapplication/json
Array<object>
object
id
required
string
position
required
The first rule, in this order, whose filter matches the contact decides where the ticket opens
number
filter
required
Contact filter in the same dialect as the contact list
object
key
additional properties
any
conditions
required
How the screen drew the filter, kept so it can be redrawn
object
key
additional properties
any
departmentId
required
Null when the rule sends the ticket to the user in ownerFieldKey
string
ownerFieldKey
required
Key of a contact field of type USER: the ticket goes to that user, or to his first department while he is offline or at his conversation limit
string
Example generated
[ { "id": "example", "position": 1, "filter": {}, "conditions": {}, "departmentId": "example", "ownerFieldKey": "example" }]A destination department does not exist
The rules were saved at the same time by someone else