POST /v1/agent-signup
Let an AI agent get a key for a person, who approves it from an email.
For agents running in a person's terminal, editor or chat. The agent starts a sign-up with the person's email; we email them an approval link and the agent shows them a 6-digit match code. When they approve, the agent's poll returns the key once. The agent-facing guide is auth.md.
Start: body
| Field | Type | Required | Notes |
|---|---|---|---|
email |
string | Yes | The person who approves. Ask them; never guess. |
key_name |
string | No | Label for the key. |
client_name |
string | No | Your agent or tool, shown in the email and on the approval page. |
Keep claim_token secret. Show the person user_code, and tell them to open the email from Invariant, check the
code matches, and approve. verification_uri lets them approve with Google instead.
Poll: POST /v1/agent-signup/token
Poll every interval seconds with {"claim_token": "…"}.
| Response | Meaning |
|---|---|
{"status": "pending"} |
Not answered yet |
{"status": "slow_down"} |
You polled too fast; add 5 seconds |
{"status": "expired"} |
10 minutes passed. Start again |
{"status": "denied"} |
The person declined |
{"status": "approved", "api_key": "ief_…", "key_id", "key_name", "email", "dashboard_url"} |
The key, returned once |
400 invalid_request |
Unknown token, or the key was already collected |
429 rate_limited, reason: "agent_signups" |
Too many sign-ups from this network or open for this email |