# Quickstart

> Create a disposable inbox, send a code to it, and get the parsed OTP back from one blocking API call. It takes about two minutes and uses only curl.

## 1. Get an API key

Sign up at [api.usehumanless.com/app](https://api.usehumanless.com/app) and create an API key. Keys start with `hl_live_`. Export it so the examples below can use it:

```bash
export HUMANLESS_API_KEY="hl_live_..."
```

Send the key as a Bearer token on every request: `Authorization: Bearer hl_live_...`. Keep it secret. Store it in your CI secret store, not in your repository.

## 2. Create an identity

```bash
curl -s -X POST https://api.usehumanless.com/v1/identities \
  -H "Authorization: Bearer $HUMANLESS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channels":["email"]}' | tee identity.json

export ID=$(jq -r .identity_id identity.json)
```

The response is `201 Created`. The second command saves its `identity_id` as `$ID` for steps 4 and 5 (no `jq`? Copy the `identity_id` value and run `export ID=<identity_id>`):

```json
{
  "identity_id": "5b0d7c1e-8f2a-4c1b-9a63-2f1d0e7c4b11",
  "channels": ["email"],
  "email": "hl-k3j9x2m1qa@inbox.example",
  "phone": null,
  "totp_secret": null,
  "status": "active",
  "expires_at": "2026-12-03T13:00:00.000Z",
  "created_at": "2026-12-03T12:00:00.000Z",
  "ended_at": null
}
```

Free accounts can use `email` and `totp`. To get a dedicated US phone number, add `"sms"`. That needs a paid plan or prepaid credits.

## 3. Make your app send a code

Type the `email` into the sign-up or login form of the app you're testing and submit it, by hand or from your test. Any message sent to that address is delivered to this identity.

## 4. Wait for the code

```bash
curl -s "https://api.usehumanless.com/v1/identities/$ID/wait?channel=email&timeout=60" \
  -H "Authorization: Bearer $HUMANLESS_API_KEY"
```

The request stays open until a message arrives, then returns it with the code or link already extracted:

```json
{
  "type": "otp",
  "code": "482913",
  "url": null,
  "channel": "email",
  "sender": "Acme <no-reply@acme.test>",
  "subject": "Confirm your Acme account",
  "received_at": "2026-12-03T12:00:04.512Z",
  "raw_snippet": "Your Acme verification code is 482913. It expires in 10 minutes."
}
```

If nothing arrives within `timeout` seconds (60 at most), the API returns `408` with error code `timeout`. Call it again.

## 5. Clean up

```bash
curl -s -X DELETE https://api.usehumanless.com/v1/identities/$ID \
  -H "Authorization: Bearer $HUMANLESS_API_KEY"
```

Identities also expire on their own at `expires_at` (1 hour by default). Delete SMS identities as soon as you're done so your dedicated number is free for the next test.

## Next steps

- Write it as a test: [Playwright guide](https://usehumanless.com/docs/playwright)
- Give it to an agent: [MCP server](https://usehumanless.com/docs/mcp)
- Every parameter and error: [REST API reference](https://usehumanless.com/docs/api)
- Typed client: [TypeScript SDK](https://usehumanless.com/docs/sdk)

---
Canonical: https://usehumanless.com/docs/quickstart · Index of all docs: https://usehumanless.com/llms.txt
