ChatofyDevelopers
REST APIMCP Server (AI)New
API KeysWebhooks
Chatofy API
/
Getting Started
API Resources
API v1.0 Live
Developer APIContactsUpsert Contact by Phone

Upsert Contact by Phone

Upserts a contact keyed on canonical normalized phone. Creates if missing; merges fields if exists based on prefer_incoming merge policy.

POST/api/v1/contacts/upsert

Request Body Schema

application/json
phone_numberstringrequired

Canonical or international phone digits

Example:+919876543210
first_namestringoptional

Contact first name

Example:Priya
last_namestringoptional

Contact last name

Example:Sharma
emailstringoptional

Validated lowercase email

Example:[email protected]
addressstringoptional

Street address or office location

Example:Flat 4B, Raheja Towers
companystringoptional

Company name

Example:Innovate Labs
prefer_incomingbooleanoptional

When true, non-empty incoming values overwrite existing values (default: false)

Example:true
attributesobjectoptional

Custom key-value properties to merge

Example:{"plan": "pro"}

Response Payload

200 OKapplication/json
statusstring

"1" = Success, "0" = Failure.

messageobject

The response data payload.

Code Snippets & Examples

1curl -X POST "https://app.chatofy.in/api/v1/contacts/upsert" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"phone_number":"+919876543210","first_name":"Priya","company":"Innovate Labs","prefer_incoming":true}'

Was this endpoint guide helpful?

Previous Endpoint
Update Contact
Next Endpoint
Bulk Create Contacts
© 2026 Chatofy Cloud Platform. All rights reserved.
1curl -X POST "https://app.chatofy.in/api/v1/contacts/upsert" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"phone_number":"+919876543210","first_name":"Priya","company":"Innovate Labs","prefer_incoming":true}'
200 OKapplication/json
1{
2 "success": true,
3 "data": {
4 "action": "updated",
5 "contact": {
6 "id": "c1111111-2222-3333-4444-555555555555",
7 "phone_number": "919876543210",
8 "display_name": "Priya Sharma",
9 "first_name": "Priya",
10 "last_name": "Sharma",
11 "email": "[email protected]",
12 "address": "Flat 4B, Raheja Towers",
13 "company": "Innovate Labs",
14 "updated_at": "2026-10-26T22:05:00+05:30"
15 }
16 },
17 "message": "Contact updated successfully via upsert"
18}