Authorization header of every subsequent request.
Never share your access token. Treat it like a password — anyone who has it can make API calls on your behalf.
Register a New Account
If you don’t have a BotSmith account yet, create one by sending aPOST request to /api/auth/register. A successful registration automatically returns an access token so you can start making API calls immediately.
string
required
Your full name.
string
required
Your email address. Must be unique — returns
400 if the address is already registered.string
required
Your chosen password.
201 Created):
string
The JWT token to use in subsequent API requests.
string
Always
"bearer".Log In to Obtain a Token
Send aPOST request to /api/auth/login with your email and password:
string
required
Your registered email address.
string
required
Your account password.
200 OK):
string
The JWT token to include in subsequent API requests.
string
Always
"bearer".Using the Token
Include the token as aBearer value in the Authorization header of every authenticated request:
YOUR_ACCESS_TOKEN with the access_token value returned from the login or register endpoint.
Token Expiry
Tokens expire after a period of inactivity. When your token expires, the API returns a401 Unauthorized response:
401, re-authenticate by calling /api/auth/login again to obtain a fresh token.
Get the Current User Profile
To retrieve the profile of the currently authenticated user, callGET /api/auth/me:
200 OK):
string
Unique identifier for the user.
string
The user’s display name.
string
The user’s email address.
string
The user’s role:
"user" or "admin".string
Account status:
"active", "suspended", or "banned".string
The user’s current subscription plan identifier (e.g.,
"free", "starter", "pro").string
ISO 8601 timestamp of when the account was created.
string | null
ISO 8601 timestamp of the most recent login, or
null if the user has never logged in.Log Out
Send aPOST request to /api/auth/logout to invalidate the current session. Because BotSmith uses stateless JWT tokens, you should also remove the token from your client storage immediately.
200 OK):