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

# API Trigger

> Trigger a workflow programmatically by calling the Conversion API.

The **API trigger** lets you start a workflow programmatically by making an API call. This is useful when you want to trigger workflows from your own application, backend systems, or third-party integrations.

## Configuration

When you select the API trigger, Conversion generates a **workflow ID** that you pass to the Trigger Workflow API endpoint. The workflow ID is displayed in the trigger configuration and can be copied directly.

To trigger the workflow, make a `POST` request to the endpoint with the workflow ID and a contact identifier:

```bash theme={null}
curl -X POST https://pub-api.conversion.ai/api/v2/workflows/{workflowId}/trigger \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "email": "jane@example.com"
  }'
```

The contact can be identified by `email`, `cnvContactId`, or `userId` — at least one is required. The workflow must be active and set to the API trigger type.

### Passing custom data

You can include a `data` object in the request body to pass custom data into the workflow. This data is accessible in Liquid as `trigger.api.data`:

```bash theme={null}
curl -X POST https://pub-api.conversion.ai/api/v2/workflows/{workflowId}/trigger \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "email": "jane@example.com",
    "data": {
      "source": "backend",
      "action": "onboarding_complete",
      "plan": "pro"
    }
  }'
```

You can then reference this data in workflow nodes that support Liquid:

```liquid theme={null}
{{ trigger.api.data.source }}
{{ trigger.api.data.plan }}
```

<Info>
  For the full list of available Liquid fields, see the [Trigger Context Reference](/product-docs/liquid/trigger-context-reference#api-triggers).
</Info>

## Re-enrollment

By default, contacts can only enter the workflow once. When you enable re-enrollment, contacts can enter the workflow each time the API is called, the same behavior as [event-based triggers](/product-docs/workflows/triggers/event-based).

## Exit conditions

Exit conditions define when a contact should leave the workflow early, regardless of where they are in the sequence. You configure exit conditions using the [Unified Query Engine](/product-docs/unified-query-engine/overview).
