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

# Registration and verification

> Create an account, confirm phone via OTP, and get an API key without opening the dashboard.

<Tip>
  Register + OTP is the **front door**: without verifying your phone you won't receive the `apiKey` that unlocks the rest of the API.
</Tip>

The Platform API separates **account auth** from **API auth** (`apiKey`).

## What is `verificationToken`?

A **short-lived JWT (\~15 minutes)** returned when a second step is required. It is **not** the API key.

| Source                       | When                                               | Next step                                                             |
| ---------------------------- | -------------------------------------------------- | --------------------------------------------------------------------- |
| `POST /v1/platform/register` | After signup; OTP sent to phone                    | `POST /v1/platform/verify` with `code` (WhatsApp/SMS)                 |
| `POST /v1/platform/login`    | Account with **2FA**; `requiresSecondFactor: true` | **Another** `POST /v1/platform/login` with `totpCode` or `backupCode` |

<Warning>
  `POST /v1/platform/verify` is only for **phone OTP after register**. TOTP from an authenticator app goes in **`POST /login`**, not `verify`.
</Warning>

## Full flow for agents

### First account and first workspace

The **first workspace** is created automatically on phone verification — not on `register`.

```bash theme={null}
# Register → verify → apiKey + workspaceId
# See OpenAPI examples on POST /register, /verify, /login
```

### Second workspace

```bash theme={null}
curl -X POST https://api.notifique.dev/v1/workspaces \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "Staging", "color": "#3B82F6"}'
```

Requires `workspace:create` (or empty scopes during onboarding).

### Login with `workspaceId`

```bash theme={null}
curl -X POST https://api.notifique.dev/v1/platform/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "dev@company.com",
    "password": "SecurePass123!",
    "createApiKey": true,
    "workspaceId": "clws_02H..."
  }'
```

* Optional `workspaceId`: defaults to most recent OWNER workspace.
* Only workspaces where you are **OWNER** or **ADMIN** accept a new key via login.
* `createApiKey: false` → only `sessionToken`.

### 2FA login

**Step A** — email + password → `requiresSecondFactor` + `verificationToken`.

**Step B** — same endpoint with that token + `totpCode` (+ optional `createApiKey`, `workspaceId`).

## Register / verify / login summary

| Endpoint         | Purpose                                               |
| ---------------- | ----------------------------------------------------- |
| `POST /register` | Account + OTP; returns `verificationToken`            |
| `POST /verify`   | Phone OTP only; returns `apiKey`, first `workspaceId` |
| `POST /login`    | Credentials, 2FA completion, optional new API key     |

Next: [Quick start](/en/platform-api/como-funciona/quick-start) · [Workspaces](/en/platform-api/como-funciona/workspaces)
