Contacts

Import an Excel file into Anagrafiche

Imports the Excel workbook an Archivio document holds into Anagrafiche, in ONE transaction: creates the new anagrafiche and, with existing "update", brings the ones already in the register in line with the file — their employments and logins included — exactly what anagrafiche_analyse_spreadsheet reported for the same arguments, so analyse first and pass the SAME arguments. Refused, with the report, while a row has a problem, unless skip_invalid_rows is true. The person approves it on a card showing the counts, the columns and the roles before anything is written; it cannot be undone row by row.

post/api/v1/rest/anagrafiche/imports/{document_id}

Request

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

Path parameters

document_idstring uuid required

The Archivio document holding the .xlsx workbook. A file attached to a Custode message is already in the Archivio: use the id the message lists. From another client, file it first with documents_upload.

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

columnsobject

The file’s own column headers, EXACTLY as the analysis lists them, mapped to the register’s fields — e.g. {"Cliente": "name", "Cod. Fiscale": "tax_code", "Nazionalità": "ignore"}. Only needed for headers the analysis did not recognise (read_as null) or read wrongly; "ignore" leaves a column unread. Every row needs name (the denominazione) — or, for a person, first_name/last_name. company is the company a PERSON belongs to, by its name. For an employee: employee_code (matricola), manager (their Responsabile’s name — another employee, in the register or in the file), hired_on, left_on. The organisation’s own fields are "custom.<key>", as the analysis lists them under custom_fields.

rolesstring[]

Roles EVERY row takes, on top of any «Ruoli» column: a list of customers → ["cliente"], of suppliers → ["fornitore"]. Keys from anagrafiche_list_roles.

existing'update' | 'skip'

A row whose anagrafica is ALREADY in the register — same codice fiscale, else same partita IVA, else same name — "update"s it (default: only cells that carry a value change anything; roles and labels are added, never removed; notes are never overwritten; the kind never changes) or is left alone with "skip". Either way nothing is duplicated.

skip_invalid_rowsboolean

false (default): one row with a problem blocks the whole import. true: the rows that pass are written and the others are left out and listed. Set it only after the person has seen which rows would be left out and agreed.

sheetstring

The tab to read, by name, when the workbook has several (the analysis lists them). A workbook of one tab needs nothing.

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.