Skip to main content

Phonebook Number Update

This API allows you to update an existing phonebook contact by its ID. You can modify the contact's name, number, email, and additional options.

📍 Endpoint​

PUT {base_url}/api/phonebooks/numbers/update-new/{contact_id}

🧾 Headers​

KeyValue
AuthorizationYOUR_TOKEN_HERE
Content-Typeapplication/json

📤 Request Body​

{
"pre": "Mr.",
"name": "name",
"number": "+989121236547",
"options": {
"124": "2025-05-20"
},
"phonebook_id": "12345"
}

📝 Parameters​

ParameterTypeRequiredDescription
numberstringYesThe phone number in E.164 format.
prestringNoThe prefix for the name (e.g., Mr., Ms.).
namestringNoThe name of the contact.
emailstringNoThe email address of the contact.
optionsobjectNoAdditional options as key-value pairs.
phonebook_idstringYesThe ID of the phonebook to which the contact belongs.

✅ Success Response​

{
"data": null,
"meta": {
"status": true,
"message": "انجام شد",
"message_parameters": [],
"message_code": "200-1"
}
}

❌ Error Response — Invalid or Expired Token (401)​

{
"data": null,
"meta": {
"status": false,
"message": "اطلاعات وارد شده صحیح نمی باشد",
"message_parameters": [],
"message_code": "400-1",
"errors": {}
}
}

🧪 Example Request​

curl --location --globoff --request PUT '{base_url}/api/phonebooks/numbers/update-new/234235' \
--header 'Authorization: Your Apikey/Token' \
--header 'Content-Type: application/json' \
--data '{
"pre": "Mr.",
"name": "name",
"number": "+989121236547",
"options": {
"124": "2025-05-20"
},
"phonebook_id": "12345"
}'