# Zilfu — Space members

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

## Servers

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

## Operations

### List members of a space

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

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Responses

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

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

- **`data` (required)**

  `array`

  **Items:**

  - **`email` (required)**

    `string`

  - **`id` (required)**

    `integer`

  - **`name` (required)**

    `string`

  - **`joined_at`**

    `string`

  - **`permissions`**

    `object`

**Example:**

```json
{
  "data": [
    {
      "id": 1,
      "name": "",
      "email": "",
      "permissions": "",
      "joined_at": ""
    }
  ]
}
```

##### 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": ""
}
```

### Remove a member from a space

- **Method:** `DELETE`
- **Path:** `/spaces/{space}/members/{user}`
- **Tags:** SpaceMember

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `user` required

- **In:** `path`

The user 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": ""
}
```

### Update a member's permissions

- **Method:** `PATCH`
- **Path:** `/spaces/{space}/members/{user}`
- **Tags:** SpaceMember

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `user` required

- **In:** `path`

The user ID

`integer`

#### Request Body

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

- **`permissions` (required)**

  `array`

  **Items:**

  `string`, possible values: `"create_posts", "edit_posts", "publish_posts", "approve_posts", "delete_posts", "manage_accounts", "manage_team"`

**Example:**

```json
{
  "permissions": [
    "create_posts"
  ]
}
```

#### 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": ""
}
```

##### 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": [
      ""
    ]
  }
}
```

### The authenticated user leaves the space

- **Method:** `POST`
- **Path:** `/spaces/{space}/members/leave`
- **Tags:** SpaceMember

#### 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": ""
}
```
