Record consent
curl --request POST \
--url https://api.sendbaze.com/v1/contacts/{id}/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"source": "existing_customer",
"evidence": {
"reference": "ORD-10422",
"when": "2026-09-14"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'sms',
source: 'existing_customer',
evidence: {reference: 'ORD-10422', when: '2026-09-14'}
})
};
fetch('https://api.sendbaze.com/v1/contacts/{id}/consents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendbaze.com/v1/contacts/{id}/consents"
payload = {
"channel": "sms",
"source": "existing_customer",
"evidence": {
"reference": "ORD-10422",
"when": "2026-09-14"
}
}
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/{id}/consents")
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 \"channel\": \"sms\",\n \"source\": \"existing_customer\",\n \"evidence\": {\n \"reference\": \"ORD-10422\",\n \"when\": \"2026-09-14\"\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/{id}/consents",
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([
'channel' => 'sms',
'source' => 'existing_customer',
'evidence' => [
'reference' => 'ORD-10422',
'when' => '2026-09-14'
]
]),
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/{id}/consents"
payload := strings.NewReader("{\n \"channel\": \"sms\",\n \"source\": \"existing_customer\",\n \"evidence\": {\n \"reference\": \"ORD-10422\",\n \"when\": \"2026-09-14\"\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": "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": "not_found",
"message": "No email with id em_x.",
"docs": "https://docs.sendbaze.com/errors#not_found"
}
}{
"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
Record consent
Records the person’s consent to marketing on one or both channels, with the evidence you hold.
The contact needs the matching identifier (a phone for sms, an email for email). A form or
manual consent after an opt-out clears the opt-out (the person opted back in); import and
existing_customer never override a STOP. Requires contacts:write.
POST
/
v1
/
contacts
/
{id}
/
consents
Record consent
curl --request POST \
--url https://api.sendbaze.com/v1/contacts/{id}/consents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"source": "existing_customer",
"evidence": {
"reference": "ORD-10422",
"when": "2026-09-14"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'sms',
source: 'existing_customer',
evidence: {reference: 'ORD-10422', when: '2026-09-14'}
})
};
fetch('https://api.sendbaze.com/v1/contacts/{id}/consents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendbaze.com/v1/contacts/{id}/consents"
payload = {
"channel": "sms",
"source": "existing_customer",
"evidence": {
"reference": "ORD-10422",
"when": "2026-09-14"
}
}
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/{id}/consents")
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 \"channel\": \"sms\",\n \"source\": \"existing_customer\",\n \"evidence\": {\n \"reference\": \"ORD-10422\",\n \"when\": \"2026-09-14\"\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/{id}/consents",
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([
'channel' => 'sms',
'source' => 'existing_customer',
'evidence' => [
'reference' => 'ORD-10422',
'when' => '2026-09-14'
]
]),
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/{id}/consents"
payload := strings.NewReader("{\n \"channel\": \"sms\",\n \"source\": \"existing_customer\",\n \"evidence\": {\n \"reference\": \"ORD-10422\",\n \"when\": \"2026-09-14\"\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": "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": "not_found",
"message": "No email with id em_x.",
"docs": "https://docs.sendbaze.com/errors#not_found"
}
}{
"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
Response
The consent rows written, one per channel
How the person agreed. form: a form they submitted. import: a list you brought with consent already obtained. existing_customer: they bought from you and could opt out (POPIA s69(3)). manual: a teammate typed it in. attestation: written by the dashboard when a teammate confirms a list's consent on the Send page.
Available options:
form, import, existing_customer, manual, attestation