# Identity: address

> Switch the identity to the address its current leaf names: the routing half of a move (SPEC §5.3, §9)

## Switch the identity to the address its current leaf names: the routing half of a move (SPEC §5.3, §9)

`POST /v1/identities/{slug}/address` · operation `moveIdentityAddress`

Requires the `batondeck:identities:manage` permission (action `identity:move`).

Requires a step-up: MFA enrolled and re-authenticated within 15 minutes. **Not reachable with an API key** — a key has no session and so can never step up.

Refused while the workspace is suspended or on deletion hold.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `slug` | path | string | yes |  |

**Request body** (`application/json`)

| Field | Type | Required | Notes |
|---|---|---|---|
| `address` | string | yes | ≥ 3 chars, ≤ 300 chars |

<details>
<summary>Request schema</summary>

```json
{
  "type": "object",
  "properties": {
    "address": {
      "type": "string",
      "minLength": 3,
      "maxLength": 300
    }
  },
  "required": [
    "address"
  ],
  "additionalProperties": false
}
```

</details>

**Responses**

| Status | Meaning |
|---|---|
| 201 | Switch the identity to the address its current leaf names: the routing half of a move (SPEC §5.3, §9) |
| 400 | The arguments did not validate. |
| 401 | No portal session, and no live API key. |
| 403 | The policy refused, or the request was cross-site. |
| 404 | No such resource, or none this session may see. |

<details>
<summary>201 response schema</summary>

```json
{
  "type": "object",
  "properties": {
    "address": {
      "type": "string"
    },
    "from": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "vacated_until": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "address",
    "from",
    "vacated_until"
  ],
  "additionalProperties": false
}
```

</details>

```sh
curl -X POST 'https://api.batondeck.com/v1/identities/:slug/address' \
  -H "Authorization: Bearer $BATONDECK_API_KEY" \
  -H 'content-type: application/json' \
  -d @body.json
```
