Create a contact
curl --request POST \
--url https://api.izap.ai/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'business-id: <business-id>' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"email": "[email protected]",
"notes": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.izap.ai/api/v1/contacts"
payload = {
"name": "<string>",
"phone_number": "<string>",
"email": "[email protected]",
"notes": "<string>",
"tags": ["<string>"]
}
headers = {
"business-id": "<business-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'business-id': '<business-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
email: '[email protected]',
notes: '<string>',
tags: ['<string>']
})
};
fetch('https://api.izap.ai/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://api.izap.ai/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([
'name' => '<string>',
'phone_number' => '<string>',
'email' => '[email protected]',
'notes' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"business-id: <business-id>"
],
]);
$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.izap.ai/api/v1/contacts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("business-id", "<business-id>")
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.izap.ai/api/v1/contacts")
.header("business-id", "<business-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.izap.ai/api/v1/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["business-id"] = '<business-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ai_paused": true,
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_interaction_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"notes": "<string>",
"opted_out": true,
"phone_number": "<string>",
"tags": [
"<string>"
]
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>",
"code": "<string>"
}contacts
Create a contact
Creates a contact for the business in the business-id header. The phone number is fixed after creation; use the update operation for the name, email, tags and notes.
POST
/
api
/
v1
/
contacts
Create a contact
curl --request POST \
--url https://api.izap.ai/api/v1/contacts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'business-id: <business-id>' \
--data '
{
"name": "<string>",
"phone_number": "<string>",
"email": "[email protected]",
"notes": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.izap.ai/api/v1/contacts"
payload = {
"name": "<string>",
"phone_number": "<string>",
"email": "[email protected]",
"notes": "<string>",
"tags": ["<string>"]
}
headers = {
"business-id": "<business-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'business-id': '<business-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
phone_number: '<string>',
email: '[email protected]',
notes: '<string>',
tags: ['<string>']
})
};
fetch('https://api.izap.ai/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://api.izap.ai/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([
'name' => '<string>',
'phone_number' => '<string>',
'email' => '[email protected]',
'notes' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"business-id: <business-id>"
],
]);
$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.izap.ai/api/v1/contacts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("business-id", "<business-id>")
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.izap.ai/api/v1/contacts")
.header("business-id", "<business-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.izap.ai/api/v1/contacts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["business-id"] = '<business-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"email\": \"[email protected]\",\n \"notes\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ai_paused": true,
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_interaction_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"notes": "<string>",
"opted_out": true,
"phone_number": "<string>",
"tags": [
"<string>"
]
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"detail": "<string>",
"code": "<string>"
}Authorizations
Personal access token (izap_pat_…) sent as Authorization: Bearer ; dashboard session JWTs are also accepted.
Headers
UUID of the business the request is scoped to. Required on this route; the deprecated /businesses/{business_id}/... form takes it from the path instead.
Body
application/json
Response
Successful Response