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

# Detect Organization IDs

> Find the organization ID your app already sends in events or contact attributes

# Detect Organization IDs

If your app already sends an organization ID, such as `workspaceId` on events or `account_id` on contacts, you can create accounts from it without writing code. This endpoint finds those keys. [Preview](/api-reference/accounts/organization-ids-preview) a key to see the accounts it would create, then [create them](/api-reference/accounts/organization-ids-create). See [Accounts](/concepts/accounts).

It looks at event properties from the last 180 days and at contact attributes whose names look like an organization ID, such as `workspaceId`, `organization_id`, `team_id`, `tenantId` or `account_id`. A key needs at least two distinct values. Nothing is created.

Requires the `subscribers:read` scope.

## Request

```bash theme={null}
curl "https://api.sequenzy.com/api/v1/account-suggestions/organization-ids" \
  -H "Authorization: Bearer API_KEY"
```

## Response

<ResponseField name="candidates" type="array">
  Detected keys, most useful first. Empty when none are found.

  <Expandable title="properties">
    <ResponseField name="source" type="string">
      `event` for an event property, `attribute` for a contact attribute.
    </ResponseField>

    <ResponseField name="propertyKey" type="string">
      The property or attribute holding the organization ID.
    </ResponseField>

    <ResponseField name="nameKey" type="string | null">
      A sibling property holding the organization name, such as
      `workspaceName`, when one is found.
    </ResponseField>

    <ResponseField name="eventCount" type="number">
      Events carrying the key for `event`, contacts with the attribute for
      `attribute`.
    </ResponseField>

    <ResponseField name="accountCount" type="number">
      Distinct organizations, which is how many accounts creating would make.
    </ResponseField>

    <ResponseField name="eventNames" type="string[]">
      Up to 8 event names carrying the key. Empty for attributes.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "candidates": [
      {
        "source": "event",
        "propertyKey": "organization_id",
        "nameKey": null,
        "eventCount": 2518,
        "accountCount": 843,
        "eventNames": ["signed_in", "project_created"]
      }
    ]
  }
  ```

  ```json 401 theme={null}
  { "success": false, "error": "Unauthorized" }
  ```

  ```json 403 theme={null}
  { "success": false, "error": "No company selected" }
  ```
</ResponseExample>
