> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# API de Automations

> Una Automation es una cadena de pasos que los miembros recorren de uno en uno.

Un miembro se inscribe cuando le ocurre el `trigger_event` de la automatización, como `payment.succeeded`. También puedes inscribir a un miembro con `POST /automations/{id}/trigger`. Un paso `wait` lo retiene durante un tiempo determinado. Un paso `email` o `message` ejecuta su `source_code`, un módulo TSX que lee los datos del miembro a través de la API. El módulo decide si envía algo y qué dice.

Los pasos tienen versiones. Tú editas la versión en borrador. `POST /automations/{id}/publish` la convierte en la versión en la que empiezan los miembros nuevos y luego la copia en el siguiente borrador. Cada publicación mueve a los miembros que ya están en la automatización a la nueva versión. Usa la API de Automations para crear, publicar y activar automatizaciones, y para actualizarlas, incluido su estado. Usa las APIs de Automation steps y Automation enrollments para sus pasos y miembros.

## Endpoints

| Endpoint | Solicitud |
| - | - |
| [Listar Automations](https://docs.whop.com/es/api-reference/automations/list-automations.md) | GET `/automations` |
| [Obtener Automation](https://docs.whop.com/es/api-reference/automations/retrieve-automation.md) | GET `/automations/{id}` |
| [Crear Automation](https://docs.whop.com/es/api-reference/automations/create-automation.md) | POST `/automations` |
| [Publicar Automation](https://docs.whop.com/es/api-reference/automations/publish-automation.md) | POST `/automations/{id}/publish` |
| [Activar Automation](https://docs.whop.com/es/api-reference/automations/trigger-automation.md) | POST `/automations/{id}/trigger` |
| [Actualizar Automation](https://docs.whop.com/es/api-reference/automations/update-automation.md) | PATCH `/automations/{id}` |
| [Eliminar Automation](https://docs.whop.com/es/api-reference/automations/delete-automation.md) | DELETE `/automations/{id}` |

## Atributos

**id** `string` *required*

ID de la automatización, con el prefijo `ato_`.

**account\_id** `string` *required*

ID de la cuenta a la que pertenece la automatización, con el prefijo `biz_`.

**active\_enrollments\_count** `integer` *required*

Miembros que están actualmente en la automatización.

**created\_at** `string` *required*

Cuándo se creó la automatización, como marca de tiempo ISO 8601.

**created\_by\_actor** `object` *required*

Quién creó la automatización.

> [accordion] Propiedades
>
> **id** `string` *required*
>
> ID del usuario, la cuenta o la app, con el prefijo `user_`, `biz_` o `app_`.
>
> **object** `string` *required*
>
> Quién actuó: un `user`, una `account` mediante una de sus API keys, o una `app`.
>
> Opciones disponibles: `user`, `account`, `app`

**draft\_version** `integer` *required*

La versión que modifican las ediciones de pasos. Siempre `published_version` más uno, o `1` antes de la primera publicación.

**has\_unpublished\_changes** `boolean` *required*

Si el borrador tiene ediciones que `POST /automations/\{id}/publish` publicaría. Siempre `true` antes de la primera publicación.

**name** `string` *required*

El nombre de la automatización, que se muestra en el panel. Hasta 255 caracteres.

**published\_at** `string | null` *required*

Cuándo se publicó la automatización por última vez, como marca de tiempo ISO 8601. `null` hasta su primera publicación.

**published\_by\_actor** `object | null` *required*

Quién publicó la automatización por última vez. `null` hasta su primera publicación.

> [accordion] Propiedades
>
> **id** `string` *required*
>
> ID del usuario, la cuenta o la app, con el prefijo `user_`, `biz_` o `app_`.
>
> **object** `string` *required*
>
> Quién actuó: un `user`, una `account` mediante una de sus API keys, o una `app`.
>
> Opciones disponibles: `user`, `account`, `app`

**published\_version** `integer | null` *required*

La versión en la que empiezan los miembros nuevos. `null` hasta que la automatización se publica por primera vez.

**secret\_names** `string[]` *required*

Nombres de los secretos de la automatización, que el código de sus pasos lee como variables de entorno. Sus valores nunca se devuelven.

**status** `string` *required*

`active` inscribe miembros y ejecuta sus pasos. `closed` no inscribe a nadie nuevo, y los miembros que ya están en ella terminan. `stopped` no inscribe a nadie, y las inscripciones de sus miembros han terminado. Una automatización nueva está en `stopped` hasta que su primera publicación la pone en `active`.

Opciones disponibles: `active`, `closed`, `stopped`

**total\_enrollments\_count** `integer` *required*

Cuántas veces se han inscrito miembros en la automatización, incluidas las inscripciones que han terminado.

**trigger\_event** `string | null` *required*

El evento de webhook que inscribe al miembro al que se refiere, como `payment.succeeded`. `null` para una automatización en la que solo inscribe `POST /automations/\{id}/trigger`. Queda fijo una vez publicada la automatización.

Opciones disponibles: `payment.succeeded`, `payment.failed`, `membership.activated`, `membership.trial_ending_soon`, `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`

**updated\_at** `string` *required*

Cuándo se actualizó la automatización por última vez, como marca de tiempo ISO 8601.

```json Automation theme={null}
{
	"id": "ato_xxxxxxxxxxxxxx",
	"account_id": "biz_xxxxxxxxxxxxxx",
	"name": "Welcome new customers",
	"status": "active",
	"trigger_event": "payment.succeeded",
	"published_version": 2,
	"draft_version": 3,
	"has_unpublished_changes": false,
	"published_at": "2026-10-01T15:30:00.000Z",
	"published_by_actor": {
		"id": "user_yyyyyyyyyyyyyy",
		"object": "user"
	},
	"created_by_actor": {
		"id": "user_yyyyyyyyyyyyyy",
		"object": "user"
	},
	"secret_names": ["SHOPIFY_TOKEN"],
	"active_enrollments_count": 42,
	"total_enrollments_count": 318,
	"created_at": "2026-09-12T10:00:00.000Z",
	"updated_at": "2026-10-01T15:30:00.000Z"
}
```


## Related topics

- [API de Automation Steps](https://docs.whop.com/es/api-reference/automation-steps/automation-step.md)
- [API de Automation Enrollments](https://docs.whop.com/es/api-reference/automation-enrollments/automation-enrollment.md)
- [Descripción general de la API de Whop](https://docs.whop.com/es/api-reference/overview.md)
