Skip to main content

Update Contact

Update an existing contact.

HTTP Request

PATCH/api/contacts/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with ContactPermission or Admin
  • Permission Code: 4003
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the contact to update

Request Body

FieldTypeRequiredDescription
subjectStringNoThe subject of the contact.
messageStringNoThe message content of the contact.
first_nameStringNoThe first name of the contact.
last_nameStringNoThe last name of the contact.
emailStringNoThe email address of the contact.
mobile_numberStringNoMobile number associated with the contact.

Example Requests

1import requests
2
3api = requests.Session()
4api.headers.update({'Authorization': 'Token <your_api_key>'})
5response = api.patch('http://www.example.com/api/contacts/<ID>', json={
6  'subject': 'New Subject',
7  'message': 'Updated message content.',
8  'first_name': 'John',
9  'last_name': 'Doe',
10  'email': 'john.doe@example.com',
11  'mobile_number': '123-456-7890'
12})
13print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the contact
subjectStringThe subject of the contact
messageStringThe message content of the contact
first_nameStringThe first name of the contact
last_nameStringThe last name of the contact
emailStringThe email address of the contact
mobile_numberStringMobile number associated with the contact
viewedBooleanWhether the contact has been viewed
viewed_atString (ISO 8601)Timestamp when the contact was viewed
created_atString (ISO 8601)Timestamp when the contact was created
updated_atString (ISO 8601)Timestamp when the contact was last updated

Example Response

{
"id": 17,
"first_name": "فرشید",
"last_name": "سلطانی",
"email": "Osbaldo_Daniel@yahoo.com",
"mobile_number": "09228504384",
"subject": "Regional",
"message": "nobis",
"viewed": true,
"viewed_at": "2025-12-28T13:48:53.666969Z",
"created_at": "2025-12-28T13:47:13.666977Z",
"updated_at": "2025-12-28T13:50:19.076017Z"
}