curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X PATCH https://api.razorpay.com/v1/contacts/cont_00000000000001 \
-H "Content-Type: application/json" \
-d '{
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9000090000",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
}
}'
{
"id": "cont_00000000000001",
"entity": "contact",
"name": "Gaurav Kumar",
"contact": "9000090000",
"email": "gaurav.kumar@example.com",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"batch_id": null,
"active": true,
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at": 1545320320
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Invalid type: self",
"source": "business",
"step": null,
"reason": "input_validation_failed",
"metadata": {},
"field": "type"
}
}
Contacts
Update a Contact
Update a Contact using APIs.
PATCH
/
v1
/
contacts
/
:id
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X PATCH https://api.razorpay.com/v1/contacts/cont_00000000000001 \
-H "Content-Type: application/json" \
-d '{
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9000090000",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
}
}'
{
"id": "cont_00000000000001",
"entity": "contact",
"name": "Gaurav Kumar",
"contact": "9000090000",
"email": "gaurav.kumar@example.com",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"batch_id": null,
"active": true,
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at": 1545320320
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Invalid type: self",
"source": "business",
"step": null,
"reason": "input_validation_failed",
"metadata": {},
"field": "type"
}
}
Available in🇮🇳 India🇲🇾 Malaysia🇸🇬 Singapore🇺🇸 United States
Use this endpoint to update the details for an existing contact. Send only those parameters that you want to change in the request body.
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X PATCH https://api.razorpay.com/v1/contacts/cont_00000000000001 \
-H "Content-Type: application/json" \
-d '{
"name": "Gaurav Kumar",
"email": "gaurav.kumar@example.com",
"contact": "9000090000",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
}
}'
{
"id": "cont_00000000000001",
"entity": "contact",
"name": "Gaurav Kumar",
"contact": "9000090000",
"email": "gaurav.kumar@example.com",
"type": "self",
"reference_id": "Acme Contact ID 12345",
"batch_id": null,
"active": true,
"notes": {
"notes_key_1":"Tea, Earl Grey, Hot",
"notes_key_2":"Tea, Earl Grey… decaf."
},
"created_at": 1545320320
}
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "Invalid type: self",
"source": "business",
"step": null,
"reason": "input_validation_failed",
"metadata": {},
"field": "type"
}
}
Path Parameters
string
required
The unique identifier linked to the contact. For example,
cont_00000000000001.Request Parameters
string
The contact’s name. This field is case-sensitive. Minimum 3 characters. Maximum 50 characters. Supported characters:
a-z, A-Z, 0-9, space, ’ , - , _ , / , ( , ) and , .. For example, Gaurav Kumar.string
The contact’s email address. For example,
gaurav.kumar@example.com.string
The contact’s phone number. For example,
9000090000.string
Maximum 40 characters. Classification for the contact being created. For example,
employee. The following classifications are available by default:vendorcustomeremployeeself
string
Maximum 40 characters. A user-generated reference given to the contact. For example,
Acme Contact ID 12345.object
Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.Response Parameters
string
The unique identifier linked to the contact. For example,
cont_00000000000001.string
The entity being created. Here, it is
contact.string
The contact’s name. For example,
Gaurav Kumar.string
The contact’s phone number. For example,
9000090000.string
The contact’s email address. For example,
gaurav.kumar@example.com.string
A classification for the contact being created. For example,
employee.string
A user-entered reference for the contact. For example,
Acme Contact ID 12345.string
This value is returned if the contact was created as part of a bulk upload. For example,
batch_00000000000001.boolean
Possible values:
true(default) : activefalse: inactive
object
Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example,
"note_key": "Beam me up Scotty”.integer
Timestamp, in Unix, when the contact was created. For example,
1545320320.Errors
The `name` field is required.
The `name` field is required.
Code:
4xxThe name field is missing in the request body.Solution: Enter the details in the recommended format as per the request body.The `name` field is invalid.
The `name` field is invalid.
Code:
4xxThere are special characters used in the name field.Solution: Enter details as per the format recommended for Create a Contact request for name field.Invalid type: `contact_typeA`
Invalid type: `contact_typeA`
Code:
4xx- There are special characters in the
typefield. - Casing does not match as per the
type.typeis case-sensitive. - Contact type sent in the request does not match the types present in the Dashboard.
Was this page helpful?