Contacts

Edit an anagrafica

Changes fields on an existing anagrafica. Only the fields you pass are touched, and null CLEARS one — so omitting a field is not the same as emptying it. roles and tags are REPLACED whole, never merged: read the record first (anagrafiche_get_party) and pass everything it should end up with — a customer that also became a supplier is ["cliente", "fornitore"], not ["fornitore"]. custom is merged key by key, like the record’s own fields. A role outside the caller’s own role list is refused. It cannot move an address (anagrafiche_set_address) and cannot delete the record (anagrafiche_delete_party).

patch/api/v1/rest/anagrafiche/parties/{id}

Request

  • Base URL: https://api.custodo.ai
  • URL: https://api.custodo.ai/api/v1/rest/anagrafiche/parties/{id}
  • Auth: HTTP bearer

Path parameters

idstring uuid required

The anagrafica’s id, from anagrafiche_search_parties or anagrafiche_get_party.

Headers

X-Tenant-Idstring uuid

The organisation to act in. An API key is bound to exactly one, so this is optional for a key and must match the one it was minted for.

Request body

kind'company' | 'person'

company for an organisation, person for an individual or a ditta individuale.

namestring

What people call them — «Rossi». This is the name every list shows.

rolesstring[]

What the anagrafica IS to the organisation — a SET, because a supplier that is also a customer holds both. Built-in keys: cliente, potenziale_cliente, ex_cliente, fornitore, agente, dipendente, collaboratore, consulente; the organisation’s own come from anagrafiche_list_roles. At most 20. Each member may be limited to some roles by an administrator; a set none of whose roles the caller may write (access.write on anagrafiche_list_roles) is refused.

lifecycle'lead' | 'prospect' | 'customer' | 'former'

DEPRECATED — send roles instead. The CRM’s old «Relazione», still accepted from callers written before it became roles: lead and prospect mean the role potenziale_cliente, customer means cliente, former means ex_cliente. Ignored whenever roles is also given.

legal_namestring nullable

The ragione sociale an invoice must carry — «Rossi S.r.l. Unipersonale» — when it differs from name.

first_namestring nullable

Only on a person.

last_namestring nullable

Only on a person.

job_titlestring nullable

Their job — «Amministratore delegato». Only on a person.

parent_idstring uuid nullable

The company this person works for, or the holding above this company. Another anagrafica’s id, from anagrafiche_search_parties or anagrafiche_create_party. A party can never be its own ancestor.

vat_numberstring nullable

Partita IVA. Paste it as you have it: «IT 123.456.789-03» is stored as «12345678903». An Italian one is checked against its check digit; a foreign one is only shape-checked.

tax_codestring nullable

Codice fiscale: 16 characters for a person, the 11-digit partita IVA for a company. Checked.

sdi_codestring nullable

Codice destinatario for electronic invoicing: 7 characters for a private recipient, 6 for a PA. «0000000» legitimately means «no electronic channel».

pecstring nullable

The certified mailbox. A PEC is not an ordinary address — never put one in email.

emailstring nullable

Ordinary email. What the duplicate probe matches on, and what files mail from this address under the anagrafica.

phonestring nullable

Landline, as it is dialled.

mobilestring nullable

Mobile number.

whatsappstring nullable

The number they chat on WhatsApp, with the country code — «+39 333 123 4567». Its own field, never inferred from mobile: stored normalised, and what the WhatsApp module writes to.

websitestring nullable

Their site: an http(s) address or a bare host, never another scheme.

industrystring nullable

Free text — «studio commercialista», «edilizia». There is no closed list.

owner_user_idstring uuid nullable

Whose account it is. A colleague’s user_id from custodo_list_members, your own from custodo_whoami, or the owner_user_id a detailed anagrafiche_get_party returns.

agent_user_idstring uuid nullable

The agente di riferimento who brought the account. A colleague’s user_id from custodo_list_members, or your own from custodo_whoami. Recorded only — this product computes no commission.

sourcestring nullable

Where they came from — «passaparola», «fiera», «sito». Free text.

tagsstring[]

Free labels, at most 20. REPLACES the whole list, so pass the tags the record should end up with.

consent_basis'contract' | 'consent' | 'legitimate_interest' | 'legal_obligation' nullable

The GDPR Article 6 basis for holding their data. Never invent one — leave it out when nobody has recorded it.

consent_atstring date-time nullable

When that basis was established, ISO-8601 with a timezone.

consent_sourcestring nullable

How it was obtained — «contratto firmato», «modulo sul sito».

marketing_opt_outboolean

true when they have asked not to be contacted commercially.

notesstring nullable

Free notes on the record, written by people and read by people.

customobject

The organisation’s own fields, FIELD KEY → value. The keys, types, options and which roles each field is for are partyFields in custodo_get_module_settings (module anagrafiche). A value is text, a number, a date as YYYY-MM-DD, true/false, or one of a choice field’s options exactly. Only the keys you pass change and null clears one. A key no field declares, or a field limited to roles the record does not hold, is refused; a required field the record’s roles want must be given.

Response

Done. data is the tool’s own answer.

oktrue required
dataunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.