Skip to main content
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

Missing channel_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 the contacts:write scope.

502 Bad Gateway

The messaging service could not complete the write.

Operational notes

  • A duplicate returns 400, not 409. Uniqueness is on user_id + channel within your company. Check with GET /v1/contacts first, filtering by phone or search, if a collision is plausible.
  • user_id is not the same as phone. On WhatsApp user_id is 56912345678 while phone is +56912345678. Getting this wrong creates a contact the inbound webhook will never match, so the same person shows up twice.
  • playground is not accepted as a channel_type — it is the internal test channel and is filtered out of every read.
  • first_seen_at and last_seen_at are stamped at creation, not left empty, so a seeded contact sorts as if it had just been active.

Authorizations

Authorization
string
header
required

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

Body

application/json
channel_type
enum<string>
required

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
user_id
string
required

Identificador del contacto dentro de ese canal. En WhatsApp es el wa_id (el teléfono sin +).

channel
string

ObjectId del canal concreto. Sin él, el contacto queda asociado sólo al tipo de canal.

username
string
first_name
string
last_name
string
phone
string

Teléfono en formato E.164

email
string
profile_pic
string

URL de la foto de perfil

custom_fields
object

Campos personalizados de la company

Response

201 - application/json
contact
object
required