# Identity: presets

> This identity's own preset bundles, and which have been edited; Change what a preset grants, for this identity

## This identity's own preset bundles, and which have been edited

`GET /v1/identities/{slug}/presets` · operation `listIdentityPresets`

Requires the `batondeck:contacts:read` permission (action `contact:read`).

**Parameters**

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

**Responses**

| Status | Meaning |
|---|---|
| 200 | This identity's own preset bundles, and which have been edited |
| 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": {
    "presets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "edited": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "permissions",
          "edited"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "presets"
  ],
  "additionalProperties": false
}
```

</details>

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


## Change what a preset grants, for this identity

`PATCH /v1/identities/{slug}/presets/{name}` · operation `setIdentityPreset`

Requires the `batondeck:contacts:manage` permission (action `contact:write`).

Refused while the workspace is suspended or on deletion hold.

**Parameters**

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

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

| Field | Type | Required | Notes |
|---|---|---|---|
| `permissions` | array of string | yes |  |

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

```json
{
  "type": "object",
  "properties": {
    "permissions": {
      "maxItems": 64,
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "permissions"
  ],
  "additionalProperties": false
}
```

</details>

**Responses**

| Status | Meaning |
|---|---|
| 200 | Change what a preset grants, for this identity |
| 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": {
    "name": {
      "type": "string"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "name",
    "permissions"
  ],
  "additionalProperties": false
}
```

</details>

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