Skip to Content
Signet

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 + pathAuthCSRFSuccessKey errorsUse it whenReference
POST /signupnoexempt201 {"user":User}email_exists 400, invalid_input 400, rate_limited 429Creating a User and its credential Account.signup
POST /signinnoexempt200 {"user","session_token","csrf_token"}invalid_credentials 401, email_not_verified 403, rate_limited 429Exchanging credentials for a Session; sets cookies and returns the CSRF token.signin
GET /last-sign-in-methodnoexempt200 {"method":"..."}noneRead the signed Last sign-in method cookie.
GET /accountsyesn/a200 {"accounts":[...]}unauthorized 401List safe Account fields.
POST /unlink-accountyesrequired200last_account 400, unauthorized 401Unlink one guarded Account.
POST /enable-two-factoryesrequired200 {"totp_uri","backup_codes"}invalid_credentials 401Start TOTP enrollment.
POST /verify-two-factornoexempt200 {"user","session_token"}invalid_code 401, two_factor_required 401Exchange a challenge and code for a Session.
POST /disable-two-factoryesrequired200invalid_credentials 401Remove Second factor enrollment.
POST /regenerate-backup-codesyesrequired200 {"backup_codes"}two_factor_not_enabled 400Replace all Backup codes.
POST /send-magic-linknoexempt200invalid_request 400, rate_limited 429Email a single-use magic link.send-magic-link
GET /verify-magic-linknoexempt200 {"user","session_token"} or 302invalid_token 401, invalid_request 400, rate_limited 429Consume the link, set cookies and redirect to the allowlisted callback.verify-magic-link
POST /send-otpnoexempt200invalid_input 400, rate_limited 429Email a six-digit sign-in code.send-otp
POST /verify-otpnoexempt200 {"user","session_token"}invalid_token 401, rate_limited 429Consume a code, set cookies and return the Session.verify-otp
POST /request-account-deletionyesrequired200invalid_credentials 401, rate_limited 429Issue a deletion confirmation proof.request-account-deletion
POST /confirm-account-deletionnorequired200invalid_token 401, rate_limited 429Remove the User and all child records.confirm-account-deletion
POST /change-emailyesrequired200invalid_credentials 401, invalid_email 400, email_exists 400, rate_limited 429Issue a proof to a new address.change-email
POST /verify-change-emailnorequired200invalid_token 401, email_exists 400, rate_limited 429Commit a verified email change.verify-change-email
POST /change-passwordyesrequired200invalid_credentials 401, invalid_input 400, rate_limited 429Replace an authenticated User's password; revokes all Sessions and Tokens.change-password
POST /signoutnorequired204csrf 403, invalid_input 400Ending the current Session and clearing its cookie.signout
GET /meyesn/a200 SessionUsernoneSafe profile of the Session's User: verification state, Username and timestamps.
GET /sessionsyesn/a200 {"sessions":[SessionInfo]}unauthorized 401, csrf 403Listing the authenticated User's Sessions.sessions
DELETE /sessionsyesrequired204unauthorized 401, csrf 403Revoking all Sessions of the authenticated User.sessions
DELETE /sessionyesrequired204unauthorized 401, csrf 403Revoking just the current Session.session
POST /tokennoexempt200 TokenPairinvalid_token 401, not_found 404, rate_limited 429Exchanging credentials or a Refresh token when JWT is enabled.token
POST /send-verificationnorequired200csrf 403, invalid_input 400, rate_limited 429Issuing a fresh email-verification Token.send-verification
POST /verify-emailnorequired200csrf 403, invalid_token 401, rate_limited 429Consuming the verification Token from the emailed link.verify-email
POST /send-password-resetnorequired200csrf 403, invalid_input 400, rate_limited 429Requesting a password-reset Token.send-password-reset
POST /reset-passwordnorequired200csrf 403, invalid_token 401, invalid_input 400, rate_limited 429Consuming the reset Token and setting a new password.reset-password
POST /oauth/startnoexempt200 {"url":...}not_found 404, invalid_request 400, rate_limited 429Starting an OAuth flow; returns the provider authorization URL.oauth/start
GET /oauth/callbacknoexempt302invalid_request 400, oauth_email_not_verified 403, oauth_account_conflict 409Provider redirect target; sets a Session cookie or appends a link_token.oauth/callback
GET /csrf-tokennoexempt200 {"token":...}405 on other methodsObtaining 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 + pathAuthCSRFSuccessKey errorsUse it when
POST /api-keysyesrequired201 CreateAPIKeyResultforbidden 403Issue a digest-only API key.
GET /api-keysyesn/a200 ListAPIKeysResultforbidden 403List the caller's keys.
POST /verify-api-keyX-API-Keyexempt200 Principalinvalid_token 401Verify a key.
POST /revoke-api-keyyesrequired200forbidden 403Revoke a key.
POST /organizationsyesrequired201 CreateOrganizationResultforbidden 403Create an Organization.
GET /organizationsyesn/a200 ListOrganizationsResultforbidden 403List Organizations.
GET /organization-members?organization_id=…yesn/a200 ListOrganizationMembersResultforbidden 403List Members.
POST /organization-members/addyesrequired200forbidden 403Add a Member.
POST /organization-members/removeyesrequired200forbidden 403Remove a Member.
POST /organization-members/roleyesrequired200forbidden 403Change a Member's role.
POST /set-active-organizationyesrequired200forbidden 403Select an Active organization.
GET /active-organizationnoexempt200 {"id":"..."}noneRead the Active organization.
POST /clear-active-organizationyesrequired200unauthorized 401Clear the Active organization.
GET /admin-usersyesn/a200 AdminListUsersResultforbidden 403List Users.
POST /admin-users/roleyesrequired200forbidden 403Set global roles.
POST /admin-users/banyesrequired200forbidden 403Ban a User.
POST /admin-users/unbanyesrequired200forbidden 403Unban a User.
GET /admin-user-sessions?user_id=…yesn/a200 ListSessionsResultforbidden 403List a User's Sessions.
POST /admin-user-sessions/revokeyesrequired200forbidden 403Revoke one Session.
POST /impersonateyesrequired200 ImpersonationResultforbidden 403Start impersonation.
POST /stop-impersonatingnoexempt200invalid_token 401Stop and restore the original Session.

See API keys, Organizations and Admin management for complete flows.

Passkey endpoints

Method + pathAuthCSRFSuccessKey errorsUse it when
POST /passkeys/register-beginyesrequired200 PasskeyCeremonyResultforbidden 403Start enrollment.
POST /passkeys/register-finishyesrequired200invalid_token 401Store the credential.
POST /passkeys/signin-beginnoexempt200 PasskeyCeremonyResultforbidden 403Start discoverable sign-in.
POST /passkeys/signin-finishnoexempt200 SignInResultinvalid_token 401Verify and create a Session.
GET /passkeysyesn/a200 PasskeyListResultforbidden 403List safe passkey fields.
POST /passkeys/deleteyesrequired200forbidden 403Revoke a passkey.

See Passkeys for the complete flow.

Automatic sign-in

Method + pathAuthCSRFSuccessNotes
POST /signupnoexempt201 SignUpResultIncludes an optional session_token when AutoSignIn.AfterSignUp is enabled and the verification gate permits it.
POST /verify-emailnorequired200 VerifyEmailAndSignInResultIncludes 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 + pathAuthCSRFDescription
POST /oauth/authorizeSessionrequiredIssue an authorization code.
POST /oauth/tokennoneexemptExchange a code or refresh token.
POST /oauth/device/authorizenoneexemptStart device authorization.
POST /oauth/device/tokennoneexemptPoll for device tokens.
POST /oauth/device/approveSessionrequiredApprove a User code.

All five accept form-encoded or JSON bodies and return OAuth-standard errors. See Authorization server.

SAML endpoints

Method + pathAuthDescription
POST /saml/startnoneBuild a signed AuthnRequest and return the IdP URL.
POST /saml/acsnoneValidate 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.

On this page