> For the complete documentation index, see [llms.txt](https://docs.codemash.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemash.io/cloud/membership/triggers/new.md).

# Create a trigger

**Where:** Membership → Triggers → New · `/projects/<project>/membership/triggers/new`

{% hint style="info" %}
Screenshot TODO — capture comes from testing-plan area **02-triggers**.
{% endhint %}

The form is a two-step flow: **If this** (the event) … **then** (the action).

## If this — pick the event

| Event                              | Fires                  |
| ---------------------------------- | ---------------------- |
| When registered (`OnRegistered`)   | A new user registers.  |
| When invited (`OnInvited`)         | A new user is invited. |
| When verified (`OnVerified`)       | A user is verified.    |
| When updated (`OnUpdated`)         | A user is updated.     |
| When deleted (`OnDeleted`)         | A user is deleted.     |
| When blocked (`OnBlocked`)         | A user is blocked.     |
| When reactivated (`OnReactivated`) | A user is reactivated. |

The user's data is passed to the action, so templates and payloads can use tokens from it.

## … then — pick the action

**Run Code** (invoke a serverless function), **Send Email**, **Send Push Notification**, **Send SMS** (all three from a template, with delivery settings for who receives it), **Call Webhook** (POST a signed event payload to your destinations — the webhook event name, e.g. `membership.user.registered`, is implied by the chosen event), or **Send In-App (Realtime / SSE)** (deliver live to connected apps or AI agents). Each action opens its own settings block.

## Finish

Set the **Order** (lower numbers run earlier when several triggers share an event) and optionally **Break execution queue on failure**. Then **Name the trigger** (e.g. `When user registers, send welcome email`), add a **Description**, and switch **Is this trigger enabled?** on when it is ready. Saving returns you to the list.

How triggers work in general — events, action types, and delivery settings — is explained in [Triggers](/other-topics/triggers.md).

## Use it from code

[Membership → Triggers](/sdks-and-cli/membership/triggers.md)

## API reference

Endpoints: [Save Membership Trigger](/api-reference/membership/triggers/save-membership-trigger.md).
