Skip to content

Update Contacts API

This API allows you to update contact details in your Cellcast account. Refer to Get Available Contact Fields API for your request body. Adding a custom field outside the Available Contact Fields will automatically create a new Dynamic Field. This allows you to extend contact details with fields tailored to your requirements.

Parameters for Update Contact API

Headers Parameters

ParametersDescription
AuthorizationPlease add provided Bearer token - linked to your Cellcast account. Check here
Content-Typeapplication/json

Request Query Parameters

NameExampleDescription
contactID674d9650b000000000000000Required. The ID to a specific contact in your Cellcast account. This ID is required when retrieving or updating contact details using the API. Refer to Contact ID Information

Request Body Parameters

NameExampleDescription
Number+61400000000StaticFields - The phone number of the contact
First NameJohnStaticFields - The first name of the contact
Last NameDoeStaticFields - The last name of the contact
Email[email protected]StaticFields - The email of the contact
Birthday1990-05-14StaticFields - The birth date of the contact
Address123 Main St, Sydney, NSWDynamicFields - The address of the contact
Postal Code2000DynamicFields - The postal code of the contact
GendermaleDynamicFields - The gender of the contact

Code Samples

Post https://api.cellcast.com/api/v2/contact/:contactId

bash
curl --location --request PUT 'https://api.cellcast.com/api/v2/contact/:contactId' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{API_KEY}}' \ 
--data-raw '{
    "First Name": "John",
    "Last Name": "Doe",
    "Email": "[email protected]",
    "Address": "123 Main St, Sydney, NSW",
    "Number": "+61400000000"

}'
js
const axios = require('axios');

const updateContact = async () => {
    const contactId = 'your-contact-id';
    const apiKey = 'your-api-key';
    const url = `https://api.cellcast.com/api/v2/contact/${contactId}`;

    const data = {
        "First Name": "John",
        "Last Name": "Doe",
        "Email": "[email protected]",
        "Address": "123 Main St, Sydney, NSW",
        "Number": "+61400000000",
    };

    try {
        const response = await axios.put(url, data, {
            headers: {
                'Content-Type': 'application/json',
                'Authorization': `Bearer ${apiKey}`,
            },
        });

        console.log('Response:', response.data);
    } catch (error) {
        console.error('Error:', error.response ? error.response.data : error.message);
    }
};

updateContact();

Replace with the actual API key that you own.

Response

200 Success

json
{
    "message": "success update contact"
}

404 Not Found

json
{
    "code": 404,
    "message": "contact with id 674d9650b000000000000000 is not exist",
}