Skip to main content
Authentication required. You must include a valid Bearer token. Users with the ADMIN or MESA role can cancel any ticket. Users with the AREA role can only cancel tickets that belong to their own area.
Area restriction. If your role is AREA, you will receive a 403 error if you attempt to cancel a ticket outside your assigned area.

Endpoint

POST /api/tickets/{ticket_id}/cancelar
Permanently closes a ticket as cancelled. The rol field records whether the cancellation was initiated by the end user or by an agent. The operation is executed via sp_cancelar_ticket.

Path parameters

ticket_id
string
required
The UUID of the ticket to cancel.

Request body

motivo
string
required
The reason for cancelling the ticket. This text is stored in the ticket history.
rol
string
required
Identifies who is initiating the cancellation. Must be one of:
  • "USUARIO" — the end user is cancelling their own request.
  • "AGENTE" — an agent is closing the ticket on behalf of the system or team.

Response

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

Error codes

StatusDescription
401No token provided or token is invalid.
403Your role is not ADMIN, MESA, or AREA; or your AREA role does not cover this ticket’s area.
404No ticket found with the given ticket_id.

Example

curl --request POST \
  --url https://your-domain.com/api/tickets/{ticket_id}/cancelar \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "motivo": "User confirmed the issue resolved itself",
    "rol": "USUARIO"
  }'
{
  "message": "Cancelado"
}

Build docs developers (and LLMs) love