Contacts
Relate two contacts
Ties a contact to another with a role (the contact person of a company, the director of a production).
contacts:writeResult
generated from the schema
A company relating a person must give the role (400 otherwise); a person relating a company must not (the role lives on the inverse relationship); any other pair is free and the role is recorded. 409 if the pair was already related. Returns the relationship as recorded. Returns the full contact, with relatedContacts as they now stand, the same projection as its GET.
Arguments
Identifier of the main contact.
Limits: min length 1
Role of the relationship, e.g. "Director", "Contact person". Required when a company relates a person; not allowed when a person relates a company.
Limits: max length 200
Idempotency key chosen by the client (a UUID is recommended). Repeating the same key with the same arguments within 24 h returns the stored response without executing again; with different arguments it responds 422. It is the safe way to retry after a network failure.
Limits: min length 1, max length 255
Optimistic locking: the meta.etag you got from the detail read of this resource (or "*"). If the resource changed since, the call fails with 412 precondition_failed before writing anything; read it again and retry. Omit it to write unconditionally.
Limits: min length 1
Result
On success the result carries structuredContent with data and meta. These are the attributes of data.
Show the attributes of data
Unique identifier of the contact.
Contact name (person or company).
Contact type: person (individual) or company (business).
Available options: person, company
Contact role: client, provider, lead, debtor, creditor, student, teacher or unspecified.
Available options: client, provider, lead, debtor, creditor, student, teacher, unspecified
Contact status: active (operational), inactive (deactivated) or archived (closed, kept for historical records).
Available options: active, inactive, archived
NIF/CIF or tax identification number; null if not recorded.
Trade name; null if it matches the name or is not recorded.
Job title or position of the contact person; null if not recorded.
Contact number assigned by the account (internal reference); null if not recorded.
List of email addresses of the contact.
Show child attributesHide child attributes
Internal identifier of the email within the contact.
Descriptive label of the email; null if it has none.
Email address.
Whether this is the primary email of the contact.
Dedicated billing email; null means the primary email is used.
List of phone numbers of the contact.
Show child attributesHide child attributes
Internal identifier of the phone number within the contact.
Descriptive label of the phone number; null if it has none.
Phone number.
International country calling code (e.g. "+34"); null if not recorded.
Whether this is the primary phone number of the contact.
List of websites of the contact.
Show child attributesHide child attributes
Internal identifier of the website within the contact.
Descriptive label of the website; null if it has none.
Website URL.
List of addresses of the contact.
Show child attributesHide child attributes
Internal identifier of the address within the contact.
Descriptive label of the address; null if it has none.
First line of the address; null if not recorded.
Second line of the address; null if not recorded.
City; null if not recorded.
Province or region; null if not recorded.
Postcode; null if not recorded.
Country; null if not recorded.
Whether this is the main address of the contact.
Folder or organizational grouping; null if the contact is not classified.
General discount percentage of the contact (0-100); null if no discount is configured.
Preferred language of the contact; null if not recorded.
Default currency of the contact as an ISO 4217 code; null if not recorded.
Preferred payment method of the contact; null if not configured.
Show child attributesHide child attributes
Payment method type: bank_transfer, card, cash, sepa_direct_debit or other.
Available options: bank_transfer, card, cash, other, sepa_direct_debit
Free-text detail when the type is "other" (for example a method recorded before it was configured); null otherwise.
Days of the month on which the contact makes payments; null if not configured.
Default due days for the invoices of the contact; null if not configured.
Whether the contact is subscribed to marketing communications.
Whether the contact has access to the app.
Custom field values by custom field identifier; the definitions are in /api.
Creation date in ISO 8601 with offset.
Last update date in ISO 8601 with offset.
An error is a result with isError: true and the problem in content[0].; there is no structuredContent. See Errors.
The same operation by REST
This tool runs POST /api/v1/contacts/{contactId}/related-contacts.
Related pages
Link to this section: Related pagesContacts
Relate two contacts
Ties a contact to another with a role (the contact person of a company, the director of a production).
Guides
Safe writes
An assistant that can write can also write the wrong thing. Decide which tools need a person, retry without duplicating, and know what a write sets in motion.
Guides
Errors
A tool error is a result with
isError: trueand the problem in the first text block. Branch on itscode.
Was this page helpful?