> ## 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`, the default import of the v7 Node SDK. 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.
> 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.

# Start a journey from Segment

> Turn Segment track events into Courier journeys without writing send code.

export const Tags = ({items}) => {
  const routes = {
    Email: "/integrations/email/overview",
    SMS: "/integrations/sms/overview",
    Push: "/integrations/push/overview",
    Inbox: "/in-app/overview",
    Chat: "/integrations/direct-message/overview",
    Templates: "/design/templates/overview",
    Variables: "/design/templates/variables",
    Elemental: "/design/elemental/overview",
    Brands: "/design/brands",
    Translations: "/design/elemental/locales",
    Routing: "/send/routing",
    Preferences: "/recipients/preferences/overview",
    Journeys: "/journeys/overview",
    Broadcasts: "/broadcasts/overview",
    Tenants: "/tenants/overview",
    Logs: "/monitor/overview",
    Webhooks: "/monitor/webhooks/outbound",
    Lists: "/recipients/lists-and-audiences/overview",
    Users: "/recipients/overview",
    Digests: "/journeys/nodes/digest",
    Environments: "/workspaces/overview",
    MCP: "/resources/mcp"
  };
  const icons = {
    Email: "envelope",
    SMS: "comment",
    Push: "mobile",
    Inbox: "inbox",
    Chat: "comments",
    Templates: "pen-ruler",
    Variables: "pen-ruler",
    Elemental: "pen-ruler",
    Brands: "pen-ruler",
    Translations: "pen-ruler",
    Routing: "paper-plane",
    Preferences: "users",
    Journeys: "route",
    Broadcasts: "bullhorn",
    Tenants: "building",
    Logs: "chart-simple",
    Webhooks: "chart-simple",
    Lists: "users",
    Users: "users",
    Digests: "route",
    Environments: "briefcase",
    MCP: "toolbox"
  };
  const base = "https://d3gk2c5xim1je2.cloudfront.net/fontawesome/v7.2.0/regular/";
  const names = String(items || "").split(",").map(entry => entry.trim()).filter(Boolean);
  return <div className="cx-tags">
      {names.map(name => {
    const href = routes[name];
    const icon = icons[name];
    const url = icon ? "url(" + base + icon + ".svg)" : null;
    const style = url ? {
      "--cx-tag-icon": url
    } : null;
    if (!href) {
      return <span className="cx-tag" data-icon={icon} style={style} key={name}>
              {name}
            </span>;
    }
    return <a className="cx-tag" data-icon={icon} style={style} href={href} key={name}>
            {name}
          </a>;
  })}
    </div>;
};

export const AppLink = ({href, children, name, bare}) => {
  const label = children || name || "Open in Courier";
  if (bare) {
    return <a href={href} target="_blank" rel="noreferrer">{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="app" href={href} target="_blank" rel="noreferrer">
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method" aria-hidden="true">↗</span>
    </a>;
};

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

<Tags items="Journeys" />

Turn the events you already track into notifications, without writing any send code.

Connect Courier as a Segment destination and start a journey from a matching event. Segment forwards each event, its `userId` locates the recipient, and its `properties` become the journey's `data`.

## What you will build

```mermaid theme={null}
flowchart LR
    A["App event"] --> B["Segment"]
    B --> C["Courier destination"]
    C --> D{"Conditions pass?"}
    D -->|Yes| E["Journey sends"]
    D -->|No| F["No run"]
```

## Prerequisites

* A Segment workspace sending Track, Identify, or Group events
* <AppLink href="https://app.courier.com/signup">A Courier account</AppLink>
* <Doc href="/docs/journeys/overview">A journey to run</Doc>

## Set it up

<Steps>
  <Step title="Connect Courier as a Segment destination">
    In Segment, add Courier as a destination and point it at your workspace. See the <Doc href="/docs/integrations/cdp/segment">Segment integration</Doc> for the connection details.
  </Step>

  <Step title="Create a journey with a Segment trigger">
    In the console, <Doc href="/docs/journeys/build">build a journey</Doc> and choose the **Segment** trigger. Select the source event (for example `Order Completed`). No schema is required. Courier receives whatever Segment sends.
  </Step>

  <Step title="Narrow with conditions (optional)">
    Add trigger conditions to run only for the events you want, for example `properties.total > 100`. Only events that pass all conditions start the journey.
  </Step>

  <Step title="Design the flow and publish">
    Add send nodes and any delays or branches, referencing the event data as variables, then publish. See <Doc href="/docs/journeys/overview">Journeys</Doc> for the runtime model.
  </Step>
</Steps>

## Verify

<Steps>
  <Step title="Fire the event">
    Trigger the event in your app, or replay it from Segment, and confirm a run appears in the journey's **Logs** tab.
  </Step>

  <Step title="Check the data came through">
    Open the run and confirm the event's properties arrived as its `data`. A send node rendering empty variables usually means the property names differ from what the template expects.
  </Step>

  <Step title="Confirm the message delivered">
    Step through the run to the send node, then find the message in <AppLink href="https://app.courier.com/logs">Logs</AppLink>.
  </Step>
</Steps>

<Note>
  A Segment `track` event's `userId` must be a valid Courier user for the journey to run. Identify users to Courier first, or make sure the `userId` matches a stored profile.
</Note>
