---
title: "Set an address"
method: POST
path: "/api/v1/rest/anagrafiche/parties/{id}/addresses"
tags: ["Contacts"]
---

# Set an address

`POST /api/v1/rest/anagrafiche/parties/{id}/addresses`

## Request

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

Writes one address of an anagrafica: sede legale, sede operativa, fatturazione or spedizione. Omit `address_id` and the party’s address in that role is updated if it has one and created if it does not, so calling this twice with the same arguments is the same as calling it once; pass `address_id` when the party has more than one address in that role. `null` clears a field. A party may hold at most 20 addresses.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Tenant-Id` string, uuid

## Request body

- object
  - `role` 'sede_legale' | 'sede_operativa' | 'fatturazione' | 'spedizione', required: What the address IS: `sede_legale` (the registered office an invoice must carry), `sede_operativa` (where the work happens), `fatturazione`, `spedizione`.
  - `address_id` string, uuid: Change THIS address, from anagrafiche_get_party. Omit it and the party’s address in that `role` is updated, or created when it has none.
  - `street` string, nullable: Via and number. `null` clears it.
  - `city` string, nullable: The comune. `null` clears it.
  - `province` string, nullable: The sigla, never the name: «MI», not «Milano». Stored uppercase.
  - `postal_code` string, nullable: The CAP. `null` clears it.
  - `country` string: ISO-3166-1 alpha-2, stored uppercase. `IT` on a new address; left alone on an existing one.

## Response `200`

Done. `data` is the tool’s own answer.

- RestResult
  - `ok` true, required
  - `data` unknown, required

## Other responses

- `400`: The arguments did not validate: `error.message` names the field, what it expects and what arrived.
- `401`: No API key, or one that is malformed, unknown, revoked or expired.
- `403`: The call never ran: the module is off for this organisation, the credential lacks the permission or the module, the tier does not cover it, or the tool is destructive and the key was not minted for that.
- `404`: Nothing with that id in this organisation.
- `409`: The record is in a state that does not allow it — under legal hold, already sent, already closed. `error.code` says which.
- `422`: The tool ran and refused, in a sentence of its own (`TOOL_REFUSED`): the message says what to change. Retrying the same call will not help.
- `429`: The API key has spent its minute, or its day. Every request a key makes counts. See `Retry-After`.

---

[API](https://skmtc.dev/custodo/apis/custodo-integrazioni.md) · [All operations](https://skmtc.dev/custodo/apis/custodo-integrazioni/llms.txt) · [OpenAPI document](https://skmtc.dev/custodo/apis/custodo-integrazioni/revisions/16d336d3ec2a?raw)
