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

Endpoint

POST /api/tickets/{ticket_id}/archivar
Moves a resolved ticket into long-term archive storage. The actor’s identity (user_id, nombre, email, rol) is extracted automatically from your JWT token — you do not need to supply it in the request body. The operation is executed via sp_archivar_ticket.

Path parameters

ticket_id
string
required
The UUID of the ticket to archive.

Request body

motivo
string
required
The reason for archiving the ticket. This text is stored in the ticket history alongside the actor’s identity from the JWT token.

Response

message
string
Confirmation string. Returns "Archivado" 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}/archivar \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "motivo": "Ticket resolved and closed after 30-day retention period"
  }'
{
  "message": "Archivado"
}

Build docs developers (and LLMs) love