Create or update a contact
curl --request POST \
--url https://api.sendbaze.com/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "+27821234567",
"email": "thandi@example.co.za",
"attributes": {
"first_name": "Thandi"
},
"consent": {
"channel": [
"sms",
"email"
],
"source": "form",
"capturedAt": "2026-10-29T08:12:00+02:00",
"evidence": {
"url": "https://shop.example.co.za/checkout",
"formId": "checkout-optin",
"ip": "196.25.1.10"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '+27821234567',
email: 'thandi@example.co.za',
attributes: {first_name: 'Thandi'},
consent: {
channel: ['sms', 'email'],
source: 'form',
capturedAt: '2026-10-29T08:12:00+02:00',
evidence: {
url: 'https://shop.example.co.za/checkout',
formId: 'checkout-optin',
ip: '196.25.1.10'
}
}
})
};
fetch('https://api.sendbaze.com/v1/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendbaze.com/v1/contacts"
payload = {
"phone": "+27821234567",
"email": "thandi@example.co.za",
"attributes": { "first_name": "Thandi" },
"consent": {
"channel": ["sms", "email"],
"source": "form",
"capturedAt": "2026-10-29T08:12:00+02:00",
"evidence": {
"url": "https://shop.example.co.za/checkout",
"formId": "checkout-optin",
"ip": "196.25.1.10"
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.sendbaze.com/v1/contacts")
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 \"phone\": \"+27821234567\",\n \"email\": \"thandi@example.co.za\",\n \"attributes\": {\n \"first_name\": \"Thandi\"\n },\n \"consent\": {\n \"channel\": [\n \"sms\",\n \"email\"\n ],\n \"source\": \"form\",\n \"capturedAt\": \"2026-10-29T08:12:00+02:00\",\n \"evidence\": {\n \"url\": \"https://shop.example.co.za/checkout\",\n \"formId\": \"checkout-optin\",\n \"ip\": \"196.25.1.10\"\n }\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendbaze.com/v1/contacts",
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([
'phone' => '+27821234567',
'email' => 'thandi@example.co.za',
'attributes' => [
'first_name' => 'Thandi'
],
'consent' => [
'channel' => [
'sms',
'email'
],
'source' => 'form',
'capturedAt' => '2026-10-29T08:12:00+02:00',
'evidence' => [
'url' => 'https://shop.example.co.za/checkout',
'formId' => 'checkout-optin',
'ip' => '196.25.1.10'
]
]
]),
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.sendbaze.com/v1/contacts"
payload := strings.NewReader("{\n \"phone\": \"+27821234567\",\n \"email\": \"thandi@example.co.za\",\n \"attributes\": {\n \"first_name\": \"Thandi\"\n },\n \"consent\": {\n \"channel\": [\n \"sms\",\n \"email\"\n ],\n \"source\": \"form\",\n \"capturedAt\": \"2026-10-29T08:12:00+02:00\",\n \"evidence\": {\n \"url\": \"https://shop.example.co.za/checkout\",\n \"formId\": \"checkout-optin\",\n \"ip\": \"196.25.1.10\"\n }\n }\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))
}{
"id": "ct_01j9x7k2r4m8q3v5n6b7c8d9e0",
"email": "<string>",
"phone": "<string>",
"attributes": {
"first_name": "Thandi",
"city": "Pretoria"
},
"marketing": {
"email": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
},
"sms": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consents": [
{
"id": "cns_01j9x7k2r4m8q3v5n6b7c8d9e0",
"contactId": "<string>",
"channel": "email",
"value": "<string>",
"purpose": "marketing",
"source": "form",
"evidence": {},
"capturedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
]
}{
"id": "ct_01j9x7k2r4m8q3v5n6b7c8d9e0",
"email": "<string>",
"phone": "<string>",
"attributes": {
"first_name": "Thandi",
"city": "Pretoria"
},
"marketing": {
"email": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
},
"sms": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consents": [
{
"id": "cns_01j9x7k2r4m8q3v5n6b7c8d9e0",
"contactId": "<string>",
"channel": "email",
"value": "<string>",
"purpose": "marketing",
"source": "form",
"evidence": {},
"capturedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
]
}{
"error": {
"code": "validation_error",
"message": "<string>",
"docs": "<string>",
"fields": {},
"limit": 123,
"upgradeUrl": "<string>",
"topUpUrl": "<string>",
"settingsUrl": "<string>",
"domainsUrl": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "The request has invalid fields.",
"docs": "https://docs.sendbaze.com/errors#validation_error",
"fields": {
"to.1": [
"must be a valid email address"
]
}
}
}Contacts and consent
Create or update a contact
Creates the contact, or completes the one that already owns the email or the phone, merges
attributes, and records the consent given in the same body (one row per channel). 201 when
created, 200 when updated. Requires contacts:write. Under POPIA a marketing SMS needs an
unrevoked SMS consent for its number; see Contacts and consent.
POST
/
v1
/
contacts
Create or update a contact
curl --request POST \
--url https://api.sendbaze.com/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "+27821234567",
"email": "thandi@example.co.za",
"attributes": {
"first_name": "Thandi"
},
"consent": {
"channel": [
"sms",
"email"
],
"source": "form",
"capturedAt": "2026-10-29T08:12:00+02:00",
"evidence": {
"url": "https://shop.example.co.za/checkout",
"formId": "checkout-optin",
"ip": "196.25.1.10"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phone: '+27821234567',
email: 'thandi@example.co.za',
attributes: {first_name: 'Thandi'},
consent: {
channel: ['sms', 'email'],
source: 'form',
capturedAt: '2026-10-29T08:12:00+02:00',
evidence: {
url: 'https://shop.example.co.za/checkout',
formId: 'checkout-optin',
ip: '196.25.1.10'
}
}
})
};
fetch('https://api.sendbaze.com/v1/contacts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendbaze.com/v1/contacts"
payload = {
"phone": "+27821234567",
"email": "thandi@example.co.za",
"attributes": { "first_name": "Thandi" },
"consent": {
"channel": ["sms", "email"],
"source": "form",
"capturedAt": "2026-10-29T08:12:00+02:00",
"evidence": {
"url": "https://shop.example.co.za/checkout",
"formId": "checkout-optin",
"ip": "196.25.1.10"
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)require 'uri'
require 'net/http'
url = URI("https://api.sendbaze.com/v1/contacts")
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 \"phone\": \"+27821234567\",\n \"email\": \"thandi@example.co.za\",\n \"attributes\": {\n \"first_name\": \"Thandi\"\n },\n \"consent\": {\n \"channel\": [\n \"sms\",\n \"email\"\n ],\n \"source\": \"form\",\n \"capturedAt\": \"2026-10-29T08:12:00+02:00\",\n \"evidence\": {\n \"url\": \"https://shop.example.co.za/checkout\",\n \"formId\": \"checkout-optin\",\n \"ip\": \"196.25.1.10\"\n }\n }\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendbaze.com/v1/contacts",
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([
'phone' => '+27821234567',
'email' => 'thandi@example.co.za',
'attributes' => [
'first_name' => 'Thandi'
],
'consent' => [
'channel' => [
'sms',
'email'
],
'source' => 'form',
'capturedAt' => '2026-10-29T08:12:00+02:00',
'evidence' => [
'url' => 'https://shop.example.co.za/checkout',
'formId' => 'checkout-optin',
'ip' => '196.25.1.10'
]
]
]),
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.sendbaze.com/v1/contacts"
payload := strings.NewReader("{\n \"phone\": \"+27821234567\",\n \"email\": \"thandi@example.co.za\",\n \"attributes\": {\n \"first_name\": \"Thandi\"\n },\n \"consent\": {\n \"channel\": [\n \"sms\",\n \"email\"\n ],\n \"source\": \"form\",\n \"capturedAt\": \"2026-10-29T08:12:00+02:00\",\n \"evidence\": {\n \"url\": \"https://shop.example.co.za/checkout\",\n \"formId\": \"checkout-optin\",\n \"ip\": \"196.25.1.10\"\n }\n }\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))
}{
"id": "ct_01j9x7k2r4m8q3v5n6b7c8d9e0",
"email": "<string>",
"phone": "<string>",
"attributes": {
"first_name": "Thandi",
"city": "Pretoria"
},
"marketing": {
"email": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
},
"sms": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consents": [
{
"id": "cns_01j9x7k2r4m8q3v5n6b7c8d9e0",
"contactId": "<string>",
"channel": "email",
"value": "<string>",
"purpose": "marketing",
"source": "form",
"evidence": {},
"capturedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
]
}{
"id": "ct_01j9x7k2r4m8q3v5n6b7c8d9e0",
"email": "<string>",
"phone": "<string>",
"attributes": {
"first_name": "Thandi",
"city": "Pretoria"
},
"marketing": {
"email": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
},
"sms": {
"consented": true,
"optedOutAt": "2023-11-07T05:31:56Z"
}
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"consents": [
{
"id": "cns_01j9x7k2r4m8q3v5n6b7c8d9e0",
"contactId": "<string>",
"channel": "email",
"value": "<string>",
"purpose": "marketing",
"source": "form",
"evidence": {},
"capturedAt": "2023-11-07T05:31:56Z",
"recordedAt": "2023-11-07T05:31:56Z",
"revokedAt": "2023-11-07T05:31:56Z",
"revokedReason": "<string>"
}
]
}{
"error": {
"code": "validation_error",
"message": "<string>",
"docs": "<string>",
"fields": {},
"limit": 123,
"upgradeUrl": "<string>",
"topUpUrl": "<string>",
"settingsUrl": "<string>",
"domainsUrl": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "The request has invalid fields.",
"docs": "https://docs.sendbaze.com/errors#validation_error",
"fields": {
"to.1": [
"must be a valid email address"
]
}
}
}Authorizations
Body
application/json
One of email or phone is required.
Response
Updated