---
title: "Cancel an automation"
method: POST
path: "/api/v1/automations/{id}/cancel"
tags: ["Automations"]
---

# Cancel an automation

`POST /api/v1/automations/{id}/cancel`

## Request

- Base URL: `https://spoofy.social`
- URL: `https://spoofy.social/api/v1/automations/{id}/cancel`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Every future run stops for good. Orders already running finish — unless `cancel_running: true` asks those that allow it to cancel too (whatever they did not deliver is refunded).

## Path parameters

- `id` integer, required

## Request body

- object
  - `cancel_running` boolean

## Response `200`

Cancelled.

- object
  - `automation` Automation
    - `id` integer: Automation number (never the same as an order number).
    - `kind` 'spread' | 'scheduled' | 'recurring' | 'split' | 'campaign' | 'keep_above' | 'feed' | 'withdrawn': `withdrawn`: a kind Spoofy no longer offers; it has stopped and `note` says why.
    - `kindLabel` string
    - `status` 'active' | 'paused' | 'completed' | 'cancelled' | 'failed': Active with nothing left to place = finishing its last orders.
    - `pausedBecause` string, nullable: Why it is paused, in words. Paused for balance or an unavailable service, it resumes by itself.
    - `name` string
    - `service` object, nullable
      - `id` integer
      - `name` string
      - `platform` string
      - `metric` string
    - `link` string, nullable
    - `timezone` string
    - `startsAt` string, date-time
    - `endsAt` string, date-time, nullable
    - `nextRunAt` string, date-time, nullable
    - `createdAt` string, date-time
    - `finishedAt` string, date-time, nullable
    - `budget` string, nullable: USD, or null when only the plan bounds it.
    - `spent` string: Charged by its orders so far, net of refunds. USD as a decimal string.
    - `planned` string: What the plan costs at the price it was made with (open-ended kinds: up to the budget). USD as a decimal string.
    - `progress` object
      - `runs` integer
      - `placed` integer
      - `skipped` integer
      - `failed` integer
      - `left` integer
      - `ordered` integer: Units in placed orders.
      - `delivered` integer
      - `total` integer: The plan's total units.
      - `running` integer: Orders still delivering.
    - `settings` object: The kind's settings (every, at, times, pace, target, feed …). A spread delivered as one order in runs adds oneOrder, perRun and intervalMinutes.
    - `note` string, nullable: The last thing worth saying (a skipped run, a count not read this time).
    - `source` 'web' | 'api' | 'v2' | 'mcp'
    - `timeline` AutomationRun[]: Every run, in order (detail answers only).
      - `seq` integer
      - `step` integer: Campaign step.
      - `action` 'order'
      - `at` string, date-time: When it ran, or is due.
      - `dueAt` string, date-time
      - `status` 'planned' | 'starting' | 'placed' | 'skipped' | 'failed' | 'cancelled': `skipped`: not placed, `note` says why (balance, budget, a daily limit of posts).
      - `serviceId` integer, nullable
      - `link` string, nullable
      - `quantity` integer, nullable
      - `order` object, nullable: The order it placed: an ordinary order (GET /api/v1/orders/{id}).
        - `id` integer
        - `status` string
        - `quantity` integer
        - `delivered` integer
        - `startCount` integer, nullable
        - `charge` string: Charged. USD as a decimal string.
        - `refunded` string: Refunded. USD as a decimal string.
      - `note` string, nullable
  - `ordersAsked` integer: Running orders asked to cancel.

## Other responses

- `400`: Already over.
- `404`: Not found on your account.
- `413`: The request body is too big (uploads up to 4 MB, everything else up to 64 KB).
- `429`: Slow down: too many requests in a short time. Wait `Retry-After` seconds and carry on.

---

[API](https://skmtc.dev/spoofy/apis/spoofy-api.md) · [All operations](https://skmtc.dev/spoofy/apis/spoofy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spoofy/apis/spoofy-api/revisions/58adc986f826?raw)
