Update Contact
curl --request PATCH \
--url https://api.clemta.com/contacts/{contact_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"full_name": "<string>",
"email": "[email protected]",
"company_id": "<string>",
"status": "<string>",
"description": "<string>",
"cc_emails": [
"[email protected]"
],
"bcc_emails": [
"[email protected]"
],
"billing": {
"email": "<string>",
"phone": "<string>",
"phone_code": "<string>",
"iso_code": "<string>",
"country": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"postal_code": "<string>",
"district": "<string>",
"state": "<string>",
"province": "<string>",
"tax_id": "<string>"
}
}
'import requests
url = "https://api.clemta.com/contacts/{contact_id}"
payload = {
"full_name": "<string>",
"email": "[email protected]",
"company_id": "<string>",
"status": "<string>",
"description": "<string>",
"cc_emails": ["[email protected]"],
"bcc_emails": ["[email protected]"],
"billing": {
"email": "<string>",
"phone": "<string>",
"phone_code": "<string>",
"iso_code": "<string>",
"country": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"postal_code": "<string>",
"district": "<string>",
"state": "<string>",
"province": "<string>",
"tax_id": "<string>"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
full_name: '<string>',
email: '[email protected]',
company_id: '<string>',
status: '<string>',
description: '<string>',
cc_emails: ['[email protected]'],
bcc_emails: ['[email protected]'],
billing: {
email: '<string>',
phone: '<string>',
phone_code: '<string>',
iso_code: '<string>',
country: '<string>',
address_1: '<string>',
address_2: '<string>',
postal_code: '<string>',
district: '<string>',
state: '<string>',
province: '<string>',
tax_id: '<string>'
}
})
};
fetch('https://api.clemta.com/contacts/{contact_id}', 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.clemta.com/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'full_name' => '<string>',
'email' => '[email protected]',
'company_id' => '<string>',
'status' => '<string>',
'description' => '<string>',
'cc_emails' => [
'[email protected]'
],
'bcc_emails' => [
'[email protected]'
],
'billing' => [
'email' => '<string>',
'phone' => '<string>',
'phone_code' => '<string>',
'iso_code' => '<string>',
'country' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'postal_code' => '<string>',
'district' => '<string>',
'state' => '<string>',
'province' => '<string>',
'tax_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.clemta.com/contacts/{contact_id}"
payload := strings.NewReader("{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.patch("https://api.clemta.com/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clemta.com/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Contact updated successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": [
"[email protected]",
"[email protected]"
],
"bcc_emails": [
"[email protected]",
"[email protected]"
],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
}{
"success": false,
"message": "Invalid request data",
"data": null,
"error": {
"code": "INVALID_REQUEST",
"details": "Field 'name' is required"
}
}{
"success": false,
"message": "API key is required",
"data": null,
"error": {
"code": "API_KEY_REQUIRED",
"details": ""
}
}{
"success": false,
"message": "Contact not found",
"data": null,
"error": {
"code": "NOT_FOUND",
"details": ""
}
}{
"success": false,
"message": "Internal server error",
"data": null,
"error": {
"code": "INTERNAL_ERROR",
"details": "An unexpected error occurred."
}
}Contacts API
Update Contact
Update an existing contact
PATCH
/
contacts
/
{contact_id}
Update Contact
curl --request PATCH \
--url https://api.clemta.com/contacts/{contact_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"full_name": "<string>",
"email": "[email protected]",
"company_id": "<string>",
"status": "<string>",
"description": "<string>",
"cc_emails": [
"[email protected]"
],
"bcc_emails": [
"[email protected]"
],
"billing": {
"email": "<string>",
"phone": "<string>",
"phone_code": "<string>",
"iso_code": "<string>",
"country": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"postal_code": "<string>",
"district": "<string>",
"state": "<string>",
"province": "<string>",
"tax_id": "<string>"
}
}
'import requests
url = "https://api.clemta.com/contacts/{contact_id}"
payload = {
"full_name": "<string>",
"email": "[email protected]",
"company_id": "<string>",
"status": "<string>",
"description": "<string>",
"cc_emails": ["[email protected]"],
"bcc_emails": ["[email protected]"],
"billing": {
"email": "<string>",
"phone": "<string>",
"phone_code": "<string>",
"iso_code": "<string>",
"country": "<string>",
"address_1": "<string>",
"address_2": "<string>",
"postal_code": "<string>",
"district": "<string>",
"state": "<string>",
"province": "<string>",
"tax_id": "<string>"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
full_name: '<string>',
email: '[email protected]',
company_id: '<string>',
status: '<string>',
description: '<string>',
cc_emails: ['[email protected]'],
bcc_emails: ['[email protected]'],
billing: {
email: '<string>',
phone: '<string>',
phone_code: '<string>',
iso_code: '<string>',
country: '<string>',
address_1: '<string>',
address_2: '<string>',
postal_code: '<string>',
district: '<string>',
state: '<string>',
province: '<string>',
tax_id: '<string>'
}
})
};
fetch('https://api.clemta.com/contacts/{contact_id}', 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.clemta.com/contacts/{contact_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'full_name' => '<string>',
'email' => '[email protected]',
'company_id' => '<string>',
'status' => '<string>',
'description' => '<string>',
'cc_emails' => [
'[email protected]'
],
'bcc_emails' => [
'[email protected]'
],
'billing' => [
'email' => '<string>',
'phone' => '<string>',
'phone_code' => '<string>',
'iso_code' => '<string>',
'country' => '<string>',
'address_1' => '<string>',
'address_2' => '<string>',
'postal_code' => '<string>',
'district' => '<string>',
'state' => '<string>',
'province' => '<string>',
'tax_id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.clemta.com/contacts/{contact_id}"
payload := strings.NewReader("{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.patch("https://api.clemta.com/contacts/{contact_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clemta.com/contacts/{contact_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"full_name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"company_id\": \"<string>\",\n \"status\": \"<string>\",\n \"description\": \"<string>\",\n \"cc_emails\": [\n \"[email protected]\"\n ],\n \"bcc_emails\": [\n \"[email protected]\"\n ],\n \"billing\": {\n \"email\": \"<string>\",\n \"phone\": \"<string>\",\n \"phone_code\": \"<string>\",\n \"iso_code\": \"<string>\",\n \"country\": \"<string>\",\n \"address_1\": \"<string>\",\n \"address_2\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"district\": \"<string>\",\n \"state\": \"<string>\",\n \"province\": \"<string>\",\n \"tax_id\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Contact updated successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": [
"[email protected]",
"[email protected]"
],
"bcc_emails": [
"[email protected]",
"[email protected]"
],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
}{
"success": false,
"message": "Invalid request data",
"data": null,
"error": {
"code": "INVALID_REQUEST",
"details": "Field 'name' is required"
}
}{
"success": false,
"message": "API key is required",
"data": null,
"error": {
"code": "API_KEY_REQUIRED",
"details": ""
}
}{
"success": false,
"message": "Contact not found",
"data": null,
"error": {
"code": "NOT_FOUND",
"details": ""
}
}{
"success": false,
"message": "Internal server error",
"data": null,
"error": {
"code": "INTERNAL_ERROR",
"details": "An unexpected error occurred."
}
}Update Contact
This endpoint allows you to update an existing contact’s information.Headers
| Parameter | Type | Description |
|---|---|---|
| X-API-KEY | string | Formation API Key (required) |
| Content-Type | string | application/json |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| contact_id | string | Contact ID (required) |
Request Body
{
"type": "customer",
"status": "active",
"full_name": "John Doe Updated",
"email": "[email protected]",
"description": "Updated customer contact",
"cc_emails": ["[email protected]", "[email protected]"],
"bcc_emails": ["[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "+1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "456 Updated St",
"address_2": "Suite 200",
"postal_code": "54321",
"district": "Uptown",
"state": "NY",
"province": "New York",
"tax_id": "98-7654321"
},
"company_id": "64b8f1a2e4b0c8d9f0123456"
}
Required Fields
| Field | Type | Description |
|---|---|---|
| type | string | Contact type: “customer” or “vendor” |
| full_name | string | Full name of the contact |
| string | Email address of the contact | |
| company_id | string | ID of the company this contact belongs to |
Optional Fields
| Field | Type | Description |
|---|---|---|
| status | string | Contact status |
| description | string | Description or notes about the contact |
| cc_emails | array | Array of CC email addresses |
| bcc_emails | array | Array of BCC email addresses |
| billing | object | Billing information for the contact |
Billing Object Fields
| Field | Type | Description |
|---|---|---|
| string | Billing email address | |
| phone | string | Phone number |
| phone_code | string | Phone country code |
| iso_code | string | Country ISO code |
| country | string | Country name |
| address_1 | string | Address line 1 |
| address_2 | string | Address line 2 |
| postal_code | string | Postal code |
| district | string | District |
| state | string | State |
| province | string | Province |
| tax_id | string | Tax identification number |
Response
{
"success": true,
"message": "Contact updated successfully",
"data": {
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1686787200,
"updated_at": 1686787300,
"type": "customer",
"status": "active",
"full_name": "John Doe Updated",
"email": "[email protected]",
"description": "Updated customer contact",
"cc_emails": ["[email protected]", "[email protected]"],
"bcc_emails": ["[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "+1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "456 Updated St",
"address_2": "Suite 200",
"postal_code": "54321",
"district": "Uptown",
"state": "NY",
"province": "New York",
"tax_id": "98-7654321"
}
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | boolean | Indicates if the operation was successful |
| message | string | Additional information about the operation |
| data | object | Response data for successful requests |
| data.id | string | Unique identifier for the contact |
| data.created_at | integer | Creation timestamp |
| data.updated_at | integer | Last update timestamp |
| data.type | string | Contact type (“customer” or “vendor”) |
| data.status | string | Contact status |
| data.full_name | string | Full name of the contact |
| data.email | string | Email address |
| data.description | string | Contact description |
| data.cc_emails | array | CC email addresses |
| data.bcc_emails | array | BCC email addresses |
| data.billing | object | Billing information |
Error Responses
Invalid Request (400)
{
"success": false,
"message": "Invalid request data",
"error": {
"code": "VALIDATION_FAILED",
"details": "Field 'email' is required"
}
}
Unauthorized (401)
{
"success": false,
"message": "API key is required",
"error": {
"code": "API_KEY_REQUIRED"
}
}
Contact Not Found (404)
{
"success": false,
"message": "Contact not found",
"error": {
"code": "CONTACT_NOT_FOUND"
}
}
Internal Server Error (500)
{
"success": false,
"message": "Internal server error",
"error": {
"code": "INTERNAL_ERROR"
}
}
Authorizations
Formation API key for authentication.
Path Parameters
Contact ID
Body
application/json
Contact type
Available options:
customer, vendor Full name of the contact
Email address
Company ID
Contact status
Contact description
CC email addresses
BCC email addresses
Show child attributes
Show child attributes
Response
Contact updated successfully
Example:
true
Example:
"Contact updated successfully"
Show child attributes
Show child attributes
Example:
{
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": ["[email protected]", "[email protected]"],
"bcc_emails": ["[email protected]", "[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}
⌘I