Difference between revisions of "Update the Contact"

From docs
Jump to: navigation, search
(Created page with "== Update Contact == === Base URL === https://apimobile.callproof.com === Endpoint === /api/contacts/{id} === Purpose === Updates an existing contact’s account and profil...")
 
(Successful Response (200))
Line 77: Line 77:
 
| custom_fields || string || No || JSON string containing custom field values to update
 
| custom_fields || string || No || JSON string containing custom field values to update
 
|}
 
|}
 +
 +
=== cURL Example for Android ===
 +
<pre>
 +
curl --location --request PUT 'https://apimobile.callproof.com/api/contacts/{id}' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'company_name=YOUR_COMPANY_NAME' \
 +
--form 'account_type_id=1'
 +
</pre>
 +
=== cURL Example for iOS ===
 +
<pre>
 +
curl --location --request PUT 'https://apimobile.callproof.com/api/contacts/{id}' \
 +
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 +
--form 'company_name=YOUR_COMPANY_NAME' \
 +
--form 'account_type_id=1'
 +
</pre>
  
 
=== Successful Response (200) ===
 
=== Successful Response (200) ===

Revision as of 12:52, 16 July 2026

Update Contact

Base URL

https://apimobile.callproof.com

Endpoint

/api/contacts/{id}

Purpose

Updates an existing contact’s account and profile information, including company details, address, phone, email, website, and optional custom fields. When the address changes, location coordinates may be reset so the contact can be re-mapped. A successful update also records a contact update activity for the account.

HTTP Method

PUT

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

Parameter Type Required Description
id integer Yes Unique identifier of the contact to update

Query Parameters

None.

Request Body

Parameter Type Required Description
company_name string Yes Company / account name
account_type_id integer Yes Contact / account type identifier
account_number number / string No Account number
parent_company string No Parent company / title
address string No Primary street address (maximum 80 characters)
address2 string No Secondary street address (maximum 80 characters)
city string No City
state_id integer No State identifier
zipcode string No Postal / ZIP code
country_id integer No Country identifier
company_email string No Company email address
phone string No Primary phone number (7–15 digits). When provided, phone type becomes required
extension string No Phone extension
phone_type_id integer No Phone type identifier. Required when phone is provided
country_code string No Country calling code for the phone number
website string No Website URL
notes string No Notes associated with the contact update
contact_company_id integer No Contact company identifier
custom_fields string No JSON string containing custom field values to update

cURL Example for Android

curl --location --request PUT 'https://apimobile.callproof.com/api/contacts/{id}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'company_name=YOUR_COMPANY_NAME' \
--form 'account_type_id=1'

cURL Example for iOS

curl --location --request PUT 'https://apimobile.callproof.com/api/contacts/{id}' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'company_name=YOUR_COMPANY_NAME' \
--form 'account_type_id=1'

Successful Response (200)

Indicates that the contact was updated successfully.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
message string Confirmation message (for example, "The account info has been updated.")
uri string Requested resource URI

Error Responses

Status Code Meaning
200 Validation failure – request body failed validation (returned with an error payload and clientStatusCode 401)
400 Bad Request – the contact could not be updated (for example, invalid account type or update processing error)
401 Unauthorized – missing, invalid, or expired Bearer token
  • 200 (validation failure) – Required fields are missing or invalid (for example, missing company name, missing account type, invalid phone format, or missing phone type when a phone number is provided).
  • 400 – The contact update failed, such as when the account type is not found or an error occurs while saving contact or phone details.
  • 401 – Authentication failed or the access token is missing/expired.