Assignment rules
Ordered, first-match-wins routing to a team or an explicit agent pool.
Download the full API pública projection: openapi.json.
Automate replies and assignment explains this resource in prose, with runnable examples.
| Method | Path | What it does |
|---|---|---|
GET | /assignment-rules | List assignment rules |
POST | /assignment-rules | Create an assignment rule |
DELETE | /assignment-rules/{id} | Delete an assignment rule |
GET | /assignment-rules/{id} | Get an assignment rule |
PATCH | /assignment-rules/{id} | Update an assignment rule |
PUT | /assignment-rules/order | Reorder the assignment rules |
GET | /assignment-rules/portal-defaults | List portal defaults |
PUT | /assignment-rules/portal-defaults/{source} | Set a portal default |
GET /assignment-rules
List assignment rules
Every rule in the workspace, ordered by priority ascending — the exact order the router evaluates them in. Unpaginated: routing tables hold a handful of rules, not thousands.
curl https://api.vitrinadev.com/api/v1/assignment-rules \
-H "Authorization: Bearer $VITRINA_KEY"Example response (200)
{
"data": [
{
"id": "d5d5d5d5-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Mercado Libre → equipo Providencia",
"enabled": true,
"priority": 0,
"match_sources": [
"mercadolibre"
],
"match_channels": [],
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin",
"is_portal_default": false,
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
],
"meta": {
"total": 1
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
POST /assignment-rules
Create an assignment rule
Exactly one destination: team_id OR a non-empty assignee_user_ids. Empty/absent match_sources / match_channels are wildcards. A client-supplied priority is rejected — new rules append LAST; move them with PUT /assignment-rules/order. assignment_mode: "manual" is a 400 (channel-only mode).
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | mín. 1, máx. 200 |
enabled | boolean | — | |
match_sources | array | null | — | |
match_channels | array | null | — | |
team_id | string | null | — | |
assignee_user_ids | array | null | — | |
assignment_mode | auto_round_robin \ | auto_round_robin_online \ | auto_least_busy |
curl -X POST https://api.vitrinadev.com/api/v1/assignment-rules \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Mercado Libre → equipo Providencia",
"match_sources": [
"mercadolibre"
],
"team_id": "cccccccc-0000-4000-8000-000000000001"
}'Example response (201)
{
"data": {
"id": "d5d5d5d5-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Mercado Libre → equipo Providencia",
"enabled": true,
"priority": 0,
"match_sources": [
"mercadolibre"
],
"match_channels": [],
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin",
"is_portal_default": false,
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 201 · 400 · 401 · 403 · 404 · 409 · 429
DELETE /assignment-rules/{id}
Delete an assignment rule
Removes the rule. Every OTHER rule keeps its own priority — deleting does not compact the sequence, so the remaining order is unchanged.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
curl -X DELETE https://api.vitrinadev.com/api/v1/assignment-rules/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Answers: 204 · 400 · 401 · 403 · 404 · 409 · 429
GET /assignment-rules/{id}
Get an assignment rule
The rule, including its destination and its evaluation priority.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
curl https://api.vitrinadev.com/api/v1/assignment-rules/<id> \
-H "Authorization: Bearer $VITRINA_KEY"Example response (200)
{
"data": {
"id": "d5d5d5d5-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Mercado Libre → equipo Providencia",
"enabled": true,
"priority": 0,
"match_sources": [
"mercadolibre"
],
"match_channels": [],
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin",
"is_portal_default": false,
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
PATCH /assignment-rules/{id}
Update an assignment rule
Partial update. Setting team_id nulls assignee_user_ids and vice versa — the destination stays exactly one thing. priority is not writable here; use PUT /assignment-rules/order.
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
id | path | uuid | yes |
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | — | mín. 1, máx. 200 |
enabled | boolean | — | |
match_sources | array | null | — | |
match_channels | array | null | — | |
team_id | string | null | — | |
assignee_user_ids | array | null | — | |
assignment_mode | auto_round_robin \ | auto_round_robin_online \ | auto_least_busy |
curl -X PATCH https://api.vitrinadev.com/api/v1/assignment-rules/<id> \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'Example response (200)
{
"data": {
"id": "d5d5d5d5-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Mercado Libre → equipo Providencia",
"enabled": false,
"priority": 0,
"match_sources": [
"mercadolibre"
],
"match_channels": [],
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin",
"is_portal_default": false,
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
PUT /assignment-rules/order
Reorder the assignment rules
Atomic, all-or-nothing rewrite of every rule’s priority from the given id order. ids must be the COMPLETE set of the workspace’s rules, each exactly once — a partial list is a 400, never a partial apply.
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
ids | uuid[] | yes |
curl -X PUT https://api.vitrinadev.com/api/v1/assignment-rules/order \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": [
"d5d5d5d5-0000-4000-8000-000000000001"
]
}'Example response (200)
{
"data": [
{
"id": "d5d5d5d5-0000-4000-8000-000000000001",
"tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
"name": "Mercado Libre → equipo Providencia",
"enabled": true,
"priority": 0,
"match_sources": [
"mercadolibre"
],
"match_channels": [],
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin",
"is_portal_default": false,
"created_at": "2026-01-10T13:00:00.000Z",
"updated_at": "2026-09-10T13:00:00.000Z"
}
]
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
GET /assignment-rules/portal-defaults
List portal defaults
The "Predeterminado por marketplace" cards (ADR 0084): one per portal source (mercadolibre / yapo / chileautos) the workspace has configured. Each is an assignment rule flagged is_portal_default, evaluated AFTER every custom rule.
curl https://api.vitrinadev.com/api/v1/assignment-rules/portal-defaults \
-H "Authorization: Bearer $VITRINA_KEY"Example response (200)
{
"data": [
{
"source": "mercadolibre",
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin"
}
]
}Answers: 200 · 400 · 401 · 403 · 404 · 409 · 429
PUT /assignment-rules/portal-defaults/{source}
Set a portal default
Upserts the card’s WHOLE config for one portal source. Exactly one destination (team_id or assignee_user_ids); assignment_mode: "manual" is legal here (the thread queues for manual pickup and the chain STOPS). A body with no destination and a non-manual mode CLEARS the default (204).
| Parameter | In | Type | Required | Constraints |
|---|---|---|---|---|
source | path | mercadolibre \ | yapo \ | chileautos |
Body
| Field | Type | Required | Constraints |
|---|---|---|---|
assignment_mode | auto_round_robin \ | auto_round_robin_online \ | auto_least_busy \ |
team_id | string | null | — | |
assignee_user_ids | array | null | — |
curl -X PUT https://api.vitrinadev.com/api/v1/assignment-rules/portal-defaults/<id> \
-H "Authorization: Bearer $VITRINA_KEY" \
-H "Content-Type: application/json" \
-d '{
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignment_mode": "auto_round_robin"
}'Example response (200)
{
"data": {
"source": "mercadolibre",
"team_id": "cccccccc-0000-4000-8000-000000000001",
"assignee_user_ids": null,
"assignment_mode": "auto_round_robin"
}
}Answers: 200 · 204 · 400 · 401 · 403 · 404 · 409 · 429
Appointments
The hours that are booked and the catalogue of what gets booked: availability, book, move, close and cancel. A test drive and a consultation are the same resource.
Payment method
The workspace's payment provider and its mandate status — what unlocks self-serve add-on activation — and the write that connects it through Fintoc or Mercado Pago.