# Zilfu — Spaces

5 operations. Schemas referenced below are documented at https://zilfu.app/docs/api/schemas.md.

## Servers

- `https://zilfu.app/api`

## Operations

### List spaces accessible to the authenticated user (owned and member-of)

- **Method:** `GET`
- **Path:** `/spaces`
- **Tags:** Space

#### Responses

##### Status: 200 Array of \`SpaceResource\`

###### Content-Type: application/json

- **`data` (required)**

  `array`

  **Items:**

  - **`created_at` (required)**

    `string | null`, format: `date-time`

  - **`id` (required)**

    `integer`

  - **`name` (required)**

    `string`

  - **`timezone` (required)**

    `string | null`

  - **`updated_at` (required)**

    `string | null`, format: `date-time`

**Example:**

```json
{
  "data": [
    {
      "id": 1,
      "name": "",
      "timezone": null,
      "created_at": null,
      "updated_at": null
    }
  ]
}
```

##### Status: 401 Unauthenticated

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

### Create a space

- **Method:** `POST`
- **Path:** `/spaces`
- **Tags:** Space

#### Request Body

##### Content-Type: application/json

- **`name` (required)**

  `string`

**Example:**

```json
{
  "name": ""
}
```

#### Responses

##### Status: 200

###### Content-Type: application/json

**Example:**

```json
{}
```

##### Status: 401 Unauthenticated

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 403 Authorization error

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 422 Validation error

###### Content-Type: application/json

- **`errors` (required)**

  `object` — A detailed description of each field that failed validation.

- **`message` (required)**

  `string` — Errors overview.

**Example:**

```json
{
  "message": "",
  "errors": {
    "additionalProperty": [
      ""
    ]
  }
}
```

### Get a space

- **Method:** `GET`
- **Path:** `/spaces/{space}`
- **Tags:** Space

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Responses

##### Status: 200 \`SpaceResource\`

###### Content-Type: application/json

- **`data` (required)**

  `object`

  - **`created_at` (required)**

    `string | null`, format: `date-time`

  - **`id` (required)**

    `integer`

  - **`name` (required)**

    `string`

  - **`timezone` (required)**

    `string | null`

  - **`updated_at` (required)**

    `string | null`, format: `date-time`

**Example:**

```json
{
  "data": {
    "id": 1,
    "name": "",
    "timezone": null,
    "created_at": null,
    "updated_at": null
  }
}
```

##### Status: 401 Unauthenticated

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 403 Authorization error

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 404 Not found

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

### Update a space

- **Method:** `PUT`
- **Path:** `/spaces/{space}`
- **Tags:** Space

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Request Body

##### Content-Type: application/json

- **`name`**

  `string`

- **`timezone`**

  `string`

**Example:**

```json
{
  "name": "",
  "timezone": ""
}
```

#### Responses

##### Status: 200 \`SpaceResource\`

###### Content-Type: application/json

**Any of:**

- **`data` (required)**

  `object`

  - **`created_at` (required)**

    `string | null`, format: `date-time`

  - **`id` (required)**

    `integer`

  - **`name` (required)**

    `string`

  - **`timezone` (required)**

    `string | null`

  - **`updated_at` (required)**

    `string | null`, format: `date-time`

**Example:**

```json
{
  "data": {
    "id": 1,
    "name": "",
    "timezone": null,
    "created_at": null,
    "updated_at": null
  }
}
```

##### Status: 401 Unauthenticated

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 403 Authorization error

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 404 Not found

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 422 Validation error

###### Content-Type: application/json

- **`errors` (required)**

  `object` — A detailed description of each field that failed validation.

- **`message` (required)**

  `string` — Errors overview.

**Example:**

```json
{
  "message": "",
  "errors": {
    "additionalProperty": [
      ""
    ]
  }
}
```

### Delete a space

- **Method:** `DELETE`
- **Path:** `/spaces/{space}`
- **Tags:** Space

Cascades to all accounts, posts, slots, and other associated data.

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Responses

##### Status: 200

###### Content-Type: application/json

**Example:**

```json
{}
```

##### Status: 401 Unauthenticated

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 403 Authorization error

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```

##### Status: 404 Not found

###### Content-Type: application/json

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": ""
}
```
