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

# Read integration access

> Look up the Auth0 organization id, audience, and OAuth scopes needed to register a Login with Delogue integration.

<Info>
  **When to use this.** Before a third-party client can obtain org-scoped tokens through the
  "Login with Delogue" flow, its administrator needs three values: the organisation's Auth0
  organization id, the Auth0 tenant domain, and the Delogue.API audience. This read-only endpoint
  hands those to a company administrator, along with the OAuth scopes available today.
</Info>

## The workflow

Integration access is a per-organisation lookup. A company administrator reads the values here,
then configures the external OAuth client with them.

<Steps>
  <Step title="Read integration access">
    `GET /api/organizations/{organizationId}/integration-access` for your own organisation.
  </Step>

  <Step title="Register the OAuth client">
    Configure the third-party client with the returned `auth0Domain`, `auth0OrgId`, and
    `audience`, requesting the `scopes` you need.
  </Step>

  <Step title="Start the org-scoped login">
    Pass `auth0OrgId` as the `organization` login parameter so tokens are scoped to the
    organisation.
  </Step>
</Steps>

```mermaid theme={"dark"}
sequenceDiagram
  participant A as Company admin
  participant API as Delogue API
  A->>API: GET /api/organizations/{organizationId}/integration-access
  API-->>A: auth0OrgId, auth0Domain, audience, scopes
```

## Walkthrough

Look up the integration-access info for your organisation. The response wraps the values in the
standard envelope.

<CodeGroup>
  ```bash cURL theme={"dark"}
  curl "https://service.my.delogue.com/api/organizations/{organizationId}/integration-access" \
    -H "Accept: application/json" \
    -H "X-Auth-Token: Bearer YOUR_API_KEY"
  ```

  ```js JavaScript theme={"dark"}
  const res = await fetch("https://service.my.delogue.com/api/organizations/{organizationId}/integration-access", {
    method: "GET",
    headers: {
      "Accept": "application/json",
      "X-Auth-Token": "Bearer YOUR_API_KEY",
    },
  });
  const { data } = await res.json();
  ```
</CodeGroup>

```json theme={"dark"}
{
  "status": "success",
  "code": "integration_access_retrieved",
  "data": {
    "auth0OrgId": "org_a1B2c3D4e5F6g7H8",
    "auth0Domain": "example-tenant.eu.auth0.com",
    "audience": "https://api.delogue.com",
    "scopes": [
      "openid",
      "profile",
      "email",
      "offline_access",
      "read:profile",
      "read:styles"
    ]
  }
}
```

Hand `auth0OrgId`, `auth0Domain`, and `audience` to whoever configures the external OAuth client;
`scopes` lists what that client may request.

## Field reference

The fields returned by the lookup:

| Field         | What it means at Delogue                                                                                         |
| ------------- | ---------------------------------------------------------------------------------------------------------------- |
| `audience`    | The Delogue.API audience (API identifier) a third-party client must request in its token.                        |
| `auth0Domain` | The Auth0 tenant domain to authenticate against, e.g. your-tenant.auth0.com.                                     |
| `auth0OrgId`  | The Auth0 organization id to pass as the "organization" login parameter when starting the org-scoped login flow. |
| `scopes`      | The OAuth scopes available to Login with Delogue integrations today.                                             |

## Roles & permissions

This endpoint is available only to a **`CompanyAdmin`** on a **designer (brand)** organisation,
and only for that admin's **own** organisation id — any other id is denied. It is gated behind the
Auth0 organisations feature, so it returns a 403 where that feature is not enabled. Supplier
accounts have no access.

## When things go wrong

Errors use the standard envelope (`status: "error"`, a `code`, and `error.details[]`). An
organisation that has not yet been provisioned in Auth0 returns a 404, and a caller who is not a
company administrator, is on a supplier organisation, or requests another organisation's id
receives a 403. See [Errors & responses](/concepts/errors) for the full list of codes and how to
resolve them.

## What to call next

<CardGroup cols={2}>
  <Card title="Authentication" href="/authentication">
    How to get and send your `X-Auth-Token` API key.
  </Card>

  <Card title="Styles" href="/guides/styles">
    The `read:styles` scope lets an integration read styles: `GET /api/styles`.
  </Card>
</CardGroup>
