Crear un contacto
Contacts
POST /v1/contacts
Create a messaging contact on a channel. Company and project come from the token.
POST
Crear un contacto
Creates a contact. Two fields are mandatory:
channel_type, and user_id — the identifier of the person inside that channel. On WhatsApp, user_id is the phone number without the leading +.
The company and project are taken from your token and must not appear in the body. Sending them returns 400.
Most contacts create themselves: the first time someone writes to one of your channels, Keebai records them automatically. Use this endpoint when you need a contact to exist before the first message — seeding an import, or pre-creating a record so you can attach a CRM ticket to it.
Endpoint
Required scope
contacts:write
Headers
Body
Example request
Response
201 Created
400 Bad Request
Missingchannel_type or user_id, a channel_type outside the allowed set, a property the endpoint does not accept — including company and project — or a contact that already exists for that user_id and channel.
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have thecontacts:write scope.
502 Bad Gateway
The messaging service could not complete the write.Operational notes
- A duplicate returns
400, not409. Uniqueness is onuser_id+ channel within your company. Check withGET /v1/contactsfirst, filtering byphoneorsearch, if a collision is plausible. user_idis not the same asphone. On WhatsAppuser_idis56912345678whilephoneis+56912345678. Getting this wrong creates a contact the inbound webhook will never match, so the same person shows up twice.playgroundis not accepted as achannel_type— it is the internal test channel and is filtered out of every read.first_seen_atandlast_seen_atare stamped at creation, not left empty, so a seeded contact sorts as if it had just been active.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
application/json
Canal por el que existe el contacto. playground no se acepta en la API pública.
Available options:
web, whatsapp, whatsapp_qr, facebook, messenger, instagram, tiktok, telegram, email, phone Identificador del contacto dentro de ese canal. En WhatsApp es el wa_id (el teléfono sin +).
ObjectId del canal concreto. Sin él, el contacto queda asociado sólo al tipo de canal.
Teléfono en formato E.164
URL de la foto de perfil
Campos personalizados de la company
Response
201 - application/json