Ir al contenido

Create or update a human-handoff ticket

POST
/v2/clients/{client_id}/tickets
curl --request POST \
--url https://api-agent.manoflow.com/v2/clients/4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e/tickets \
--header 'Content-Type: application/json' \
--header 'x-kyto-key: <x-kyto-key>' \
--data '{ "ticket_id": "tk-0001", "conversation_id": "conv_01_test", "user_id": "+10000000042", "platform": "whatsapp", "status": "open", "priority": "medium", "reason": "El contacto pide hablar con una persona", "entity_type": "hotel", "entity_name": "Hotel Prueba", "updated_by": "bot" }'

Upsert by ticket_id, which is required and never invented. status is open, in_progress, resolved or closed; priority low, medium, high or urgent; entity_type hotel, store, branch, clinic or other (all lowercase, as sent). history, time_to_solve_seconds and updated_at are the server’s: sent back, they are ignored. A history entry is added for a new ticket and when status, assigned_to, resolved_by, resolution_notes, entity_type or entity_name really change, so a resend adds none. A super admin cannot be assigned_to (422 assignee_not_allowed). A ticket_id starting with hitl: is reserved for Live Inbox and refused. created_at is set once. 201 created, 200 updated, unchanged or stale, with result in the answer (created, updated, unchanged, stale). A resend of the same body is 200 unchanged and moves nothing. A field that is absent, null or an empty text keeps the stored value; clearing a field is not offered. Unknown top-level fields are 422: extras go inside attributes (merged per key), and an attributes key named like a field, or like the old name of one, is reserved_name. Numbers are JSON numbers ("150000" is 422). Every _at field is a JSON string YYYY-MM-DDTHH:MM:SS[.fraction](Z|+HH:MM): capital T, seconds, and Z or an offset. A time without an offset (timestamp_without_offset), an epoch number or string, a space instead of T, no seconds, a lowercase t or z, a date only, T24:00:00, a leap second or an impossible offset (invalid_timestamp) is 422: no time zone is ever guessed. Instants come back as UTC with milliseconds, YYYY-MM-DDTHH:MM:SS.sssZ.

client_id
required
string

The client the key belongs to (any other client is 403)

Example

4e2a8c3d-1b9f-4e6a-8c7d-9f0a1b2c3d4e

The ticket. ticket_id is required.

Media typeapplication/json
TicketIn

A ticket, created or updated by ticket_id. A field that is absent or null keeps the stored value. A history entry is added for a new ticket and when status, assigned_to, resolved_by, resolution_notes, entity_type or entity_name really change.

object
ticket_id
required
Ticket Id
string
conversation_id
Conversation Id
Any of:
string
user_id
User Id
Any of:
string
platform
Platform
Any of:
string
status
Status
Any of:
string
priority
Priority
Any of:
string
reason
Reason
Any of:
string
summary
Summary
Any of:
string
entity_type
Entity Type
Any of:
string
entity_name
Entity Name
Any of:
string
assigned_to
Assigned To
Any of:
string
resolved_by
Resolved By
Any of:
string
resolution_notes
Resolution Notes
Any of:
string
internal_notes
Internal Notes
Any of:
string
updated_by
Updated By
Any of:
string
created_at
Created At
Any of:
string format: date-time
attributes
Attributes
Any of:
object
key
additional properties
any
id
Id
history
History
time_to_solve_seconds
Time To Solve Seconds
updated_at
Updated At

Example

{
"ticket_id": "tk-0001",
"conversation_id": "conv_01_test",
"user_id": "+10000000042",
"platform": "whatsapp",
"status": "open",
"priority": "medium",
"reason": "El contacto pide hablar con una persona",
"entity_type": "hotel",
"entity_name": "Hotel Prueba",
"updated_by": "bot"
}

Updated or unchanged

Media typeapplication/json

Example

{
"id": "9b8c7d6e-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
"ticket_id": "tk-0001",
"conversation_id": "conv_01_test",
"user_id": "+10000000042",
"platform": "whatsapp",
"status": "open",
"priority": "medium",
"reason": "El contacto pide hablar con una persona",
"summary": null,
"entity_type": "hotel",
"entity_name": "Hotel Prueba",
"assigned_to": null,
"resolved_by": null,
"resolution_notes": null,
"internal_notes": null,
"updated_by": "bot",
"created_at": "2026-09-30T14:05:00.000Z",
"updated_at": "2026-09-30T14:05:00.000Z",
"time_to_solve_seconds": null,
"history": [
{
"at": "2026-09-30T14:05:00.000Z",
"updated_by": "bot",
"status": "open",
"entity_type": "hotel",
"entity_name": "Hotel Prueba"
}
],
"attributes": {},
"result": "unchanged"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Created

Media typeapplication/json

Example

{
"id": "9b8c7d6e-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
"ticket_id": "tk-0001",
"conversation_id": "conv_01_test",
"user_id": "+10000000042",
"platform": "whatsapp",
"status": "open",
"priority": "medium",
"reason": "El contacto pide hablar con una persona",
"summary": null,
"entity_type": "hotel",
"entity_name": "Hotel Prueba",
"assigned_to": null,
"resolved_by": null,
"resolution_notes": null,
"internal_notes": null,
"updated_by": "bot",
"created_at": "2026-09-30T14:05:00.000Z",
"updated_at": "2026-09-30T14:05:00.000Z",
"time_to_solve_seconds": null,
"history": [
{
"at": "2026-09-30T14:05:00.000Z",
"updated_by": "bot",
"status": "open",
"entity_type": "hotel",
"entity_name": "Hotel Prueba"
}
],
"attributes": {},
"result": "created"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is not valid JSON, or not a JSON object

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/invalid-json",
"title": "The body is not valid JSON",
"status": 400,
"code": "invalid_json",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Missing, malformed, unknown or revoked key (one answer for all)

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unauthorized",
"title": "Missing, malformed, unknown or revoked key",
"status": 401,
"code": "unauthorized",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key belongs to another client, or the client does not exist

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/forbidden",
"title": "The key does not belong to this client",
"status": 403,
"code": "forbidden",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The body is over 1 MiB

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/payload-too-large",
"title": "The body is too large",
"status": 413,
"code": "payload_too_large",
"detail": "The limit is 1 MiB.",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

A write needs Content-Type: application/json

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/unsupported-media-type",
"title": "Content-Type must be application/json",
"status": 415,
"code": "unsupported_media_type",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The ticket cannot be stored: no ticket_id, an unknown field, a value outside its list, a super admin as assigned_to. Nothing was stored

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/validation-failed",
"title": "The request has invalid fields",
"status": 422,
"code": "validation_failed",
"detail": "1 field is invalid",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W",
"errors": [
{
"pointer": "/priority",
"code": "unknown_value",
"message": "must be one of: low, medium, high, urgent"
}
]
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

The key made too many requests this minute (only when a limit is set); wait the Retry-After seconds

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/rate-limited",
"title": "Too many requests",
"status": 429,
"code": "rate_limited",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.

Unexpected error: quote the request_id

Media typeapplication/problem+json

Example

{
"type": "https://api-agent.manoflow.com/problems/internal-error",
"title": "Internal error",
"status": 500,
"code": "internal_error",
"request_id": "01J9ZK8Q4T7X2M5N6P3R1S0V9W"
}
X-Request-Id
string

The request’s id: the one sent, or a generated one. On every log line of the request; quote it when reporting a problem.