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 '{
  "type": "customer",
  "status": "<string>",
  "full_name": "<string>",
  "email": "[email protected]",
  "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>"
  },
  "company_id": "<string>"
}'
{
  "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"
    }
  }
}

Update Contact

This endpoint allows you to update an existing contact’s information.

Headers

ParameterTypeDescription
X-API-KEYstringFormation API Key (required)
Content-Typestringapplication/json

Path Parameters

ParameterTypeDescription
contact_idstringContact 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

FieldTypeDescription
typestringContact type: “customer” or “vendor”
full_namestringFull name of the contact
emailstringEmail address of the contact
company_idstringID of the company this contact belongs to

Optional Fields

FieldTypeDescription
statusstringContact status
descriptionstringDescription or notes about the contact
cc_emailsarrayArray of CC email addresses
bcc_emailsarrayArray of BCC email addresses
billingobjectBilling information for the contact

Billing Object Fields

FieldTypeDescription
emailstringBilling email address
phonestringPhone number
phone_codestringPhone country code
iso_codestringCountry ISO code
countrystringCountry name
address_1stringAddress line 1
address_2stringAddress line 2
postal_codestringPostal code
districtstringDistrict
statestringState
provincestringProvince
tax_idstringTax 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

ParameterTypeDescription
successbooleanIndicates if the operation was successful
messagestringAdditional information about the operation
dataobjectResponse data for successful requests
data.idstringUnique identifier for the contact
data.created_atintegerCreation timestamp
data.updated_atintegerLast update timestamp
data.typestringContact type (“customer” or “vendor”)
data.statusstringContact status
data.full_namestringFull name of the contact
data.emailstringEmail address
data.descriptionstringContact description
data.cc_emailsarrayCC email addresses
data.bcc_emailsarrayBCC email addresses
data.billingobjectBilling 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

X-API-Key
string
header
required

Formation API key for authentication.

Path Parameters

contact_id
string
required

Contact ID

Body

application/json

Response

200
application/json

Contact updated successfully

The response is of type object.