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

# Segment

> Connect Segment to Iru Compliance with a Public API access token to collect workspace, source, destination, and tracking-plan evidence.

### About Segment

The **Segment Public API** backs this connector. Iru reads **workspace settings**, **sources and destinations**, **tracking plans**, and **membership** metadata - enough to evidence how customer data flows through Segment. The integration is **read-only** on the Iru side; it does not send events or change workspace configuration.

Only **Workspace Owners** can create Public API tokens in Segment.

### How It Works

Iru authenticates with a **Bearer** token (Segment **Public API access token**):

```http theme={null}
Authorization: Bearer YOUR_ACCESS_TOKEN
```

| Detail                   | Value                                  |
| ------------------------ | -------------------------------------- |
| **Category**             | Analytics / customer data              |
| **Authentication**       | Bearer token (Public API access token) |
| **Role to create token** | Workspace Owner                        |

Official references: [Segment Public API](https://segment.com/docs/api/public-api/), [API reference](https://docs.segmentapis.com/), and [Access Management](https://segment.com/docs/segment-app/iam/).

### Prerequisites

* **Workspace Owner** on the Segment workspace you need for compliance.
* A few minutes to create the token and paste it into Iru.

### Connect Segment to Iru

<Tabs>
  <Tab title="Segment">
    <Note>
      Complete this tab before you connect the source in Compliance.
    </Note>

    <Steps>
      <Step title="Sign in to Segment">
        Open [Segment](https://segment.com) and sign in with a user who can manage **workspace** tokens.
      </Step>

      <Step title="Open Settings">
        Select **Settings** (gear) from the Segment app chrome.
      </Step>

      <Step title="Open Workspace Settings">
        Choose **Workspace Settings** for the workspace Iru should read.
      </Step>

      <Step title="Open Access Management">
        Select **Access Management** (or **Members & access**), then open **Tokens**.
      </Step>

      <Step title="Create a token">
        Select **Create token** (or **New token**). Enter a name such as **Iru Compliance**.
      </Step>

      <Step title="Choose a token role">
        Pick a role aligned to least privilege:

        * **Workspace Owner**: Broad API access; use when you need full workspace visibility for audits.
        * **Workspace Member**: Narrower; may omit resources your program cares about.
      </Step>

      <Step title="Copy the token and store it safely">
        Create the token and **copy it immediately**. Segment shows it **once**. Treat it like a password until you paste it in **Iru Compliance**.

        Segment may **auto-revoke** tokens detected in public repositories; owners get notified.
      </Step>
    </Steps>

    <Note>
      Continue on the [**Iru Compliance**](#iru-compliance) tab.
    </Note>
  </Tab>

  <Tab title="Iru Compliance">
    <Note>
      Finish the [**Segment**](#segment) tab first.
    </Note>

    <Steps>
      <Step title="Open Sources">
        In Iru Compliance, on the left navigation bar, expand **Compliance** and select **Sources**.

        <Frame>
          <img src="https://mintcdn.com/iru/7HsGH7lnQ8GpVmI0/assets/media/images/iru-navigation-compliance-sources.png?fit=max&auto=format&n=7HsGH7lnQ8GpVmI0&q=85&s=595982441fd777b333b3ecfea24adc24" alt="Left navigation: Compliance expanded, Sources selected" width="424" height="1056" data-path="assets/media/images/iru-navigation-compliance-sources.png" />
        </Frame>
      </Step>

      <Step title="Turn on Segment">
        Find **Segment** (use **Category** or **Search by name or description**). On that card, turn on the **toggle**. A browser tab or window may open for the connector wizard.
      </Step>

      <Step title="Paste the Public API token">
        When the wizard asks for the token, paste the **Public API access token** and submit.
      </Step>

      <Step title="Finish the connection">
        Click **Submit Bearer Token**. When the connection succeeds, the wizard shows **Connection Configured**.
      </Step>

      <Step title="Confirm the source is Active">
        Close the **Iru is requesting access to external services** browser tab, then return to **Compliance** → **Sources** and confirm the **Segment** card is **Active**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Troubleshooting

<AccordionGroup>
  <Accordion title="Nothing opens when you turn the source on">
    Check **pop-up blocker** settings for the Iru site and try again.
  </Accordion>

  <Accordion title="401 Unauthorized">
    Copy the token exactly; confirm it was not deleted or auto-revoked.
  </Accordion>

  <Accordion title="Missing sources or destinations">
    Prefer a **Workspace Owner** token over a limited Member token.
  </Accordion>

  <Accordion title="Wrong workspace">
    Tokens are **workspace-scoped** - create the token in the workspace you connected in Iru.
  </Accordion>
</AccordionGroup>

### Considerations

<CardGroup cols={2}>
  <Card title="Tokens do not expire by default: rotate on a…" icon="circle-info">
    Tokens do not expire by default - rotate on a schedule and update Iru after rotation.
  </Card>

  <Card title="Multiple workspaces need separate Iru connections…" icon="shield">
    Multiple workspaces need **separate** Iru connections and tokens.
  </Card>
</CardGroup>

### Related Articles

<CardGroup cols={2}>
  <Card title="Sources Management" icon="plug" href="/en/compliance/sources-management">
    Browse and manage every Compliance source.
  </Card>

  <Card title="Getting Started With Compliance" icon="rocket" href="/en/compliance/getting-started-with-compliance">
    Frameworks, actions, and **Artifacts**.
  </Card>

  <Card title="Iru Overview" icon="layer-group" href="/en/iru/platform-overview/iru-overview">
    How Endpoint, Compliance, and Identity fit together.
  </Card>

  <Card title="Artifacts Management" icon="folder-open" href="/en/compliance/artifacts-management">
    Upload, review, and organize evidence from sources and actions.
  </Card>
</CardGroup>
