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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> To translate a template, write one locale at a time with `PUT /notifications/{id}/locales/{localeId}`, which merges into the existing translations. `PUT /notifications/{id}/content` and `PUT /notifications/{id}/elements/{elementId}` overwrite translations along with the content, so send each element's `id` and `locales` back, and first remove every `checksum` and any `locales` key that starts with an underscore.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Create your first journey

> Build a journey with one send node in the Journeys console, invoke it from your code through the API Invoke trigger, and read the run node by node in Logs.

Build the smallest journey that works, start a run from your code, then open the run and read what it did.

One send node is enough to see the whole loop. Delays, branches, and digests are the same graph with more nodes on it.

To build a journey entirely with the API instead, see [Build your first journey](https://www.courier.com/docs/get-started/build-your-first-journey.md).

## Prerequisites

* [A connected email provider](https://www.courier.com/docs/integrations/email/overview.md)
* [A Courier API key](https://app.courier.com/settings/api-keys)

## Build it

**1. Create the journey**

Open [Journeys](https://app.courier.com/orchestration/journeys), select **New Journey**, and name it. Choose the **API Invoke** trigger, which is what lets your code start each run.

**2. Add one send node**

Drop a **send** node on the canvas, pick email, and select **+ Create** to write its content inline. Each send node owns one Template scoped to this journey, so there is nothing to create separately.

Address the recipient by `user_id`. The profile supplies the email address, which means preferences apply and the address can change without touching this journey.

**3. Publish**

Select **Publish**. That locks the draft as a version and makes it the one new runs use. Copy the journey ID from the editor.

## Invoke it

[Invoke a Journey](https://www.courier.com/docs/journeys/invoke.md) carries the call in every language. The response returns a `runId`, which is the handle for everything below.

Send an `Idempotency-Key` if the call sits anywhere a retry could reach it, because a repeated key returns the stored result instead of starting a second run.

## Read the run

**Inspect runs in the console.** Take the `runId` from the invoke response, open the journey's **Logs** tab, and search for it.

The detail view draws each node's outcome on the graph. Click a node to see its step context: the input data, the profile, any conditions evaluated, and the output. [Journey logs](https://www.courier.com/docs/monitor/logs.md#journey-logs) cover the run states and what each view shows.

A journey that sends nothing looks identical to one that was never invoked until you open the run and see which node it stopped at.

## Verify

**1. The run completed**

Invoke for a test user, then confirm the run reads as complete rather than sitting on the send node.

**2. The message arrived**

Check the inbox for the address on that user's profile, then open [message logs](https://www.courier.com/docs/monitor/overview.md) and confirm the send is recorded against the journey.

**3. A second invoke starts a second run**

Invoke again without an `Idempotency-Key` and confirm two runs appear. Repeat with the same key and confirm only one does.

## What to add next

> [card] [Onboarding sequence](https://www.courier.com/docs/guides/build-an-onboarding-sequence.md)
>
> Delays and a branch, so only stalled users get nudged.

> [card] [Nodes](https://www.courier.com/docs/journeys/nodes.md)
>
> Every node type, one page each.

## Publish your changes

* **Publish the template to ship a content edit.** Editing a send node saves a template draft. A run sends the template's published version, and publishing the journey doesn't publish its templates.
* **Runs finish on the version they started with.** A new publish applies to runs that start after it.
* **Only a published journey runs.** Publish before you invoke.
