# Autopilot

6 endpoints for autopilot, with parameters and a real response example.

## GET /projects/{id}/autopilot

**Get a project's autopilot schedule**

Returns the autopilot's weekly grid: whether it is on, which days and hours are set, each slot's fixed theme, and the project's timezone, plus any blockers that would prevent publication even while on.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |

Response:

```json
{
  "projectId": "c85848ba-2881-4a2e-9bdd-841b26d07359",
  "enabled": false,
  "emailReport": true,
  "requiresApproval": false,
  "timezone": "America/Porto_Velho",
  "slots": [],
  "blockers": [
    "no_slots",
    "no_instagram"
  ]
}
```

## POST /projects/{id}/autopilot/enable

**Turn on autopilot**

Turns on the autopilot: Posttar starts generating and scheduling posts on its own at the grid's slots. Rejected when the grid is empty.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |

## POST /projects/{id}/autopilot/disable

**Turn off autopilot**

Turns off the autopilot. No slot is deleted: the grid is kept and comes back in full when turned on again.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |

## POST /projects/{id}/autopilot/slots

**Add an autopilot slot**

Adds one more day and hour to the autopilot's grid, optionally with a fixed theme. Does not turn the autopilot on by itself.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |
| `dayOfWeek` | body | integer (0 to 6) | yes | 0 is Monday, 6 is Sunday. |
| `hour` | body | integer (0 to 23) | yes | Whole hour, in the project's timezone. |
| `theme` | body | string | no | Fixed topic for this slot. Without it, the autopilot picks the topic. |

## PATCH /projects/{id}/autopilot/slots/{slotId}

**Update an autopilot slot's theme**

Changes a slot's fixed theme. A blank value erases it, and the autopilot goes back to choosing the topic on its own for that slot.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |
| `slotId` | path | string | yes | Opaque id from a previous response. |
| `theme` | body | string | yes | Blank erases the fixed topic: the autopilot goes back to choosing it. |

## DELETE /projects/{id}/autopilot/slots/{slotId}

**Delete an autopilot slot**

Removes a slot from the autopilot's grid. Does not turn the autopilot off and does not touch other slots.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Opaque id from a previous response. |
| `slotId` | path | string | yes | Opaque id from a previous response. |
