curl --request POST \
--url https://crm.wachat.net/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "<string>",
"name": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"title": "<string>",
"country_code": "<string>",
"email": "jsmith@example.com",
"language": "<string>",
"address": "<string>",
"note": "<string>",
"attributes": [
"<string>"
],
"is_unsubscribed": true,
"group_ids": [
123
]
}
'import requests
url = "https://crm.wachat.net/api/v1/contacts"
payload = {
"phone": "<string>",
"name": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"title": "<string>",
"country_code": "<string>",
"email": "jsmith@example.com",
"language": "<string>",
"address": "<string>",
"note": "<string>",
"attributes": ["<string>"],
"is_unsubscribed": True,
"group_ids": [123]
}
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({
phone: '<string>',
name: '<string>',
first_name: '<string>',
middle_name: '<string>',
last_name: '<string>',
title: '<string>',
country_code: '<string>',
email: 'jsmith@example.com',
language: '<string>',
address: '<string>',
note: '<string>',
attributes: ['<string>'],
is_unsubscribed: true,
group_ids: [123]
})
};
fetch('https://crm.wachat.net/api/v1/contacts', 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://crm.wachat.net/api/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' => '<string>',
'name' => '<string>',
'first_name' => '<string>',
'middle_name' => '<string>',
'last_name' => '<string>',
'title' => '<string>',
'country_code' => '<string>',
'email' => 'jsmith@example.com',
'language' => '<string>',
'address' => '<string>',
'note' => '<string>',
'attributes' => [
'<string>'
],
'is_unsubscribed' => true,
'group_ids' => [
123
]
]),
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://crm.wachat.net/api/v1/contacts"
payload := strings.NewReader("{\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\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))
}HttpResponse<String> response = Unirest.post("https://crm.wachat.net/api/v1/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm.wachat.net/api/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\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
],
"meta": "<string>"
}{
"message": "<string>",
"errors": {}
}Create contacts
Creates a contact in the authenticated workspace. Use it to add a recipient before sending, store profile data and custom attributes, and reuse the contact in groups, broadcasts, or campaigns.
curl --request POST \
--url https://crm.wachat.net/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "<string>",
"name": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"title": "<string>",
"country_code": "<string>",
"email": "jsmith@example.com",
"language": "<string>",
"address": "<string>",
"note": "<string>",
"attributes": [
"<string>"
],
"is_unsubscribed": true,
"group_ids": [
123
]
}
'import requests
url = "https://crm.wachat.net/api/v1/contacts"
payload = {
"phone": "<string>",
"name": "<string>",
"first_name": "<string>",
"middle_name": "<string>",
"last_name": "<string>",
"title": "<string>",
"country_code": "<string>",
"email": "jsmith@example.com",
"language": "<string>",
"address": "<string>",
"note": "<string>",
"attributes": ["<string>"],
"is_unsubscribed": True,
"group_ids": [123]
}
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({
phone: '<string>',
name: '<string>',
first_name: '<string>',
middle_name: '<string>',
last_name: '<string>',
title: '<string>',
country_code: '<string>',
email: 'jsmith@example.com',
language: '<string>',
address: '<string>',
note: '<string>',
attributes: ['<string>'],
is_unsubscribed: true,
group_ids: [123]
})
};
fetch('https://crm.wachat.net/api/v1/contacts', 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://crm.wachat.net/api/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' => '<string>',
'name' => '<string>',
'first_name' => '<string>',
'middle_name' => '<string>',
'last_name' => '<string>',
'title' => '<string>',
'country_code' => '<string>',
'email' => 'jsmith@example.com',
'language' => '<string>',
'address' => '<string>',
'note' => '<string>',
'attributes' => [
'<string>'
],
'is_unsubscribed' => true,
'group_ids' => [
123
]
]),
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://crm.wachat.net/api/v1/contacts"
payload := strings.NewReader("{\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\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))
}HttpResponse<String> response = Unirest.post("https://crm.wachat.net/api/v1/contacts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm.wachat.net/api/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\": \"<string>\",\n \"name\": \"<string>\",\n \"first_name\": \"<string>\",\n \"middle_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"title\": \"<string>\",\n \"country_code\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"language\": \"<string>\",\n \"address\": \"<string>\",\n \"note\": \"<string>\",\n \"attributes\": [\n \"<string>\"\n ],\n \"is_unsubscribed\": true,\n \"group_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
],
"meta": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Create a contact in the current workspace. Scramble reads these rules to document the request body. Mirrors the validation in the existing ContactsController::store.
Phone number in international format (digits, E.164). Required.
32Contact's full display name. Required when first_name is omitted.
191Optional name parts. Combined into name when name is blank.
191191191Optional salutation/title (e.g. Mr, Dr).
50Country dial code (e.g. +91). Prefixed onto the phone if missing.
10Optional email address.
191Optional preferred language / locale.
80Optional postal address.
1000Optional free-text note attached to the contact.
2000Free-form key/value attributes stored against the contact.
Whether the contact has opted out of messages. Defaults to false.
Group ids the contact belongs to. Each must exist.
Scope the existence check to the caller's workspace so a foreign
group id is rejected (was a global exists → cross-tenant ref).
