# Zilfu — Space invitations

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

## Servers

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

## Operations

### List pending invitations for a space

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

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Responses

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

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

- **`data` (required)**

  `array`

  **Items:**

  - **`accepted_at` (required)**

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

  - **`created_at` (required)**

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

  - **`email` (required)**

    `string`

  - **`expires_at` (required)**

    `string`, format: `date-time`

  - **`id` (required)**

    `integer`

  - **`is_expired` (required)**

    `boolean`

  - **`permissions` (required)**

    `object`

**Example:**

```json
{
  "data": [
    {
      "id": 1,
      "email": "",
      "permissions": "",
      "expires_at": "",
      "accepted_at": null,
      "created_at": null,
      "is_expired": true
    }
  ]
}
```

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

### Send an invitation

- **Method:** `POST`
- **Path:** `/spaces/{space}/invitations`
- **Tags:** SpaceInvitation

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Request Body

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

- **`email` (required)**

  `string`, format: `email`

- **`permissions` (required)**

  `array`

  **Items:**

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

**Example:**

```json
{
  "email": "",
  "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": [
      ""
    ]
  }
}
```

### Revoke a pending invitation

- **Method:** `DELETE`
- **Path:** `/spaces/{space}/invitations/{invitation}`
- **Tags:** SpaceInvitation

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `invitation` required

- **In:** `path`

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

### Regenerate token + expiry and resend the invitation email

- **Method:** `POST`
- **Path:** `/spaces/{space}/invitations/{invitation}/resend`
- **Tags:** SpaceInvitation

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `invitation` required

- **In:** `path`

The invitation ID

`integer`

#### Responses

##### Status: 200 \`SpaceInvitationResource\`

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

**Any of:**

- **`data` (required)**

  `object`

  - **`accepted_at` (required)**

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

  - **`created_at` (required)**

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

  - **`email` (required)**

    `string`

  - **`expires_at` (required)**

    `string`, format: `date-time`

  - **`id` (required)**

    `integer`

  - **`is_expired` (required)**

    `boolean`

  - **`permissions` (required)**

    `object`

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