Update a third-party contact

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

ParameterLocationTypeRequiredDescription
third_party_codeURLtextYesCode of the third party the contact belongs to. Case-insensitive.
id_contactbodyintegerYesUnique id of the third-party contact.

Input parameters — Optional

ParameterTypeRequiredDescription
activebooleanNoContact 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_nametext (max. 50)NoContact name. Cannot be empty or null. Must be unique within the third party.
contact_emailtext (max. 200)NoContact email address. Must be unique within the company, ignoring case and spaces.
branch_codetextNoCode of the contact's branch. Must exist as a branch of the third party. Cannot be empty or null.
roletext (max. 100)NoContact's job title. Cannot be empty or null.
telephonetext (max. 50)NoContact phone number.
moviltext (max. 50)NoContact mobile number.
skypetext (max. 50)NoContact's Skype username.
linkedintext (max. 50)NoContact'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

POSTGETPUT
OperationCreates a contactRetrieves contactsPartially updates a contact
Contact identificationNot applicable (a new one is created)By third-party code (optional)By id_contact within the third party in the URL
Modifiable fieldsAll contact data on creationNot applicableOnly the fields sent in the body
Allows modifying activeNoNo (it only allows filtering and reading)Yes, it is the only one that allows it

Output parameters

ParameterTypeDescription
successbooleanResult of the operation.
messagetextOperation message.
totalintegerTotal number of records.
dataobjectUpdated contact, with the same fields returned by the contacts query (GET), including active.

Errors

CodeCause
400Body 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.
401Invalid or missing token.
404The third party, the contact (for example, a contact that belongs to another third party or company) or the branch does not exist.
409The 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).
500Unhandled 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

{
  "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)

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)

{
  "success": false,
  "message": "404",
  "data": "[{\"ERROR\": \"id_contact is not found for this third party\"}]",
  "total": 0
}

Response — contact with active dependencies (409)

{
  "success": false,
  "message": "409",
  "data": "[{\"ERROR\": \"ERROR_CONTACT_HAS_ACTIVE_DEPENDENCIES\"}]",
  "total": 0
}

Test It

Path Params
string
required
Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!