API Reference
Base URL
https://api.bywrit.com/v1Provider Directory
List Providers
GET /v1/providersGET /v1/providers?category=databaseGET /v1/providers?search=resendGet Provider Details
GET /v1/providers/:slugProvider details include the public login metadata used by agents and the CLI:
idslugnameclient_idredirect_urisscopesinitiate_login_uriagent_initiate_login_uri
Developer Grants
List Developer Grants
GET /v1/developers/grantsAuthorization: Bearer <agent_token>Check Specific Grant
GET /v1/developers/grants?provider=:slugAuthorization: Bearer <agent_token>Agent API
Exchange Agent Token for a ByWrit Session
POST /v1/agent/sessionAuthorization: Bearer <agent_token>Returns a short-lived ByWrit session token:
{ "session_token": "bw_sess_...", "token_type": "Session", "expires_in": 900}Start Managed Signup
POST /v1/agent/signupsAuthorization: Bearer <agent_token>Content-Type: application/json
{ "provider": "resend"}ByWrit will try the provider’s agent_initiate_login_uri first, then initiate_login_uri.
The request body can identify the provider in any of these ways:
providerprovider_slugsp_id
The response is a signup attempt object with a status such as:
completedalready_existsbrowser_requiredadditional_input_requiredprovider_unavailableunsupported_by_providerfailed
Fetch Managed Signup Status
GET /v1/agent/signups/:idAuthorization: Bearer <agent_token>SP Registration
Register as SP
POST /v1/sp/registerRegistration requires:
nameredirect_urisinitiate_login_uri
Optional fields include:
website_urldescriptioncategoryagent_initiate_login_uriallowed_scopes
Current self-service allowed_scopes values are:
openidprofileemail
For the current default setup, use openid email.