curl --request POST \
--url https://app.thinnest.ai/api/v1/contact-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Wholesale buyers"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Wholesale buyers'})
};
fetch('https://app.thinnest.ai/api/v1/contact-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/contact-groups"
payload = { "name": "Wholesale buyers" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "contact_group",
"id": "grp_5b1e9c3a-2f4d-4e8a-9c6b-7d2e1f0a3b4c",
"name": "Wholesale buyers",
"contacts": 0
}Create Contact Group
Creates an empty group. Names are unique in the workspace whatever the capitals; a second one answers 409. A build key may do this.
curl --request POST \
--url https://app.thinnest.ai/api/v1/contact-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Wholesale buyers"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Wholesale buyers'})
};
fetch('https://app.thinnest.ai/api/v1/contact-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.thinnest.ai/api/v1/contact-groups"
payload = { "name": "Wholesale buyers" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"object": "contact_group",
"id": "grp_5b1e9c3a-2f4d-4e8a-9c6b-7d2e1f0a3b4c",
"name": "Wholesale buyers",
"contacts": 0
}Authorizations
Your API key (ta_live_…) from Settings → API keys, sent as Authorization: Bearer <key>. Keep it on a server: it can message every customer you have. A key is full, build or read-only; a request its level does not allow is refused with 403.
Headers
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.
"org_3fKq9TzQ1mN8vB2xR7cLpA"
Body
Spaces are trimmed and collapsed.
1 - 60