This API uses Bearer Token for authentication. All endpoints require the user to be authenticated with a valid API token. The token must be included in the request headers for the user to access the resources.
To authenticate, users must first obtain an API token. Follow these steps:
Once you have the API token, include it in the request headers to authenticate your API calls.
To verify if the authentication token is valid and to retrieve the authenticated user's details, use the following endpoint:
GET /api/me
This endpoint returns the current user's information if the provided API token is valid.
GET /api/me
Authorization: Bearer <your-api-token>
Where <your-api-token>
is the token you received after successful login or registration.
{
"id": 1,
"name": "John Doe",
"email": "john.doe@example.com",
"created_at": "2025-02-21T10:00:00.000000Z",
"updated_at": "2025-02-21T10:00:00.000000Z"
}
id
: The unique identifier for the user.name
: The name of the authenticated user.email
: The email associated with the authenticated user.created_at
: The account creation timestamp.updated_at
: The last time the user's information was updated.If the token is invalid or missing, the response will be:
{
"status": false,
"message": "Unauthenticated"
}
This confirms that the user is not authenticated and the token is either missing or incorrect.