CertFusion

Authentication

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.

Obtaining an API Token

To authenticate, users must first obtain an API token. Follow these steps:

  1. Log in to your account and click "API Token" in the top right corner. step-1.jpg
  2. Enter a name for your token and click "Generate New Token". step-2.jpg
  3. Copy the generated API token and save it somewhere safe, as it will never be shown again. step-3.jpg

Once you have the API token, include it in the request headers to authenticate your API calls.

Verify Authentication

To verify if the authentication token is valid and to retrieve the authenticated user's details, use the following endpoint:

  • Endpoint: GET /api/me

This endpoint returns the current user's information if the provided API token is valid.

Request Example

GET /api/me
Authorization: Bearer <your-api-token>

Where <your-api-token> is the token you received after successful login or registration.

Response Example (Success)

{
    "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.

Response Example (Unauthorized)

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.