Create a contact
curl --request POST \
--url https://api.cal.id/contacts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+14155550123",
"notes": "Prefers morning meetings."
}
'import requests
url = "https://api.cal.id/contacts/"
payload = {
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+14155550123",
"notes": "Prefers morning meetings."
}
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({
name: 'Jane Doe',
email: 'jane@example.com',
phone: '+14155550123',
notes: 'Prefers morning meetings.'
})
};
fetch('https://api.cal.id/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.cal.id/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' => 'Jane Doe',
'email' => 'jane@example.com',
'phone' => '+14155550123',
'notes' => 'Prefers morning meetings.'
]),
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.cal.id/contacts/"
payload := strings.NewReader("{\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\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://api.cal.id/contacts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.id/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 \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"metadata": {},
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Contacts
Create a contact
Create a contact for the current user
POST
/
contacts
/
Create a contact
curl --request POST \
--url https://api.cal.id/contacts/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+14155550123",
"notes": "Prefers morning meetings."
}
'import requests
url = "https://api.cal.id/contacts/"
payload = {
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+14155550123",
"notes": "Prefers morning meetings."
}
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({
name: 'Jane Doe',
email: 'jane@example.com',
phone: '+14155550123',
notes: 'Prefers morning meetings.'
})
};
fetch('https://api.cal.id/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.cal.id/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' => 'Jane Doe',
'email' => 'jane@example.com',
'phone' => '+14155550123',
'notes' => 'Prefers morning meetings.'
]),
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.cal.id/contacts/"
payload := strings.NewReader("{\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\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://api.cal.id/contacts/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cal.id/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 \"name\": \"Jane Doe\",\n \"email\": \"jane@example.com\",\n \"phone\": \"+14155550123\",\n \"notes\": \"Prefers morning meetings.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": 123,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"metadata": {},
"notes": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"pagination": {
"page": 123,
"limit": 123,
"total": 123,
"totalPages": 123
}
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}{
"success": false,
"message": "<string>",
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
Use the Authorization header with Bearer scheme.
Examples:
- API Key: Authorization: Bearer calid_xxxxx
Body
application/json
Contact full name.
Required string length:
1 - 255Example:
"Jane Doe"
Contact email address.
Maximum string length:
320Example:
"jane@example.com"
Contact phone number.
Maximum string length:
50Example:
"+14155550123"
Private contact notes.
Maximum string length:
5000Example:
"Prefers morning meetings."
Related topics
Work with contactsManaging Your Contacts in Cal IDCreate a Phone-only Event TypeDelete a contactGet a contactWas this page helpful?
⌘I