Crear un cliente
curl --request POST \
--url https://api.keebai.com/v1/crm/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": [
"<string>"
],
"accepts_marketing": false
}
'import requests
url = "https://api.keebai.com/v1/crm/customers"
payload = {
"name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": ["<string>"],
"accepts_marketing": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
last_name: '<string>',
email: '<string>',
phone: '<string>',
identification_number: '<string>',
identification_country: '<string>',
external_ids: [{provider: '<string>', external_id: '<string>'}],
custom_fields: {},
tags: ['<string>'],
accepts_marketing: false
})
};
fetch('https://api.keebai.com/v1/crm/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.keebai.com/v1/crm/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'identification_number' => '<string>',
'identification_country' => '<string>',
'external_ids' => [
[
'provider' => '<string>',
'external_id' => '<string>'
]
],
'custom_fields' => [
],
'tags' => [
'<string>'
],
'accepts_marketing' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.keebai.com/v1/crm/customers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.keebai.com/v1/crm/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/crm/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}"
response = http.request(request)
puts response.read_body{
"customer": {
"_id": "<string>",
"name": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": [
"<string>"
],
"accepts_marketing": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>"
}
}Customers
POST /v1/crm/customers
Create a customer. Company and project come from the token; Keebai generates the id.
POST
/
v1
/
crm
/
customers
Crear un cliente
curl --request POST \
--url https://api.keebai.com/v1/crm/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": [
"<string>"
],
"accepts_marketing": false
}
'import requests
url = "https://api.keebai.com/v1/crm/customers"
payload = {
"name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": ["<string>"],
"accepts_marketing": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
last_name: '<string>',
email: '<string>',
phone: '<string>',
identification_number: '<string>',
identification_country: '<string>',
external_ids: [{provider: '<string>', external_id: '<string>'}],
custom_fields: {},
tags: ['<string>'],
accepts_marketing: false
})
};
fetch('https://api.keebai.com/v1/crm/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.keebai.com/v1/crm/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'last_name' => '<string>',
'email' => '<string>',
'phone' => '<string>',
'identification_number' => '<string>',
'identification_country' => '<string>',
'external_ids' => [
[
'provider' => '<string>',
'external_id' => '<string>'
]
],
'custom_fields' => [
],
'tags' => [
'<string>'
],
'accepts_marketing' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.keebai.com/v1/crm/customers"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.keebai.com/v1/crm/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keebai.com/v1/crm/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"identification_number\": \"<string>\",\n \"identification_country\": \"<string>\",\n \"external_ids\": [\n {\n \"provider\": \"<string>\",\n \"external_id\": \"<string>\"\n }\n ],\n \"custom_fields\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"accepts_marketing\": false\n}"
response = http.request(request)
puts response.read_body{
"customer": {
"_id": "<string>",
"name": "<string>",
"external_ids": [
{
"provider": "<string>",
"external_id": "<string>"
}
],
"custom_fields": {},
"tags": [
"<string>"
],
"accepts_marketing": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"last_name": "<string>",
"email": "<string>",
"phone": "<string>",
"identification_number": "<string>",
"identification_country": "<string>"
}
}Creates a customer in your CRM. Only
name is mandatory — everything else can be filled in later with PATCH /v1/crm/customers/:id.
The company and project are taken from your token and must not appear in the body. Sending them returns 400.
Endpoint
POST https://api.keebai.com/v1/crm/customers
Required scope
crm:customers:write
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer kbai_pk_<token> |
Content-Type | Yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | First name or company name. Up to 200 characters. |
last_name | string | No | Last name. Up to 200 characters. |
email | string | No | Valid email address. |
phone | string | No | Phone number. Store it in E.164 to make it findable later. |
identification_number | string | No | National id. Unique within your company when present. |
identification_type | string | No | One of rut, dni, passport, other. |
identification_country | string | No | ISO 3166-1 alpha-2 country code. |
external_ids | array | No | Cross-references to other systems: [{ "provider": "shopify", "external_id": "1234" }]. |
custom_fields | object | No | Free-form object matching the custom fields configured for your company. |
tags | string[] | No | ObjectIds of CRM tags. |
accepts_marketing | boolean | No | Marketing consent flag. Defaults to false. |
Example request
curl -X POST https://api.keebai.com/v1/crm/customers \
-H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Juan",
"last_name": "Pérez",
"email": "juan@example.com",
"phone": "+56912345678",
"identification_number": "12345678-9",
"identification_type": "rut",
"identification_country": "CL",
"accepts_marketing": true
}'
const response = await fetch("https://api.keebai.com/v1/crm/customers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KEEBAI_API_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Juan",
last_name: "Pérez",
email: "juan@example.com",
phone: "+56912345678",
accepts_marketing: true,
}),
});
const { customer } = await response.json();
import os, requests
resp = requests.post(
"https://api.keebai.com/v1/crm/customers",
headers={"Authorization": f"Bearer {os.environ['KEEBAI_API_TOKEN']}"},
json={
"name": "Juan",
"last_name": "Pérez",
"email": "juan@example.com",
"phone": "+56912345678",
"accepts_marketing": True,
},
timeout=10,
)
resp.raise_for_status()
customer = resp.json()["customer"]
Response
201 Created
{
"customer": {
"_id": "65a1f2b3c4d5e6f7a8b9c0d1",
"name": "Juan",
"last_name": "Pérez",
"email": "juan@example.com",
"phone": "+56912345678",
"external_ids": [],
"custom_fields": {},
"tags": [],
"accepts_marketing": true,
"created_at": "2026-05-02T14:31:07.221Z",
"updated_at": "2026-05-02T14:31:07.221Z"
}
}
400 Bad Request
Missingname, malformed email, an identification_type 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 thecrm:customers:write scope.
502 Bad Gateway
The CRM service could not complete the write. The most common cause is a duplicateidentification_number — see the note below.
Operational notes
identification_numberis unique per company, and the collision is not handled gracefully. Creating a second customer with anidentification_numberthat already exists in your company fails with502, not a409. Check withGET /v1/crm/customersbefore creating, or leave the field empty. Email and phone have no uniqueness constraint and can repeat freely.- No implicit deduplication. Two
POSTs with the same name and phone create two customers. If you are syncing from an external system, put its id inexternal_idsand look the customer up by phone before creating.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
application/json
Nombre del cliente
Único por company cuando se informa
Available options:
rut, dni, passport, other Código de país ISO 3166-1 alpha-2
Show child attributes
Show child attributes
Campos personalizados de la company
Ids de tags del CRM
Response
201 - application/json
Show child attributes
Show child attributes
Was this page helpful?
⌘I