# Set the books' mail address

Source: https://amanucci.com/nl/docs/developers/api/intake/setInboundAddress

## POST /v1/entities/{entityId}/inbound-address

Set the books' mail address

Choose the books' mail address: the live one is retired and the new one written in one transaction; the retired address keeps delivering to these books, and is never given to other books. A name some books hold, live or retired, or one the platform keeps (`postmaster`, `admin`, …), is 409 `address_taken`; a malformed one 422. The same `id` again is the row already written (200, `duplicate: true`); the same id naming another address is 409 `address_conflict`. The organisation's owner, or a firm accountant holding `settings.policy`. Not a signed act.

Operation ID: `setInboundAddress`

### Parameters

```json
[
  {
    "schema": {
      "type": "string",
      "format": "uuid"
    },
    "required": true,
    "name": "entityId",
    "in": "path"
  }
]
```

### Request body

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/SetInboundAddress"
      }
    }
  }
}
```

### Responses

#### 200 Duplicate-ok: this address was already the live one.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/SetInboundAddressResult"
    }
  }
}
```

#### 201 The new address.

```json
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/SetInboundAddressResult"
    }
  }
}
```

#### 401 Dead or absent credential (`unauthenticated`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 403 Authenticated, present, and refused: a missing grant, a missing seat, or a missing step-up.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 404 Absent, or hidden from this asker — the two are indistinguishable (`not-found`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 409 The world is not in the state the request assumed: a stale `expectedSeq`, or a transition already made.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 422 The request did not satisfy the schema (`invalid-input`).

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 429 Too many requests on this door's bucket (`rate-limited`); refused before any handler ran, `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```

#### 503 Temporarily unavailable; `Retry-After` says when to come back.

```json
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/Problem"
    }
  }
}
```
