- Which Domain to pass to
get_token. - Which endpoints to call and what request and response shapes they expect.
- What to do when a request returns
401,403, or500.
auth.md is a plain Markdown file hosted at both https://<your-domain>/auth.md and https://<your-domain>/.well-known/auth.md that gives agents all three in one GET request.
Copy-paste agent prompt
Where to host it
Serve the same file at both paths over HTTPS with200 OK, no authentication, and no redirects to a different hostname:
https://<your-domain>/auth.mdhttps://<your-domain>/.well-known/auth.md
/auth.md first while others check /.well-known/auth.md first. Publishing both paths ensures every agent runtime finds your discovery document on the first request.
In a Next.js app, place the file in both public/auth.md and public/.well-known/auth.md (or serve public/auth.md from a route handler at /.well-known/auth.md/route.ts so there is one source of truth):
notes-api
public
.well-known
auth.md
auth.md
app
api
notes
package.json
Origin & how agents read
auth.mdThe /auth.md discovery convention was pioneered by WorkOS (workos.com/auth-md) (github.com/workos/auth.md). AgentOnboard uses a 3-section auth.md format tailored for direct 5-minute JWT verification. Neither @agentonboard/sdk nor our server fetches this file; the AI Agent fetches /auth.md or /.well-known/auth.md before calling your API.Required sections
Include these three Markdown sections in order:Matching ## Audience with your backend code
The hostname in ## Audience must match the audience string you pass to requireAgentAccount or verifyAgentToken after normalization (lowercase hostname, no scheme, no path, no port except on localhost).
Write the bare hostname your API serves on (such as notes.com). If your API runs on a subdomain such as api.notes.com, use api.notes.com in both your backend code and https://api.notes.com/auth.md.
Complete copy-paste templates
Choose the template that matches how your service handles unknown emails (see Accounts & Agent Signup):- Reject Unknown Users (Default)
- Allow Agent Signup (POST /api/signup)
Use this template when all routes use
verifyAgentAccount / requireAgentAccount and unknown users must connect an existing account in your browser UI:public/auth.md
Pre-publish checklist
- Both
https://<your-domain>/auth.mdandhttps://<your-domain>/.well-known/auth.mdreturn200 OKwithout authentication or cross-host redirects. -
## Audiencematches the normalizedaudiencestring in your backend code. - The
403 ACCOUNT_REQUIREDrow matches your live flow (browser connect URL orPOST /api/signup).