# Identity: settings

> This identity's own settings: accept_new_hosts, the owner's status and moved_away_at; What happens when a pinned contact turns up at a new address (accept_new_hosts), the owner's status, which decides what contacts read with get_status, or, alone, moved_away: no renewal reminders

## This identity's own settings: accept_new_hosts, the owner's status and moved_away_at

`GET /v1/identities/{slug}/settings` · operation `getIdentitySettings`

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

**Parameters**

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

**Responses**

| Status | Meaning |
|---|---|
| 200 | This identity's own settings: accept_new_hosts, the owner's status and moved_away_at |
| 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>200 response schema</summary>

```json
{
  "type": "object",
  "properties": {
    "accept_new_hosts": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "auto",
        "available",
        "not_available",
        "disabled"
      ]
    },
    "status_updated_at": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "moved_away_at": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "accept_new_hosts",
    "status",
    "status_updated_at",
    "moved_away_at"
  ],
  "additionalProperties": false
}
```

</details>

```sh
curl -X GET 'https://api.batondeck.com/v1/identities/:slug/settings' \
  -H "Authorization: Bearer $BATONDECK_API_KEY"
```


## What happens when a pinned contact turns up at a new address (accept_new_hosts), the owner's status, which decides what contacts read with get_status, or, alone, moved_away: no renewal reminders

`PATCH /v1/identities/{slug}/settings` · operation `updateIdentitySettings`

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

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 |
|---|---|---|---|
| `accept_new_hosts` | "auto" \\| "ask" |  |  |
| `status` | "auto" \\| "available" \\| "not_available" \\| "disabled" |  |  |
| `moved_away` | boolean |  |  |

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

```json
{
  "type": "object",
  "properties": {
    "accept_new_hosts": {
      "type": "string",
      "enum": [
        "auto",
        "ask"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "auto",
        "available",
        "not_available",
        "disabled"
      ]
    },
    "moved_away": {
      "type": "boolean"
    }
  },
  "additionalProperties": false
}
```

</details>

**Responses**

| Status | Meaning |
|---|---|
| 200 | What happens when a pinned contact turns up at a new address (accept_new_hosts), the owner's status, which decides what contacts read with get_status, or, alone, moved_away: no renewal reminders |
| 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>200 response schema</summary>

```json
{
  "type": "object",
  "properties": {
    "accept_new_hosts": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "auto",
        "available",
        "not_available",
        "disabled"
      ]
    },
    "status_updated_at": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    },
    "moved_away_at": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "accept_new_hosts",
    "status",
    "status_updated_at",
    "moved_away_at"
  ],
  "additionalProperties": false
}
```

</details>

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