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

# Organizations

> Tenants, resellers, and how access is scoped.

An **organization** is a tenant on the Apocor platform. Every resource — applicants, programs, cards, billing — belongs to exactly one organization, and your token is always scoped to the org (or orgs) it can access.

## Types

| Type       | Description                                               |
| ---------- | --------------------------------------------------------- |
| `DIRECT`   | A standard tenant that Apocor onboards directly           |
| `RESELLER` | A partner that onboards and manages its own child tenants |
| `MANAGED`  | A tenant managed on behalf of a reseller                  |

## Hierarchy

```mermaid theme={null}
flowchart TD
  A[Apocor] --> R[Reseller org]
  A --> D[Direct tenant]
  R --> C1[Child tenant]
  R --> C2[Child tenant]
```

A `RESELLER_ADMIN` can read and manage its own org plus every child org beneath it. A `DIRECT` tenant only ever sees itself.

## Onboarding a tenant

Platform and reseller admins onboard tenants with `POST /v1/organizations/onboard`. This creates the org, provisions an invited admin user, and emails an onboarding link.

```bash cURL theme={null}
curl -s -X POST 'https://sandbox.apocor.ai/v1/organizations/onboard' \
  -H 'Authorization: Bearer YOUR_TOKEN' -H 'Content-Type: application/json' \
  -d '{
    "name": "Acme Inc",
    "type": "DIRECT",
    "admin_name": "Alice Admin",
    "admin_email": "alice@acme.com"
  }'
```

The invited admin completes identity verification and sets a password through the public [onboarding flow](/api-reference) before their account activates.

## The current session

Call `GET /v1/me` to see which org and role the active token represents:

```json theme={null}
{
  "data": {
    "orgId": "org_abc123",
    "role": "ORG_ADMIN",
    "accessibleOrgIds": ["org_abc123"],
    "organization": { "id": "org_abc123", "name": "Acme Inc", "type": "DIRECT", "status": "ACTIVE" }
  }
}
```
