Difference between revisions of "API:Contact:CustomFields:Update"

From docs
Jump to: navigation, search
 
Line 1: Line 1:
  
 
== [[API]] » Update Contact Custom Fields ==
 
== [[API]] » Update Contact Custom Fields ==
 
== Update Contact Custom Fields ==
 
  
 
=== Base URL ===
 
=== Base URL ===

Latest revision as of 11:00, 17 July 2026

API » Update Contact Custom Fields

Base URL

https://app.callproof.com

Endpoint

/api/contact/custom_fields/update/

Purpose

Updates custom field values for an existing contact in your CallProof company. Use this to set or change one or more custom fields, including file-based custom fields, without replacing the full contact profile.

HTTP Method

POST

Headers

Header Required Description
Content-Type Yes Must be application/json.

Security

  • Yes – Requires a valid API key and secret with permission to update contacts. Credentials are sent in the request body.

Parameters

Path Parameters

None.

Query Parameters

None.

Request Body

Parameter Type Required Description
api_key object Yes Authentication credentials object.
api_key.key string Yes Public API key assigned to your CallProof account.
api_key.secret string Yes Private API secret paired with the API key.
contact object Yes Contact identification payload.
contact.id integer Yes Unique identifier of the contact whose custom fields should be updated. Must belong to your company.
custom_fields array No List of custom field values to update. If omitted or empty, no standard custom field values are changed.
custom_fields[].id integer Yes* Custom field identifier.
custom_fields[].value string No New value for the custom field. If omitted, an empty value is applied.
files array No List of file-based custom field uploads.
files[].id integer Yes* Custom field identifier for the file field.
files[].value string Yes* File contents encoded as Base64.
files[].content_type string Yes* MIME type of the uploaded file (for example, application/pdf or image/png).
files[].name string Yes* Original file name to store with the upload.

\* Required for each entry that should be processed within custom_fields or files.

cURL Example

curl -X POST "https://app.callproof.com/api/contact/custom_fields/update/" \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": {
      "key": "YOUR_API_KEY",
      "secret": "YOUR_API_SECRET"
    },
    "contact": {
      "id": 789
    },
    "custom_fields": [
      {
        "id": 12,
        "value": "Manufacturing"
      }
    ]
  }'

Successful Response (200)

Indicates the contact’s custom fields were updated successfully. The response returns the full updated contact profile, including current custom field values.

Field Type Description
results object Updated contact details.
results.id integer Unique identifier for the contact.
results.company string Name of the contact company associated with the contact.
results.contact_phones array Phone numbers associated with the contact.
results.created_by string Display name of the user who created the contact.
results.created_by_id integer User ID of the person who created the contact.
results.created_by_email string Email address of the person who created the contact.
results.contact_type string Contact type name.
results.title string Contact title.
results.first_name string Contact first name.
results.last_name string Contact last name.
results.email string Contact email address.
results.address string Primary street address.
results.address2 string Secondary street address.
results.city string City.
results.state string State or province name.
results.zip string Postal/ZIP code.
results.country string Country name.
results.website string Website URL.
results.latitude string Geographic latitude.
results.longitude string Geographic longitude.
results.last_contacted string Date and time of last contact (YYYY-MM-DD HH:MM:SS), or empty if none.
results.default_phone object Default phone number details for the contact.
results.account string Account number or identifier.
results.invoice string Invoice-related value, if set.
results.unknown integer 1 if marked unknown; otherwise 0.
results.assigned integer 1 if the contact is assigned; otherwise 0.
results.do_not_sms integer 1 if SMS is disabled for the contact; otherwise 0.
results.updated string Date and time the contact was last updated (YYYY-MM-DD HH:MM:SS).
results.created string Date and time the contact was created (YYYY-MM-DD HH:MM:SS).
results.custom_fields array Visible custom field values for the contact after the update.
results.custom_fields[].id integer Custom field identifier.
results.custom_fields[].name string Custom field name.
results.custom_fields[].value string Custom field display value.
results.custom_fields[].value_id string Custom field option/value identifier, when applicable.
results.reps array Sales representatives assigned to the contact.
errors array Empty list when the request succeeds.
code integer HTTP-style status value; 200 on success.

Example response:

{
  "results": {
    "id": 789,
    "company": "Acme Corp",
    "contact_phones": [],
    "created_by": "Jane Smith",
    "created_by_id": 456,
    "created_by_email": "rep@example.com",
    "contact_type": "Prospect",
    "title": "Manager",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@acme.com",
    "address": "123 Main St",
    "address2": "",
    "city": "Austin",
    "state": "Texas",
    "zip": "78701",
    "country": "United States",
    "website": "https://acme.com",
    "latitude": "",
    "longitude": "",
    "last_contacted": "",
    "default_phone": {},
    "account": "ACC-100",
    "invoice": "",
    "unknown": 0,
    "assigned": 1,
    "do_not_sms": 0,
    "updated": "2024-06-15 14:30:00",
    "created": "2024-01-10 09:00:00",
    "custom_fields": [
      {
        "id": 12,
        "name": "Industry",
        "value": "Manufacturing",
        "value_id": "3"
      }
    ],
    "reps": []
  },
  "errors": [],
  "code": 200
}

Notes

  • This endpoint updates only custom field values for a contact. Standard contact profile fields such as name and address are not changed here.
  • The contact ID must belong to your company.
  • Each item in custom_fields must include a custom field id. Entries without an id are skipped.
  • If value is omitted for a custom field, an empty value is applied.
  • File-based custom fields must be sent in the files array, with Base64-encoded content plus content_type and name.
  • A file entry is processed only when id, value, content_type, and name are all present and valid.
  • After a successful update, the contact’s last-updated timestamp is refreshed and the full contact profile is returned.
  • Custom field identifiers must correspond to fields configured for contacts in your company.

Error Responses

Status Code Meaning
400 Bad Request – The contact ID is missing, invalid, or does not match a contact in your company.
401 Unauthorized – The API key and/or secret is missing, invalid, inactive, associated with a disabled account, or lacks permission to update contacts.
405 Method Not Allowed – A method other than POST was used.
500 Internal Server Error – An unexpected server problem occurred. Not specified in Swagger.

400 response body example:

{
  "results": [],
  "errors": ["Invalid 'id' field"],
  "code": 400
}

401 response body example:

{
  "results": [],
  "errors": ["Invalid API Key"],
  "code": 401
}

405 response body example:

{
  "results": [],
  "errors": ["Method not allowed"],
  "code": 405
}