Saltar al contenido

Move a request

Módulo Workforce

POST/help-desk-requests/{id}/transitionhelpDeskRequests.transition

A team member moves the request through Open, Waiting, Resolved and Closed with a reason. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.

  • Requiere la capacidad inbox.notifications.write.
  • Alcances de OAuth: inbox.
  • Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
  • Estados de error: 400, 401, 404, 409, 422, 429. Los errores son detalles de problema RFC 9457.

Parámetros de ruta y de consulta

helpDeskRequests.transition: Parámetros de ruta y de consulta
CampoTipoObligatorioDescripción
idstring (uuid)SíIdentifier of the help desk request.

Cuerpo de la solicitud: HelpDeskTransitionRequest

helpDeskRequests.transition: HelpDeskTransitionRequest
CampoTipoObligatorioDescripción
expected_state"Open" | "Waiting" | "Resolved" | "Closed"SíThe state the caller believes the row is in.
to_state"Open" | "Waiting" | "Resolved" | "Closed"SíTarget state.
reasonstringSíWhy the state changes.Restricciones: length 1 to 500
{
  "expected_state": "Open",
  "to_state": "Resolved",
  "reason": "Ready to go."
}

Respuesta 200: WorkforceLedgerEntry

helpDeskRequests.transition: WorkforceLedgerEntry
CampoTipoObligatorioDescripción
ledger_idstring (uuid)SíThe state transition ledger entry written.
{
  "ledger_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}

Ejemplos de código

curl -X POST "$XOS_BASE_URL/help-desk-requests/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/transition" \
  -H "Authorization: Bearer $XOS_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"expected_state":"Open","to_state":"Resolved","reason":"Ready to go."}'
const { data } = await xos.helpDeskRequests.transition("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {
    "expected_state": "Open",
    "to_state": "Resolved",
    "reason": "Ready to go."
  });
response = xos.help_desk_requests.transition("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {"expected_state": "Open", "to_state": "Resolved", "reason": "Ready to go."})
xos help-desk-requests transition 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f --data '{"expected_state":"Open","to_state":"Resolved","reason":"Ready to go."}'