put
https://app.fracttal.com/api/third_parties_contacts//
Partially updates an existing contact of a third party, including its status (enabled or disabled). Only the fields sent in the body are modified.
General use — no specific add-on.
PUT https://app.fracttal.com/api/third_parties_contacts/{third_party_code}/Input parameters — Required
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
third_party_code | URL | text | Yes | Code of the third party the contact belongs to. Case-insensitive. |
id_contact | body | integer | Yes | Unique id of the third-party contact. |
Input parameters — Optional
| Parameter | Type | Required | Description |
|---|---|---|---|
active | boolean | No | Contact status: true enables it and false disables it. Only accepted if the company has the enabled-contacts option turned on. If null is sent, it is ignored. |
contact_name | text (max. 50) | No | Contact name. Cannot be empty or null. Must be unique within the third party. |
contact_email | text (max. 200) | No | Contact email address. Must be unique within the company, ignoring case and spaces. |
branch_code | text | No | Code of the contact's branch. Must exist as a branch of the third party. Cannot be empty or null. |
role | text (max. 100) | No | Contact's job title. Cannot be empty or null. |
telephone | text (max. 50) | No | Contact phone number. |
movil | text (max. 50) | No | Contact mobile number. |
skype | text (max. 50) | No | Contact's Skype username. |
linkedin | text (max. 50) | No | Contact's LinkedIn URL. |
Update rules
- This is a partial update: a field not sent in the body is not modified.
- The contact is looked up within the third party indicated in the URL.
- A body with no updatable field responds with error
400. - It is not possible to change the third-party code or move the contact to another third party.
- All validations are performed before saving: if the request is rejected, the contact is left without partial changes.
- When a contact is disabled (
active: false), the last collaborator associated with that contact becomes inactive. - A contact that is responsible for, or part of the condition of, an active automation rule cannot be disabled; the request responds with error
409.
Differences between POST, GET and PUT for contacts
POST | GET | PUT | |
|---|---|---|---|
| Operation | Creates a contact | Retrieves contacts | Partially updates a contact |
| Contact identification | Not applicable (a new one is created) | By third-party code (optional) | By id_contact within the third party in the URL |
| Modifiable fields | All contact data on creation | Not applicable | Only the fields sent in the body |
Allows modifying active | No | No (it only allows filtering and reading) | Yes, it is the only one that allows it |
Output parameters
| Parameter | Type | Description |
|---|---|---|
success | boolean | Result of the operation. |
message | text | Operation message. |
total | integer | Total number of records. |
data | object | Updated contact, with the same fields returned by the contacts query (GET), including active. |
Errors
| Code | Cause |
|---|---|
400 | Body validation error: contact_name or role empty or null; branch_code empty; a value exceeds the maximum length of the field (the message indicates which one); the body includes no updatable field; id_contact missing, non-numeric or decimal; active is neither true nor false, or is sent in a company that does not have the enabled-contacts option turned on. |
401 | Invalid or missing token. |
404 | The third party, the contact (for example, a contact that belongs to another third party or company) or the branch does not exist. |
409 | The contact's email address or name already exists; or an attempt is made to disable a contact with active dependencies (ERROR_CONTACT_HAS_ACTIVE_DEPENDENCIES). |
500 | Unhandled error. |
Example
Request
PUT https://app.fracttal.com/api/third_parties_contacts/PROV-01/Request body
{
"id_contact": 100,
"contact_email": "[email protected]",
"telephone": "+57 300 123 4567",
"active": false
}Response 200
200{
"success": true,
"message": "200",
"data": {
"id": 100,
"id_company": 1001,
"id_third_party": 25,
"third_parties_code": "PROV-01",
"third_parties_name": "Proveedor Ejemplo S.A.",
"contact_name": "Ana Pérez",
"contact_email": "[email protected]",
"branch_name": "Sede principal",
"branch_code": "SUC-01",
"role": "Jefe de compras",
"telephone": "+57 300 123 4567",
"movil": "+57 300 765 4321",
"skype": "ana.perez",
"linkedin": "https://www.linkedin.com/in/ana-perez",
"active": false
},
"total": 1
}Response — body with no updatable fields (400)
400)Request body:
{
"id_contact": 100
}Response:
{
"success": false,
"message": "400",
"data": "[{\"ERROR\": \"At least one field to update is required\"}]",
"total": 0
}Response — contact of another third party (404)
404){
"success": false,
"message": "404",
"data": "[{\"ERROR\": \"id_contact is not found for this third party\"}]",
"total": 0
}Response — contact with active dependencies (409)
409){
"success": false,
"message": "409",
"data": "[{\"ERROR\": \"ERROR_CONTACT_HAS_ACTIVE_DEPENDENCIES\"}]",
"total": 0
}Test It
