HTTP API
Every endpoint, its authentication and CSRF requirements, and when to use each.
Client.Handler() returns a standard http.Handler. Mount it under Config.PathPrefix
(default /) — the example apps mount it at /auth. The handler serves the full
/auth/... paths itself, so do not strip the prefix:
mux.Handle("/auth/", auth.Handler())Every path below is relative to that prefix, so with the example it becomes
/auth/signup, /auth/signin, and so on. Request and response JSON shapes are generated
from the declarative contract into the API reference.
Endpoint map
| Method + path | Auth | CSRF | Success | Key errors | Use it when | Reference |
|---|---|---|---|---|---|---|
POST /signup | no | exempt | 201 {"user":User} | email_exists 400, invalid_input 400, rate_limited 429 | Creating a User and its credential Account. | signup |
POST /signin | no | exempt | 200 {"user","session_token","csrf_token"} | invalid_credentials 401, email_not_verified 403, rate_limited 429 | Exchanging credentials for a Session; sets cookies and returns the CSRF token. | signin |
GET /last-sign-in-method | no | exempt | 200 {"method":"..."} | none | Read the signed Last sign-in method cookie. | |
GET /accounts | yes | n/a | 200 {"accounts":[...]} | unauthorized 401 | List safe Account fields. | |
POST /unlink-account | yes | required | 200 | last_account 400, unauthorized 401 | Unlink one guarded Account. | |
POST /enable-two-factor | yes | required | 200 {"totp_uri","backup_codes"} | invalid_credentials 401 | Start TOTP enrollment. | |
POST /verify-two-factor | no | exempt | 200 {"user","session_token"} | invalid_code 401, two_factor_required 401 | Exchange a challenge and code for a Session. | |
POST /disable-two-factor | yes | required | 200 | invalid_credentials 401 | Remove Second factor enrollment. | |
POST /regenerate-backup-codes | yes | required | 200 {"backup_codes"} | two_factor_not_enabled 400 | Replace all Backup codes. | |
POST /send-magic-link | no | exempt | 200 | invalid_request 400, rate_limited 429 | Email a single-use magic link. | send-magic-link |
GET /verify-magic-link | no | exempt | 200 {"user","session_token"} or 302 | invalid_token 401, invalid_request 400, rate_limited 429 | Consume the link, set cookies and redirect to the allowlisted callback. | verify-magic-link |
POST /send-otp | no | exempt | 200 | invalid_input 400, rate_limited 429 | Email a six-digit sign-in code. | send-otp |
POST /verify-otp | no | exempt | 200 {"user","session_token"} | invalid_token 401, rate_limited 429 | Consume a code, set cookies and return the Session. | verify-otp |
POST /request-account-deletion | yes | required | 200 | invalid_credentials 401, rate_limited 429 | Issue a deletion confirmation proof. | request-account-deletion |
POST /confirm-account-deletion | no | required | 200 | invalid_token 401, rate_limited 429 | Remove the User and all child records. | confirm-account-deletion |
POST /change-email | yes | required | 200 | invalid_credentials 401, invalid_email 400, email_exists 400, rate_limited 429 | Issue a proof to a new address. | change-email |
POST /verify-change-email | no | required | 200 | invalid_token 401, email_exists 400, rate_limited 429 | Commit a verified email change. | verify-change-email |
POST /change-password | yes | required | 200 | invalid_credentials 401, invalid_input 400, rate_limited 429 | Replace an authenticated User's password; revokes all Sessions and Tokens. | change-password |
POST /signout | no | required | 204 | csrf 403, invalid_input 400 | Ending the current Session and clearing its cookie. | signout |
GET /me | yes | n/a | 200 SessionUser | none | Safe profile of the Session's User: verification state, Username and timestamps. | |
GET /sessions | yes | n/a | 200 {"sessions":[SessionInfo]} | unauthorized 401, csrf 403 | Listing the authenticated User's Sessions. | sessions |
DELETE /sessions | yes | required | 204 | unauthorized 401, csrf 403 | Revoking all Sessions of the authenticated User. | sessions |
DELETE /session | yes | required | 204 | unauthorized 401, csrf 403 | Revoking just the current Session. | session |
POST /token | no | exempt | 200 TokenPair | invalid_token 401, not_found 404, rate_limited 429 | Exchanging credentials or a Refresh token when JWT is enabled. | token |
POST /send-verification | no | required | 200 | csrf 403, invalid_input 400, rate_limited 429 | Issuing a fresh email-verification Token. | send-verification |
POST /verify-email | no | required | 200 | csrf 403, invalid_token 401, rate_limited 429 | Consuming the verification Token from the emailed link. | verify-email |
POST /send-password-reset | no | required | 200 | csrf 403, invalid_input 400, rate_limited 429 | Requesting a password-reset Token. | send-password-reset |
POST /reset-password | no | required | 200 | csrf 403, invalid_token 401, invalid_input 400, rate_limited 429 | Consuming the reset Token and setting a new password. | reset-password |
POST /oauth/start | no | exempt | 200 {"url":...} | not_found 404, invalid_request 400, rate_limited 429 | Starting an OAuth flow; returns the provider authorization URL. | oauth/start |
GET /oauth/callback | no | exempt | 302 | invalid_request 400, oauth_email_not_verified 403, oauth_account_conflict 409 | Provider redirect target; sets a Session cookie or appends a link_token. | oauth/callback |
GET /csrf-token | no | exempt | 200 {"token":...} | 405 on other methods | Obtaining a CSRF token for browser requests; sets the CSRF cookie. | csrf-token |
Authenticated operations publish a sessionCookie security requirement and protected
state-changing operations publish the X-CSRF-Token header in the generated spec, so the
API playground can show what is required. Anonymous endpoints are exempt from the CSRF guard. State-changing requests that carry a
session cookie must present X-CSRF-Token; see Sessions and cookies.
Errors
Failures return {"error": code, "message": msg} with the status codes listed in
Errors. Common ones: invalid_credentials 401, email_not_verified 403,
invalid_token 401, rate_limited 429, csrf 403.
Request bodies
Request structs are aliased from the private domain types and carry JSON tags. Fields
named RateLimitKey are json:"-" — the server derives them from the connection address,
so a client cannot override its rate-limit key. TokenInput accepts either
email + password or refresh_token.
Generated reference
Each operation has a generated page with schemas, response samples and example code under
/docs/openapi/.... Those pages are produced from api/signet.openapi.json; never edit
them by hand. See Tooling for regeneration.
Phase 5 endpoints
The authorization features add these endpoints. All require a session cookie and CSRF unless noted; a call from an active impersonation uses the administrator ID from the signed cookie.
| Method + path | Auth | CSRF | Success | Key errors | Use it when |
|---|---|---|---|---|---|
POST /api-keys | yes | required | 201 CreateAPIKeyResult | forbidden 403 | Issue a digest-only API key. |
GET /api-keys | yes | n/a | 200 ListAPIKeysResult | forbidden 403 | List the caller's keys. |
POST /verify-api-key | X-API-Key | exempt | 200 Principal | invalid_token 401 | Verify a key. |
POST /revoke-api-key | yes | required | 200 | forbidden 403 | Revoke a key. |
POST /organizations | yes | required | 201 CreateOrganizationResult | forbidden 403 | Create an Organization. |
GET /organizations | yes | n/a | 200 ListOrganizationsResult | forbidden 403 | List Organizations. |
GET /organization-members?organization_id=… | yes | n/a | 200 ListOrganizationMembersResult | forbidden 403 | List Members. |
POST /organization-members/add | yes | required | 200 | forbidden 403 | Add a Member. |
POST /organization-members/remove | yes | required | 200 | forbidden 403 | Remove a Member. |
POST /organization-members/role | yes | required | 200 | forbidden 403 | Change a Member's role. |
POST /set-active-organization | yes | required | 200 | forbidden 403 | Select an Active organization. |
GET /active-organization | no | exempt | 200 {"id":"..."} | none | Read the Active organization. |
POST /clear-active-organization | yes | required | 200 | unauthorized 401 | Clear the Active organization. |
GET /admin-users | yes | n/a | 200 AdminListUsersResult | forbidden 403 | List Users. |
POST /admin-users/role | yes | required | 200 | forbidden 403 | Set global roles. |
POST /admin-users/ban | yes | required | 200 | forbidden 403 | Ban a User. |
POST /admin-users/unban | yes | required | 200 | forbidden 403 | Unban a User. |
GET /admin-user-sessions?user_id=… | yes | n/a | 200 ListSessionsResult | forbidden 403 | List a User's Sessions. |
POST /admin-user-sessions/revoke | yes | required | 200 | forbidden 403 | Revoke one Session. |
POST /impersonate | yes | required | 200 ImpersonationResult | forbidden 403 | Start impersonation. |
POST /stop-impersonating | no | exempt | 200 | invalid_token 401 | Stop and restore the original Session. |
See API keys, Organizations and Admin management for complete flows.
Passkey endpoints
| Method + path | Auth | CSRF | Success | Key errors | Use it when |
|---|---|---|---|---|---|
POST /passkeys/register-begin | yes | required | 200 PasskeyCeremonyResult | forbidden 403 | Start enrollment. |
POST /passkeys/register-finish | yes | required | 200 | invalid_token 401 | Store the credential. |
POST /passkeys/signin-begin | no | exempt | 200 PasskeyCeremonyResult | forbidden 403 | Start discoverable sign-in. |
POST /passkeys/signin-finish | no | exempt | 200 SignInResult | invalid_token 401 | Verify and create a Session. |
GET /passkeys | yes | n/a | 200 PasskeyListResult | forbidden 403 | List safe passkey fields. |
POST /passkeys/delete | yes | required | 200 | forbidden 403 | Revoke a passkey. |
See Passkeys for the complete flow.
Automatic sign-in
| Method + path | Auth | CSRF | Success | Notes |
|---|---|---|---|---|
POST /signup | no | exempt | 201 SignUpResult | Includes an optional session_token when AutoSignIn.AfterSignUp is enabled and the verification gate permits it. |
POST /verify-email | no | required | 200 VerifyEmailAndSignInResult | Includes an optional session_token when AutoSignIn.AfterVerification is enabled. |
Both endpoints set Session and CSRF cookies only when a Session was issued. See Verification and reset.
Authorization server endpoints
| Method + path | Auth | CSRF | Description |
|---|---|---|---|
POST /oauth/authorize | Session | required | Issue an authorization code. |
POST /oauth/token | none | exempt | Exchange a code or refresh token. |
POST /oauth/device/authorize | none | exempt | Start device authorization. |
POST /oauth/device/token | none | exempt | Poll for device tokens. |
POST /oauth/device/approve | Session | required | Approve a User code. |
All five accept form-encoded or JSON bodies and return OAuth-standard errors. See Authorization server.
SAML endpoints
| Method + path | Auth | Description |
|---|---|---|
POST /saml/start | none | Build a signed AuthnRequest and return the IdP URL. |
POST /saml/acs | none | Validate a signed assertion and create a Session. |
See SAML SSO.
SCIM provisioning
The SCIM 2.0 server is mounted under PathPrefix at /scim/Users and /scim/Groups and uses a bearer token, not a Signet Session. See SCIM provisioning.
Account controls
UpdateUser, SetPassword, VerifyPassword and QueryAudit are Go API methods; no new HTTP endpoints are added in this phase. See Account controls.