> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.butterix.com/en/llms.txt
> - v0: https://docs.butterix.com/en/v0/llms.txt

> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.butterix.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.butterix.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.butterix.com/_biti/feedback/agent.

# Get scheduled task

`GET /sites/{site}/automations/{id}`

Base URL: https://api.butterix.com/v1

Authentication: bearer token in Authorization header or API key in cookie `biti_session`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `site` | string | yes | Site slug or id |
| `id` | string | yes | Scheduled task id |

## Example request

```bash
curl https://api.butterix.com/v1/sites/acme-payments/automations/auto_01jd8x2k7q \
     -H "Authorization: Bearer <token>"
```

## Responses

### 200

Scheduled task

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | no |  |
| `name` | string | no |  |
| `prompt` | string | no |  |
| `schedule` | object | no |  |
| `schedule.every` | enum | yes | Allowed: `day`, `week`. |
| `schedule.weekday` | integer | no | 1 (Monday) to 7 (Sunday), required when `every` is `week` |
| `schedule.hour` | integer | yes |  |
| `schedule.minute` | integer | no |  |
| `schedule.timezone` | string | no | IANA time zone |
| `canEdit` | boolean | no | Allow changes to the docs |
| `enabled` | boolean | no |  |
| `createdBy` | object | no |  |
| `createdBy.id` | string | no |  |
| `createdBy.name` | string | no |  |
| `createdAt` | integer | no |  |
| `nextAt` | integer | no | When it runs next May be null. |
| `lastRun` | union | no | The last run (without its report); `null` before the first one |
| _Variant 1_ | variant |  |  |
| `lastRun.id` | string | no |  |
| `lastRun.automationId` | string | no |  |
| `lastRun.cause` | enum | no | Allowed: `schedule`, `manual`. |
| `lastRun.status` | enum | no | Allowed: `running`, `done`, `failed`. |
| `lastRun.report` | string | no | Report (Markdown) |
| `lastRun.branch` | string | no | Draft branch, when there are changes |
| `lastRun.files` | list of strings | no | Changed files |
| `lastRun.error` | string | no | Why it failed |
| `lastRun.usage` | object | no | Token usage |
| `lastRun.usage.input` | integer | no |  |
| `lastRun.usage.output` | integer | no |  |
| `lastRun.startedAt` | integer | no |  |
| `lastRun.finishedAt` | integer | no | May be null. |

### 404

The resource doesn't exist, or you don't have access to it

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | string | yes | Human-readable error message |
| `code` | string | no | Machine-readable error code (some endpoints) |

### Example response (200)

```json
{
  "id": "auto_01jd8x2k7q",
  "name": "Weekly documentation gaps",
  "prompt": "string",
  "schedule": {
    "every": "day",
    "weekday": 1,
    "hour": 0,
    "minute": 0,
    "timezone": "Asia/Shanghai"
  },
  "canEdit": true,
  "enabled": true,
  "createdBy": {
    "id": "string",
    "name": "string"
  },
  "createdAt": 1,
  "nextAt": 1,
  "lastRun": {
    "id": "run_01jd8x2k7q",
    "automationId": "string",
    "cause": "schedule",
    "status": "running",
    "report": "string",
    "branch": "automation/2k7q9x1a",
    "files": [
      "string"
    ],
    "error": "string",
    "usage": {
      "input": 1,
      "output": 1
    },
    "startedAt": 1,
    "finishedAt": 1
  }
}
```
