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

# Get Aggregate

Retrieve the details of a specific sub-tenant (aggregate) by its ID.

---

## Endpoint

```
GET /api/v3/aggregates/{id}
```

---

## Path Parameters

| Parameter | Type   | Description           |
| --------- | ------ | --------------------- |
| `id`      | string | Aggregate's tenant ID |

## Query Parameters

| Parameter | Type   | Description                                     |
| --------- | ------ | ----------------------------------------------- |
| `include` | string | Comma-separated list of extra fields: `api_key` |

---

## Response

### Success Response (200 OK)

```json
{
  "data": {
    "id": 42,
    "slug": "my-bookstore",
    "name": "My Bookstore",
    "final_domain": "mybookstore.publica.la",
    "lang": "en",
    "timezone": "America/New_York",
    "support_email": "support@mybookstore.com",
    "primary_color": "#336699",
    "secondary_color": "#FF6600",
    "reader_accent_color": "#0066CC",
    "reader_flashcards_enabled": true,
    "logo_url": "https://assets.publica.la/my-bookstore/logo/logo.png",
    "icon_url": "https://assets.publica.la/my-bookstore/icons/icon.png",
    "disable_selling": false,
    "landing_enabled": true,
    "storefront_redirect": {
      "enabled": false,
      "url": null
    },
    "external_auth": {
      "enabled": true,
      "issuer": "my-platform",
      "redirect_url": "https://my-platform.com/auth-error",
      "login_url": null,
      "logout_url": null,
      "home_url": null,
      "account_url": null
    },
    "created_at": "2026-03-24T15:30:00+00:00"
  }
}
```

:::info Auth token key is write-only
The `external_auth` object reports the configured auth token (SSO) fields and an `enabled` flag, but never the `key`. Configure the key through [create](./aggregates-v3-create.md) or [update](./aggregates-v3-update.md).
:::

---

## Examples

### Get by ID

```bash
curl -X GET "https://yourstore.publica.la/api/v3/aggregates/42" \
  -H "X-User-Token: your-api-token" \
  -H "Accept: application/json"
```

### Get with API Key

```bash
curl -X GET "https://yourstore.publica.la/api/v3/aggregates/42?include=api_key" \
  -H "X-User-Token: your-api-token" \
  -H "Accept: application/json"
```

---

## Error Handling

### Not Found (404)

Returned when the aggregate does not exist or does not belong to your store:

```json
{
  "message": "Not found."
}
```

:::info Tenant Isolation
You can only retrieve aggregates that belong to your store. Attempting to access another aggregator's tenant returns a 404, not a 403, to avoid leaking information about other tenants.
:::

### Authentication Errors (401)

```json
{
  "message": "Unauthenticated."
}
```

### Authorization Errors (403)

```json
{
  "message": "Tenant does not have aggregation capabilities."
}
```

---

## See Also

- [List Aggregates](./aggregates-v3-list.md) - List all aggregates
- [Update Aggregate](./aggregates-v3-update.md) - Modify configuration
- [Overview](./aggregates-v3-overview.md) - API overview
