Skip to main content
Authentication required. You must include a valid Bearer token. Only users with the ADMIN or MESA role can call this endpoint.

Endpoint

POST /api/tickets/{ticket_id}/asignar
Assigns a ticket to a named agent. The assignment is recorded along with a reason and logged in the ticket’s audit history via sp_asignar_ticket.

Path parameters

ticket_id
string
required
The UUID of the ticket to assign.

Request body

agenteId
string
required
The user ID of the agent to assign the ticket to.
motivo
string
required
The reason for the assignment. This text is stored in the ticket history.

Response

message
string
Confirmation string. Returns "Asignado" on success.

Error codes

StatusDescription
401No token provided or token is invalid.
403Your role is not ADMIN or MESA.
404No ticket found with the given ticket_id.

Example

curl --request POST \
  --url https://your-domain.com/api/tickets/{ticket_id}/asignar \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "agenteId": "usr_abc123",
    "motivo": "Assigned to specialist for network issues"
  }'
{
  "message": "Asignado"
}

Build docs developers (and LLMs) love