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

# Find your resources

> Discover the business organization and locations available to your API key.

Start an integration by asking the API which resources your key can access. Keep the returned IDs and use them in later requests.

## List accessible locations

`GET /v1/locations` is the best discovery request for every key type. It requires `location.read`.

```bash theme={null}
curl https://server.chataigne.ai/v1/locations \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

* With a business-organization-scoped key, the response contains the accessible child locations.
* With a location-scoped key, the response contains that one location.

The endpoint returns a paginated list. Follow `has_more` and use `starting_after` when you need the next page.

## Retrieve one location

Use a location ID from the list with `GET /v1/locations/{location_id}`. This also requires `location.read`.

```bash theme={null}
curl https://server.chataigne.ai/v1/locations/loc_r8v4n2c6tz \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

The request returns `404` when the ID does not exist or is outside the key's scope.

## List accessible organizations

`GET /v1/organizations` requires `businessOrganization.read` and returns a paginated list containing zero or one organization:

```bash theme={null}
curl https://server.chataigne.ai/v1/organizations \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

| Key scope             | Result                                               |
| --------------------- | ---------------------------------------------------- |
| Business organization | The organization in scope.                           |
| Location              | An empty list. Location access does not flow upward. |

An empty organization list is therefore valid and does not mean the location call will also be empty.

## Retrieve one organization

Use the returned organization ID with `GET /v1/organizations/{organization_id}`. It requires `businessOrganization.read`.

```bash theme={null}
curl https://server.chataigne.ai/v1/organizations/busorg_k3m9x2p7qw \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

Add `expand[]=locations` to include complete location objects alongside the organization's location IDs:

```bash theme={null}
curl "https://server.chataigne.ai/v1/organizations/busorg_k3m9x2p7qw?expand[]=locations" \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

## List locations in an organization

When you already know the organization ID, call `GET /v1/organizations/{organization_id}/locations`. It requires `location.read`.

```bash theme={null}
curl https://server.chataigne.ai/v1/organizations/busorg_k3m9x2p7qw/locations \
  -H "x-api-key: $CHATAIGNE_API_KEY"
```

This gives a location list constrained to the organization in the URL. Use the top-level `GET /v1/locations` when you simply need every location your key can access.

## Choose the right discovery call

| Goal                              | Endpoint                                            | Permission                  |
| --------------------------------- | --------------------------------------------------- | --------------------------- |
| Find every accessible location    | `GET /v1/locations`                                 | `location.read`             |
| Retrieve one location             | `GET /v1/locations/{location_id}`                   | `location.read`             |
| Find the organization in scope    | `GET /v1/organizations`                             | `businessOrganization.read` |
| Retrieve one organization         | `GET /v1/organizations/{organization_id}`           | `businessOrganization.read` |
| List one organization's locations | `GET /v1/organizations/{organization_id}/locations` | `location.read`             |

See [Pagination](/concepts/pagination) for complete cursor options and [Expanding objects](/concepts/expanding-objects) for expansion behavior.

<Card title="Manage a location" icon="store" href="/location-organization-management/overview">
  Use the discovered IDs to update profiles and operational settings.
</Card>
