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

# Data model

> Organizations, projects, channels and identifiers: how Routa resources relate to each other.

Understanding the resource hierarchy helps you pick the right API key and read the identifiers the API returns.

## Hierarchy

```text theme={null}
Organization
└── Project
    ├── API keys
    ├── Channels
    │   └── Templates
    ├── Messages
    ├── Media
    ├── Events
    ├── Webhook endpoints
    └── Usage
```

> [accordion] Organization
>
> The root of billing and ownership. It holds the team members, the plan and the projects. People join an organization with a role (Owner, Admin, Billing, Developer or Viewer).

> [accordion] Project
>
> The **isolation boundary**. Every resource and every API key belongs to exactly one project, and nothing is read across projects. A project has an environment, `live` or `test` (see [Environments](https://docs.routa.chat/en/environments.md)).

> [accordion] Channel
>
> A communication address configured inside a project, for example a WhatsApp number. Do not confuse it with the channel *type*: today the only type is `whatsapp`. A channel is identified by `chan_...`, which is the `channel` field of send calls.

## Channels

A channel sends messages only when it is `active`.

| Status | Meaning |
| - | - |
| `pending` | Connection in progress. |
| `active` | Connected and able to send. |
| `degraded` | Routa cannot authenticate with the provider (an expired credential, for example). Reconnect or rotate the credential in the dashboard. |
| `disabled` | Disabled: by your team in the dashboard, because the customer disconnected the number in the WhatsApp Business app, or because the provider removed the account. It does not send. You are the one who enables it again, in the dashboard. |

Sending through a channel that is not `active` returns `422` with the `channel_inactive` code. State changes, including re-enabling a `disabled` channel, produce the `channel.status_changed` event. See [the event fields](https://docs.routa.chat/en/webhooks/event-types.md#channel-events).

### Connection mode

A channel has a connection mode, which appears in `connection_mode` on the `channel.status_changed` event:

| Mode | Meaning |
| - | - |
| `cloud_api` | Only Routa uses the number. |
| `coexistence` | The number stays in the WhatsApp Business app, and the business can send and receive there. See [Messages sent from the WhatsApp Business app](https://docs.routa.chat/en/concepts/messages.md#messages-sent-from-the-whatsapp-business-app). |

> [!NOTE]
>
> You connect and manage channels in the dashboard. The API never returns provider credentials.

## Identifiers

Every resource has an identifier made of a prefix followed by a 26-character [ULID](https://github.com/ulid/spec). ULIDs sort by time, are safe in URLs and are easy to spot in logs.

| Prefix | Resource |
| - | - |
| `org_` | Organization |
| `proj_` | Project |
| `key_` | API key |
| `chan_` | Channel |
| `msg_` | Message |
| `evt_` | Event |
| `tmpl_` | Template |
| `med_` | Media object |
| `tmedia_` | Template header media |
| `whe_` | Webhook endpoint |
| `whd_` | Webhook delivery |
| `req_` | Request (appears in logs and errors) |

> [!NOTE]
>
> Treat identifiers as opaque strings. Do not parse them or assume their length, only the prefix.

## Isolation between projects

The API authenticates each key into exactly one project, and every query is filtered by it. A resource of another project responds `404`, never `403`, so its existence does not leak.

## Compatibility with new fields

Within version `v1`, Routa only makes additive changes: new endpoints, new optional fields and new response fields. **Ignore unknown fields** in responses, and ignore event types you do not recognize. See [Versioning](https://docs.routa.chat/en/api-reference/introduction.md#versioning).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.