API Authentication
Learn how to authenticate with the AccessQR API
API Authentication
Learn how to authenticate with the AccessQR API
Overview
AccessQR uses JWT (JSON Web Tokens) for API authentication. All API requests must include a valid JWT token in the Authorization header.
Authentication Flow
- Obtain credentials (email and password)
- Call the login endpoint to get a JWT token
- Include the token in subsequent API requests
Login Endpoint
POST
/api/v1/auth/login
Authenticate a user and receive an access token.
Request Body
{
"email": "string",
"password": "string"
}
Response
{
"token": "string",
"user": {
"id": "string",
"email": "string",
"name": "string"
}
}
Using the Token
Include the JWT token in the Authorization header of your requests:
Authorization: Bearer your.jwt.token
Token Expiration
JWT tokens expire after 24 hours. You can refresh your token using the refresh endpoint:
POST
/api/v1/auth/refresh
Request Body
{
"refreshToken": "string"
}