Skip to main content
POST
Crear un ticket
Creates a ticket — a case, deal, or conversation you want to track through a pipeline. The only mandatory field is chat_user: the contact the ticket belongs to. The company and project are taken from your token and must not appear in the body. Sending them returns 400.
A ticket is anchored to a chat user, not to a customer. The chat user is the contact record Keebai creates when someone writes to one of your channels. Get its id from an inbound message webhook or from the portal.

Endpoint

Required scope

crm:tickets:write

Headers

Body

Example request

Response

201 Created

stage_requested echoes back the stage you asked for, and is present only when you sent one.

400 Bad Request

Missing chat_user, an id that is not a valid ObjectId, a priority outside the allowed set, or a property the endpoint does not accept — including company and project, which are derived from the token.

401 Unauthorized

Missing, invalid, revoked, or expired token.

403 Forbidden

The token does not have the crm:tickets:write scope.

Operational notes

  • No stage is assigned by default. If you omit stage, the ticket is created without one and will not appear in a pipeline board until you move it with POST /v1/crm/tickets/:id/stage.
  • Tickets open as is_closed: false. Close one by sending {"is_closed": true, "resolution": "won"} to PATCH /v1/crm/tickets/:id.
  • Nothing deduplicates by contact. Two POSTs for the same chat_user create two tickets. Check for an existing open ticket first if that is not what you want.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Body

application/json
chat_user
string
required

Id del chat user (contacto) dueño del ticket

chat_user_name
string
chat_user_avatar
string
chat_user_channel
string

Canal de origen (whatsapp, instagram…)

chat_user_channel_id
string
priority
enum<string>
default:medium
Available options:
low,
medium,
high,
urgent
category
string
assigned_to
string

Id del usuario asignado

custom_fields
object
amount
number

Valor monetario de la oportunidad

amount_currency
string

Moneda ISO 4217

amount_status
enum<string>
Available options:
estimated,
confirmed
stage
string

Etapa del pipeline. Si se omite, el ticket queda sin etapa asignada.

Response

201 - application/json
ticket
object
required