Authentication API
The Authentication API allows you to manage user authentication within your applications. This includes user registration, login, password management, and session handling. All requests to this API must be authenticated using a valid API key.
Registers a new user with the platform. Requires a unique email and password.
Method
POST
Path
/auth/register
Request Body
{ "email": "[email protected]", "password": "securePassword" }
Response
{ "user_id": "123e4567-e89b-12d3-a456-426614174000", "email": "[email protected]" }
Authenticates a user and returns a session token.
Method
POST
Path
/auth/login
Request Body
{ "email": "[email protected]", "password": "securePassword" }
Response
{ "session_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user_id": "123e4567-e89b-12d3-a456-426614174000" }
Invalidates the current user session.
Method
POST
Path
/auth/logout
Headers
{ "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." }
Response
{ "message": "Logged out successfully" }
All endpoints require authentication via a Bearer token. Include the session token in the Authorization header of your requests.
Here's an example of how to register a user using the API with a Python request: