---
title: "Set the playbooks explicitly bound to a space type"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set the playbooks explicitly bound to a space type

Path: CloudRaker Workspace API › Playbooks

`PUT /space-types/{spaceTypeId}/playbooks`

Declaratively sets which playbooks are explicitly bound to the space type named in the path. Body: `{ playbookIds: string[] }` — the desired full set of explicitly-bound playbook ids. Each changed playbook has this space type added to / removed from its `spaceTypes` array; unchanged playbooks are not touched. Playbooks with an EMPTY `spaceTypes` apply to all space types and are ignored by this endpoint — listing their id has no effect (binding one explicitly would silently restrict it everywhere else). Authorization: organization administrators only — other callers get 403. Returns 404 `not_found` if the space type does not exist; 400 `unknown_playbook` if an id matches no playbook. Response: the same annotated list as GET, after the update.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceTypeId` (`setSpaceTypePlaybooks.path.spaceTypeId`; string, required)

## Request body

_Required._

- `playbookIds` (`setSpaceTypePlaybooks.playbookIds`; array<string>, required) — The desired full set of explicitly-bound playbook ids.
  - minLength 1

## Example request

```json
{
  "playbookIds": [
    "string"
  ]
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url 'https://api.cloudraker.com/space-types/<spaceTypeId>/playbooks' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "playbookIds": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/space-types/<spaceTypeId>/playbooks';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({playbookIds: ['string']})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/space-types/<spaceTypeId>/playbooks"

payload = { "playbookIds": ["string"] }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The annotated playbook list, after the update.

#### Example

```json
{
  "data": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "status": "draft",
      "spaceTypes": [
        "string"
      ],
      "bound": true,
      "global": true
    }
  ]
}
```

- `data` (`setSpaceTypePlaybooks.response.200.data`; array<object>, required)
  - `id` (`setSpaceTypePlaybooks.response.200.data.id`; string, required)
  - `name` (`setSpaceTypePlaybooks.response.200.data.name`; string, required)
  - `description` (`setSpaceTypePlaybooks.response.200.data.description`; string, required)
  - `status` (`setSpaceTypePlaybooks.response.200.data.status`; string, required)
    - one of `"draft"`, `"active"`, `"archived"`
  - `spaceTypes` (`setSpaceTypePlaybooks.response.200.data.spaceTypes`; array<string>, required)
  - `bound` (`setSpaceTypePlaybooks.response.200.data.bound`; boolean, required) — Its `spaceTypes` explicitly includes this type.
  - `global` (`setSpaceTypePlaybooks.response.200.data.global`; boolean, required) — Its `spaceTypes` is empty, so it applies everywhere and cannot be unbound here.

### 400

`unknown_playbook` — an id matches no playbook definition

### 404

`not_found` — the space type does not exist


Source: https://docs.cloudraker.com/workspace/api/playbooks/set-space-type-playbooks/index.md
