# Zilfu — Scheduled comments

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

## Servers

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

## Operations

### Attach a follow-up comment to an existing post. If the post has already published, the comment is armed immediately against its remote id

- **Method:** `POST`
- **Path:** `/spaces/{space}/posts/{post}/comment`
- **Tags:** ScheduledComment

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `post` required

- **In:** `path`

The post ID

`integer`

#### Request Body

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

- **`content` (required)**

  `string`

- **`delay_minutes` (required)**

  `integer`

**Example:**

```json
{
  "content": "",
  "delay_minutes": 1
}
```

#### Responses

##### Status: 200 \`ScheduledCommentResource\`

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

**Any of:**

- **`data` (required)**

  `object`

  - **`account_id` (required)**

    `integer`

  - **`content` (required)**

    `string`

  - **`created_at` (required)**

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

  - **`delay_minutes` (required)**

    `integer`

  - **`id` (required)**

    `integer`

  - **`metadata` (required)**

    `array | null`

  - **`post_id` (required)**

    `integer`

  - **`published_at` (required)**

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

  - **`scheduled_at` (required)**

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

  - **`status` (required)**

    `integer`, possible values: `0, 1, 2, 3, 4, 5, 6` — | | |---| | \`0\` \<br/> Created, waiting for the parent post to publish before it can be armed. | | \`1\` \<br/> Armed with the parent's remote id and an absolute fire time. | | \`2\` \<br/> | | \`3\` \<br/> | | \`4\` \<br/> | | \`5\` \<br/> Parent post failed, so the comment never armed. | | \`6\` \<br/> Cancelled by the user before publishing. |

  - **`updated_at` (required)**

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

**Example:**

```json
{
  "data": {
    "id": 1,
    "content": "",
    "status": null,
    "delay_minutes": 1,
    "scheduled_at": null,
    "published_at": null,
    "metadata": [],
    "post_id": 1,
    "account_id": 1,
    "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": [
      ""
    ]
  }
}
```

### Edit a pending or armed follow-up comment

- **Method:** `PUT`
- **Path:** `/spaces/{space}/comments/{scheduledComment}`
- **Tags:** ScheduledComment

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `scheduledComment` required

- **In:** `path`

The scheduled comment ID

`integer`

#### Request Body

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

- **`content`**

  `string`

- **`delay_minutes`**

  `integer`

**Example:**

```json
{
  "content": "",
  "delay_minutes": 1
}
```

#### Responses

##### Status: 200 \`ScheduledCommentResource\`

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

**Any of:**

- **`data` (required)**

  `object`

  - **`account_id` (required)**

    `integer`

  - **`content` (required)**

    `string`

  - **`created_at` (required)**

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

  - **`delay_minutes` (required)**

    `integer`

  - **`id` (required)**

    `integer`

  - **`metadata` (required)**

    `array | null`

  - **`post_id` (required)**

    `integer`

  - **`published_at` (required)**

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

  - **`scheduled_at` (required)**

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

  - **`status` (required)**

    `integer`, possible values: `0, 1, 2, 3, 4, 5, 6` — | | |---| | \`0\` \<br/> Created, waiting for the parent post to publish before it can be armed. | | \`1\` \<br/> Armed with the parent's remote id and an absolute fire time. | | \`2\` \<br/> | | \`3\` \<br/> | | \`4\` \<br/> | | \`5\` \<br/> Parent post failed, so the comment never armed. | | \`6\` \<br/> Cancelled by the user before publishing. |

  - **`updated_at` (required)**

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

**Example:**

```json
{
  "data": {
    "id": 1,
    "content": "",
    "status": null,
    "delay_minutes": 1,
    "scheduled_at": null,
    "published_at": null,
    "metadata": [],
    "post_id": 1,
    "account_id": 1,
    "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": [
      ""
    ]
  }
}
```

### Cancel a follow-up comment before it publishes

- **Method:** `DELETE`
- **Path:** `/spaces/{space}/comments/{scheduledComment}`
- **Tags:** ScheduledComment

#### Parameters

##### `space` required

- **In:** `path`

The space ID

`integer`

##### `scheduledComment` required

- **In:** `path`

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

##### Status: 422 An error

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

- **`message` (required)**

  `string` — Error overview.

**Example:**

```json
{
  "message": "This comment can no longer be cancelled."
}
```
