Consumer API
Human-facing endpoints for individual consumers. Unlike the agent API which uses API keys, the consumer API uses passwordless magic-link authentication to create browser sessions.
The agent API authenticates with Authorization: Bearer aid_* API keys scoped to an organization and project. The consumer API uses magic-link email verification to establish a session cookie. Consumer sessions are bound to a single user and automatically provision a personal org and project on signup.
Sign up
Create a new consumer account. A magic-link verification email is sent to the provided address.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Personal email address for the consumer account |
curl
curl -X POST https://api.aidenid.com/v1/consumer/signup \
-H "Content-Type: application/json" \
-d '{ "email": "alice@example.com" }'Response 200 OK
{
"message": "Verification email sent",
"email": "alice@example.com"
}Verify magic link
Exchange a magic-link token for a consumer session. The token is delivered via the magic-link email sent during signup or login.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Magic-link token from the verification email |
curl
curl -X POST https://api.aidenid.com/v1/consumer/verify \
-H "Content-Type: application/json" \
-d '{ "token": "ml_abc123def456" }'Response 200 OK
{
"consumer_id": "csr_m1n2o3p4",
"org_id": "org_personal_m1n2o3p4",
"project_id": "proj_default_m1n2o3p4",
"session_token": "sess_q5r6s7t8",
"expires_at": "2026-04-13T10:00:00Z"
}Request login
Send a new magic-link login email to an existing consumer. The resulting token is verified via the same /verify endpoint.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address of the existing consumer account |
curl
curl -X POST https://api.aidenid.com/v1/consumer/login \
-H "Content-Type: application/json" \
-d '{ "email": "alice@example.com" }'Response 200 OK
{
"message": "Login email sent",
"email": "alice@example.com"
}Inbox stream (SSE)
Server-Sent Events stream of inbound email events and OTP extractions for the authenticated consumer. Requires a valid consumer session.
curl
curl -N "https://api.aidenid.com/v1/consumer/inbox" \
-H "Authorization: Bearer sess_q5r6s7t8"TypeScript
const evtSource = new EventSource(
"https://api.aidenid.com/v1/consumer/inbox",
// Note: EventSource does not support custom headers natively.
// Use a library like eventsource or pass the session as a query param
// if your backend supports it.
);
evtSource.addEventListener("inbound.received", (e) => {
const data = JSON.parse(e.data);
console.log("Inbound event received for identity:", data.identity_id);
});
evtSource.addEventListener("extraction.completed", (e) => {
const data = JSON.parse(e.data);
console.log("Extraction completed:", data.type);
});Event types
| Event | Description |
|---|---|
inbound.received | A new email arrived at one of the consumer's identity inboxes |
extraction.completed | An OTP or verification code was extracted from an email |
List identities
List the authenticated consumer's temporary email identities. Supports pagination.
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Max results per page (default: 20, max: 100) |
offset | integer | No | Pagination offset |
curl
curl "https://api.aidenid.com/v1/consumer/identities?limit=10&offset=0" \
-H "Authorization: Bearer sess_q5r6s7t8"Response 200 OK
{
"items": [
{
"id": "ident_c1d2e3f4",
"email": "c1d2e3f4@inbox.aidenid.com",
"label": "twitter-signup",
"status": "active",
"created_at": "2026-04-06T08:00:00Z",
"expires_at": "2026-04-07T08:00:00Z"
}
],
"total": 1,
"limit": 10,
"offset": 0
}Create identity
Create a new temporary email identity for the consumer. The number of active identities is limited by the consumer's tier.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Human-readable label for the identity |
curl
curl -X POST https://api.aidenid.com/v1/consumer/identities \
-H "Authorization: Bearer sess_q5r6s7t8" \
-H "Content-Type: application/json" \
-d '{ "label": "twitter-signup" }'Trial consumers can create up to 3 active identities. Paid consumers (human_paid plan) can create up to 10. Use the upgrade endpoint to increase limits.
List notifications
Retrieve notification history for the authenticated consumer, including extraction alerts and identity expiration warnings.
curl
curl "https://api.aidenid.com/v1/consumer/notifications" \
-H "Authorization: Bearer sess_q5r6s7t8"Response 200 OK
{
"items": [
{
"id": "notif_u1v2w3",
"type": "extraction.completed",
"title": "OTP received for twitter-signup",
"body": "A redacted code was extracted with 99% confidence",
"read": false,
"created_at": "2026-04-06T10:05:02Z"
}
],
"total": 1,
"limit": 20,
"offset": 0
}Upgrade to paid plan
Start a Stripe checkout session to upgrade the consumer to the human_paid plan. Returns a checkout URL to redirect the user to.
curl
curl -X POST https://api.aidenid.com/v1/consumer/upgrade \
-H "Authorization: Bearer sess_q5r6s7t8"Response 200 OK
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_..."
}Error codes
| Code | Status | Description |
|---|---|---|
email_already_registered | 409 | A consumer account with this email already exists |
invalid_magic_link | 401 | The magic-link token is invalid or expired |
session_expired | 401 | The consumer session has expired — request a new login |
identity_limit_reached | 403 | Active identity limit reached for the consumer's tier |
consumer_not_found | 404 | No consumer account found for this email |
already_upgraded | 409 | Consumer is already on the paid plan |
Related
- Authentication — agent API key authentication
- Billing API — subscription and invoice management
- Realtime API — SSE streaming for agent integrations