# Zilfu — Webhooks

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

## Servers

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

## Operations

### List webhooks

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

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Responses

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

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

- **`data` (required)**

  `array`

  **Items:**

  - **`created_at` (required)**

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

  - **`events` (required)**

    `array`

    **Items:**

  - **`id` (required)**

    `integer`

  - **`is_active` (required)**

    `boolean`

  - **`updated_at` (required)**

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

  - **`url` (required)**

    `string`

**Example:**

```json
{
  "data": [
    {
      "id": 1,
      "url": "",
      "events": [],
      "is_active": true,
      "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": ""
}
```

### Create a webhook

- **Method:** `POST`
- **Path:** `/spaces/{space}/webhooks`
- **Tags:** Webhook

Returns an auto-generated signing secret on the response.

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

#### Request Body

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

- **`events` (required)**

  `array`

  **Items:**

  `string`, possible values: `"post.published", "post.failed", "post.scheduled", "comment.published", "comment.failed", "comment.received", "account.connected", "account.disconnected"`

- **`url` (required)**

  `string`, format: `uri`

**Example:**

```json
{
  "url": "",
  "events": [
    "post.published"
  ]
}
```

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

### Update a webhook

- **Method:** `PUT`
- **Path:** `/spaces/{space}/webhooks/{webhook}`
- **Tags:** Webhook

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `webhook` required

- **In:** `path`

The webhook ID

`integer`

#### Request Body

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

- **`events`**

  `array`

  **Items:**

  `string`, possible values: `"post.published", "post.failed", "post.scheduled", "comment.published", "comment.failed", "comment.received", "account.connected", "account.disconnected"`

- **`is_active`**

  `boolean`

- **`url`**

  `string`, format: `uri`

**Example:**

```json
{
  "url": "",
  "is_active": true,
  "events": [
    "post.published"
  ]
}
```

#### Responses

##### Status: 200 \`WebhookResource\`

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

**Any of:**

- **`data` (required)**

  `object`

  - **`created_at` (required)**

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

  - **`events` (required)**

    `array`

    **Items:**

  - **`id` (required)**

    `integer`

  - **`is_active` (required)**

    `boolean`

  - **`updated_at` (required)**

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

  - **`url` (required)**

    `string`

**Example:**

```json
{
  "data": {
    "id": 1,
    "url": "",
    "events": [],
    "is_active": true,
    "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 webhook

- **Method:** `DELETE`
- **Path:** `/spaces/{space}/webhooks/{webhook}`
- **Tags:** Webhook

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `webhook` required

- **In:** `path`

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