-
Notifications
You must be signed in to change notification settings - Fork 4
docs: Agent Signup & Verify endpoints #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
322e396
docs: add Agent Signup and Verify endpoint documentation
1c87094
Merge main into feat/agent-signup-docs
sweetmantech fed5aa1
docs: address PR #104 review feedback
sweetmantech c9a8e72
docs: follow-up review fixes for agent onboarding
sweetmantech 2c59f7a
docs: make agent signup the priority path across the docs
sweetmantech 2501e0d
docs: add env-var one-liner to agent signup flow
sweetmantech f786b58
docs: use portable date+RANDOM for agent signup suffix
sweetmantech File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| --- | ||
| title: 'Agents' | ||
| description: 'Programmatic agent onboarding — sign up and obtain API keys in one call, no dashboard, no human in the loop.' | ||
| --- | ||
|
|
||
| ## Quickest start | ||
|
|
||
| Get a working API key in a single unauthenticated request: | ||
|
|
||
| ```bash | ||
| curl -X POST "https://recoup-api.vercel.app/api/agents/signup" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"email": "agent+'$(date +%s)-$RANDOM'@recoupable.com"}' | ||
| ``` | ||
|
|
||
| Response: | ||
|
|
||
| ```json | ||
| { | ||
| "account_id": "123e4567-e89b-12d3-a456-426614174000", | ||
| "api_key": "recoup_sk_abc123...", | ||
| "message": "If this is a new agent+ email, your API key is included. Otherwise, check your email for a verification code." | ||
| } | ||
| ``` | ||
|
|
||
| That's it. Store `api_key`, pass it in the `x-api-key` header on every subsequent request, and you're done. | ||
|
|
||
| <Tip> | ||
| **One-liner — sign up and export the key in one shot.** Drop this into your shell and you'll have `$RECOUP_API_KEY` ready to use on the next line: | ||
|
|
||
| ```bash | ||
| export RECOUP_API_KEY=$(curl -s -X POST "https://recoup-api.vercel.app/api/agents/signup" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"email": "agent+'$(date +%s)-$RANDOM'@recoupable.com"}' | jq -r .api_key) | ||
| ``` | ||
|
|
||
| Verify it worked: | ||
|
|
||
| ```bash | ||
| curl -H "x-api-key: $RECOUP_API_KEY" https://recoup-api.vercel.app/api/accounts/id | ||
| ``` | ||
| </Tip> | ||
|
|
||
| <Tip> | ||
| The `agent+{unique-suffix}@recoupable.com` shape is the recommended path for agents — it always returns an API key instantly, with no email verification required. Combining `$(date +%s)` with `$RANDOM` guarantees a fresh, collision-free address on every call (including multiple signups within the same second) and is portable across macOS and Linux shells. | ||
| </Tip> | ||
|
|
||
| ## How it works | ||
|
|
||
| Two unauthenticated endpoints power agent onboarding: | ||
|
|
||
| - **[`POST /api/agents/signup`](/api-reference/agents/signup)** — Register with an email address. Emails with the `agent+` prefix that have never been seen before receive an API key immediately. Any other email (or a previously-used `agent+` address) receives a 6-digit verification code via email. | ||
| - **[`POST /api/agents/verify`](/api-reference/agents/verify)** — Submit the verification code to receive an API key. | ||
|
|
||
| Multiple API keys per account are supported — each signup or verification generates a new key without revoking existing ones. | ||
|
|
||
| ## Standard signup (email verification) | ||
|
|
||
| If you're building a human-facing integration and want the user to verify their real email, use any non-`agent+` address: | ||
|
|
||
| Step 1 — request a verification code: | ||
|
|
||
| ```bash | ||
| curl -X POST "https://recoup-api.vercel.app/api/agents/signup" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"email": "you@example.com"}' | ||
| ``` | ||
|
|
||
| Step 2 — submit the 6-digit code from the verification email: | ||
|
|
||
| ```bash | ||
| curl -X POST "https://recoup-api.vercel.app/api/agents/verify" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"email": "you@example.com", "code": "123456"}' | ||
| ``` | ||
|
|
||
| Response: | ||
|
|
||
| ```json | ||
| { | ||
| "account_id": "123e4567-e89b-12d3-a456-426614174000", | ||
| "api_key": "recoup_sk_abc123...", | ||
| "message": "Verified" | ||
| } | ||
| ``` | ||
|
|
||
| ## Using your API key | ||
|
|
||
| Pass the returned `api_key` in the `x-api-key` header on every authenticated request: | ||
|
|
||
| ```bash | ||
| curl -X GET "https://recoup-api.vercel.app/api/tasks" \ | ||
| -H "x-api-key: YOUR_API_KEY" | ||
| ``` | ||
|
|
||
| See [Authentication](/authentication) for the full authentication model, including organization access and Bearer token support, and [Quickstart](/quickstart) for your first end-to-end request. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: 'Agent Signup' | ||
| openapi: "/api-reference/openapi/accounts.json POST /api/agents/signup" | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: 'Verify Agent Email' | ||
| openapi: "/api-reference/openapi/accounts.json POST /api/agents/verify" | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Custom agent: Flag AI Slop and Fabricated Changes
These curl examples (instant signup, standard signup, verify) duplicate content already present in
quickstart.mdxwith only cosmetic differences (full JSON response blocks here vs. inline comments there). The repo guidelines call for DRY via reusablesnippets/. Extract the shared examples into a snippet and include it from both pages.Prompt for AI agents