Sectors
Sectors logically group departments (e.g., "Sales", "Support"). Requires supervisor role or above.
Endpoints
| Method | Endpoint | Description | Minimum Role |
|---|---|---|---|
GET | /api/v1/sectors | List sectors | supervisor |
POST | /api/v1/sectors | Create sector | supervisor |
GET | /api/v1/sectors/:id | Get sector | supervisor |
PUT | /api/v1/sectors/:id | Update sector | supervisor |
DELETE | /api/v1/sectors/:id | Delete sector | supervisor |
List Sectors
GET /api/v1/sectorsQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
page_size | integer | 20 | Items per page |
sort_by | string | name | Sort field |
sort_order | string | asc | Sort direction |
Request Example
bash
curl -X GET "https://voki.avanter.com.br/api/v1/sectors" \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (200)
json
{
"data": [
{
"id": "f6a7b8c9-d0e1-2345-fghi-678901234567",
"name": "Comercial",
"description": "Setor comercial e vendas",
"active": true,
"department_count": 3,
"inserted_at": "2026-01-05T08:00:00Z",
"updated_at": "2026-01-05T08:00:00Z"
},
{
"id": "a7b8c9d0-e1f2-3456-ghij-789012345678",
"name": "Suporte",
"description": "Setor de suporte técnico",
"active": true,
"department_count": 2,
"inserted_at": "2026-01-05T08:30:00Z",
"updated_at": "2026-01-05T08:30:00Z"
}
],
"meta": {
"current_page": 1,
"page_size": 20,
"total_pages": 1,
"total_count": 2
}
}Create Sector
POST /api/v1/sectorsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Sector name |
description | string | No | Description |
Request Example
bash
curl -X POST https://voki.avanter.com.br/api/v1/sectors \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter" \
-H "Content-Type: application/json" \
-d '{
"sector": {
"name": "Financeiro",
"description": "Setor financeiro e cobrança"
}
}'Success Response (201)
json
{
"data": {
"id": "b8c9d0e1-f2a3-4567-hijk-890123456789",
"name": "Financeiro",
"description": "Setor financeiro e cobrança",
"active": true,
"department_count": 0,
"inserted_at": "2026-02-18T12:00:00Z",
"updated_at": "2026-02-18T12:00:00Z"
}
}Get Sector
GET /api/v1/sectors/:idRequest Example
bash
curl -X GET https://voki.avanter.com.br/api/v1/sectors/f6a7b8c9-d0e1-2345-fghi-678901234567 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Update Sector
PUT /api/v1/sectors/:idRequest Example
bash
curl -X PUT https://voki.avanter.com.br/api/v1/sectors/f6a7b8c9-d0e1-2345-fghi-678901234567 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter" \
-H "Content-Type: application/json" \
-d '{
"sector": {
"name": "Comercial & Marketing"
}
}'Success Response (200)
json
{
"data": {
"id": "f6a7b8c9-d0e1-2345-fghi-678901234567",
"name": "Comercial & Marketing",
"description": "Setor comercial e vendas",
"active": true,
"department_count": 3,
"inserted_at": "2026-01-05T08:00:00Z",
"updated_at": "2026-02-18T13:00:00Z"
}
}Delete Sector
DELETE /api/v1/sectors/:idNote
Sectors with associated departments cannot be deleted. Remove the departments first.
Request Example
bash
curl -X DELETE https://voki.avanter.com.br/api/v1/sectors/b8c9d0e1-f2a3-4567-hijk-890123456789 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (204)
No response body.
