```html
Endpoint: /api/v1/auth/login
Method: POST
Description: Authenticates a user and returns an access token.
Request Body (JSON):
{
"username": "string",
"password": "string"
}
Response (JSON - Successful):
{
"access_token": "string",
"user_id": "integer"
}
Response (JSON - Error):
{
"error": "string"
}
Endpoint: /api/v1/auth/register
Method: POST
Description: Registers a new user.
Request Body (JSON):
{
"username": "string",
"password": "string",
"email": "string"
}
Response (JSON - Successful):
{
"user_id": "integer",
"message": "User created successfully"
}
Response (JSON - Error):
{
"error": "string"
}
Endpoint: /api/v1/auth/refresh
Method: POST
Description: Refreshes an existing access token using a refresh token.
Request Body (JSON):
{
"refresh_token": "string"
}
Response (JSON - Successful):
{
"access_token": "string"
}
Response (JSON - Error):
{
"error": "string"
}