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.

Consumer auth vs. agent auth

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

POST/v1/consumer/signup

Create a new consumer account. A magic-link verification email is sent to the provided address.

Request body

FieldTypeRequiredDescription
emailstringYesPersonal 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

POST/v1/consumer/verify

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

FieldTypeRequiredDescription
tokenstringYesMagic-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

POST/v1/consumer/login

Send a new magic-link login email to an existing consumer. The resulting token is verified via the same /verify endpoint.

Request body

FieldTypeRequiredDescription
emailstringYesEmail 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)

GET/v1/consumer/inbox

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

EventDescription
inbound.receivedA new email arrived at one of the consumer's identity inboxes
extraction.completedAn OTP or verification code was extracted from an email

List identities

GET/v1/consumer/identities

List the authenticated consumer's temporary email identities. Supports pagination.

Query parameters

ParameterTypeRequiredDescription
limitintegerNoMax results per page (default: 20, max: 100)
offsetintegerNoPagination 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

POST/v1/consumer/identities

Create a new temporary email identity for the consumer. The number of active identities is limited by the consumer's tier.

Request body

FieldTypeRequiredDescription
labelstringYesHuman-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" }'
Tier limits

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

GET/v1/consumer/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

POST/v1/consumer/upgrade

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

CodeStatusDescription
email_already_registered409A consumer account with this email already exists
invalid_magic_link401The magic-link token is invalid or expired
session_expired401The consumer session has expired — request a new login
identity_limit_reached403Active identity limit reached for the consumer's tier
consumer_not_found404No consumer account found for this email
already_upgraded409Consumer is already on the paid plan

Related