---
title: "Create Automation"
method: POST
path: "/automations"
tags: ["Automations"]
---

# Create Automation

`POST /automations`

## Request

- Base URL: `https://api.whop.com/api/v1`
- URL: `https://api.whop.com/api/v1/automations`
- Auth: HTTP bearer

Creates an automation, `stopped`, with an empty draft version. Add steps with `POST /automation_steps`, then publish it with `POST /automations/{id}/publish`, which makes it `active`.

## Headers

- `Api-Version-Date` string
- `Idempotency-Key` string

## Request body

- object
  - `account_id` string: Account ID, prefixed `biz_`. Required for user credentials; otherwise defaults to the credential's account.
  - `name` string, required: The automation's name, shown on the dashboard. Up to 255 characters.
  - `trigger_event` 'payment.succeeded' | 'payment.failed' | 'membership.activated' | 'membership.trial_ending_soon' | 'membership.cancel_at_period_end_changed' | 'member.created' | 'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'refund.created' | 'dispute.created' | 'resolution_center_case.created' | 'resolution_center_case.decided' | 'course_lesson_interaction.completed' | 'null', nullable: The webhook event that enrolls the member it's about, such as `payment.succeeded`. `null` for an automation that only `POST /automations/{id}/trigger` enrolls into. Fixed once the automation has been published.

## Response `201`

Automation created

- Automation
  - `account_id` string, required: ID of the account the automation belongs to, prefixed `biz_`.
  - `active_enrollments_count` integer, required: Members currently in the automation.
  - `created_at` string, required: When the automation was created, as an ISO 8601 timestamp.
  - `created_by_actor` AutomationActor, required: Who created the automation.
    - `id` string, required: ID of the user, account or app, prefixed `user_`, `biz_` or `app_`.
    - `resource_type` 'user' | 'account' | 'app', required: What acted: a `user`, an `account` through one of its API keys, or an `app`.
  - `draft_version` integer, required: The version that step edits change. Always `published_version` plus one, or `1` before the first publish.
  - `has_unpublished_changes` boolean, required: Whether the draft has edits that `POST /automations/{id}/publish` would publish. Always `true` before the first publish.
  - `id` string, required: Automation ID, prefixed `ato_`.
  - `name` string, required: The automation's name, shown on the dashboard. Up to 255 characters.
  - `published_at` string, nullable, required: When the automation was last published, as an ISO 8601 timestamp. `null` until its first publish.
  - `published_by_actor` AutomationActor, nullable, required
    - `id` string, required: ID of the user, account or app, prefixed `user_`, `biz_` or `app_`.
    - `resource_type` 'user' | 'account' | 'app', required: What acted: a `user`, an `account` through one of its API keys, or an `app`.
  - `published_version` integer, nullable, required: The version new members start on. `null` until the automation is first published.
  - `secret_names` string[], required
  - `status` 'active' | 'closed' | 'stopped', required: `active` enrolls members and runs their steps. `closed` enrolls no one new, and members already in it finish. `stopped` enrolls no one, and its members' enrollments have ended. A new automation is `stopped` until its first publish makes it `active`.
  - `total_enrollments_count` integer, required: How many times members have enrolled in the automation, including enrollments that have ended.
  - `trigger_event` 'payment.succeeded' | 'payment.failed' | 'membership.activated' | 'membership.trial_ending_soon' | 'membership.cancel_at_period_end_changed' | 'member.created' | 'invoice.created' | 'invoice.paid' | 'invoice.past_due' | 'refund.created' | 'dispute.created' | 'resolution_center_case.created' | 'resolution_center_case.decided' | 'course_lesson_interaction.completed' | 'null', nullable, required: The webhook event that enrolls the member it's about, such as `payment.succeeded`. `null` for an automation that only `POST /automations/{id}/trigger` enrolls into. Fixed once the automation has been published.
  - `updated_at` string, required: When the automation was last updated, as an ISO 8601 timestamp.

## Other responses

- `400`: Invalid Parameters
- `403`: Forbidden
- `409`: Conflict

## Changes

- **2026-11-23** `d8628142e836`: 1 warning, 1 info
  - added the new `membership.cancel_at_period_end_changed` enum value to the `trigger_event` response property for the response status `201`
  - added the new `membership.cancel_at_period_end_changed` enum value to the request property `trigger_event`
- **2026-11-21** `968f4fc221c1`: 2 breaking, 2 info
  - removed the required property `created_by_actor/object` from the response with the `201` status
  - removed the required property `published_by_actor/oneOf[#/components/schemas/AutomationActor]/object` from the response with the `201` status
  - added the required property `created_by_actor/resource_type` to the response with the `201` status
  - added the required property `published_by_actor/oneOf[#/components/schemas/AutomationActor]/resource_type` to the response with the `201` status
- **2026-11-06** `ea41781067f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/whop/apis/whop-api/changes/automations/post.md)

---

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