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

# Quick Start

> Register an event, build a simple journey, and trigger via API.

<Tip>
  **Event** = fact name (`user.created`). **Automation** = graph with trigger + steps. Trigger with **Send event** and use **`Idempotency-Key`** against duplicates.
</Tip>

## In short

* One **`trigger`** step per flow; links in **`connections`**
* **`condition`** step: always `"true"` and `"false"` outputs
* Sends in the flow need channel scopes (`email:send`, etc.)

Context: [Introduction](/en/automations-api/como-funciona/introducao). Scopes: [API Key scopes](/en/automations-api/como-funciona/escopos-da-api-key).

## Before you start

* Scopes: `events:read`, `events:write`, `automations:read`, `automations:write`
* At least **one template** created (note the IDs)
* Auth: `Authorization: Bearer sk_live_...` or `x-api-key`
* Base URL: `https://api.notifique.dev`

***

## 1. Register the event

#### 1A, Dashboard

**Automations → Events** → register the name and payload schema (optional).

#### 1B, API

Scope: **`events:write`**.

```http theme={null}
POST /v1/events
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "name": "user.created",
  "schemaJson": {
    "userId": "string",
    "plan": "string"
  }
}
```

`schemaJson` is optional, when present, it validates `payload` on trigger.

***

## 2. Create the automation

Scope: **`automations:write`**.

```http theme={null}
POST /v1/automations
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

Example: welcome + email after 3 days.

```json theme={null}
{
  "name": "Welcome and tips in 3 days",
  "status": "ENABLED",
  "graph": {
    "steps": [
      {
        "stepKey": "t1",
        "stepType": "trigger",
        "config": { "eventName": "user.created" }
      },
      {
        "stepKey": "sWelcome",
        "stepType": "sendTemplate",
        "config": {
          "templateId": "YOUR_WELCOME_TEMPLATE_ID",
          "channels": ["email"],
          "variables": { "name": "{{plan}}" }
        }
      },
      {
        "stepKey": "d1",
        "stepType": "delay",
        "config": { "durationMs": 259200000 }
      },
      {
        "stepKey": "sTips",
        "stepType": "sendTemplate",
        "config": {
          "templateId": "YOUR_TIPS_TEMPLATE_ID",
          "channels": ["email"],
          "variables": { "name": "{{plan}}" }
        }
      }
    ],
    "connections": [
      { "from": "t1", "to": "sWelcome" },
      { "from": "sWelcome", "to": "d1" },
      { "from": "d1", "to": "sTips" }
    ]
  }
}
```

`259200000` ms = 3 days. Replace template IDs.

***

## 3. Trigger the event

Scope: **`events:write`**. Optional header: `Idempotency-Key: onboarding-001`

```http theme={null}
POST /v1/events/send
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
Idempotency-Key: onboarding-001
```

```json theme={null}
{
  "event": "user.created",
  "email": "new.user@example.com",
  "payload": {
    "userId": "usr_123",
    "plan": "pro"
  }
}
```

Recipient: **one** of `contactId`, `email`, or `phone` (E.164).

Expected response:

```json theme={null}
{
  "success": true,
  "data": {
    "runs": [
      { "runId": "clxx...", "automationId": "clyy..." }
    ]
  }
}
```

Multiple automations on the same `eventName` → **multiple** runs.

***

## 4. List runs

Scope: **`automations:read`**.

```http theme={null}
GET /v1/automations/:id/runs
Authorization: Bearer sk_live_xxxxx
```

Single run: `GET /v1/automations/:automationId/runs/:runId`, see **Automations and events** spec in the menu.

***

## Next steps

* [Events](/en/automations-api/como-funciona/eventos): naming and payload tips
* [Assistants](/en/automations-api/como-funciona/assistentes): AI step in the graph
* [Use cases](/en/automations-api/como-funciona/casos-de-uso)
* [Templates](/en/template-api/como-funciona/quick-start)
