Authentication¶
The Aegis API uses Bearer Token authentication. All API requests must include a valid token in the Authorization header.
Authorization Header¶
Authorization: Bearer <your_token>
Endpoints¶
Get Current User¶
Retrieve information about the currently authenticated user.
GET /auth/me
curl -X GET "https://<your-instance>.aegis.pegasys.cloud/auth/me" \
-H "Authorization: Bearer <your_token>"
{
"email": "user@example.com",
"role": "admin",
"isActive": true
}
Logout¶
End the current user session.
GET /auth/logout
curl -X GET "https://<your-instance>.aegis.pegasys.cloud/auth/logout" \
-H "Authorization: Bearer <your_token>"
Token Management¶
Create API Token¶
Create a new API token for programmatic access.
POST /api/tokens/{provider}
Path Parameters:
Parameter | Description |
---|---|
provider |
The authentication provider (e.g., "local") |
curl -X POST "https://<your-instance>.aegis.pegasys.cloud/api/tokens/local" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{
"role": "view",
"expiry": 3600
}'
{
"role": "view",
"expiry": 3600
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiry": "2025-06-17T19:33:39Z"
}
List API Tokens¶
List all API tokens for the specified provider.
GET /api/tokens/{provider}
Path Parameters:
Parameter | Description |
---|---|
provider |
The authentication provider (e.g., "local", "aaaa") |
curl -X GET "https://<your-instance>.aegis.pegasys.cloud/api/tokens/local" \
-H "Authorization: Bearer <your_token>"
Delete API Token¶
Delete a specific API token.
DELETE /api/tokens/{token_id}
Path Parameters:
Parameter | Description |
---|---|
token_id |
The unique identifier of the token to delete |
curl -X DELETE "https://<your-instance>.aegis.pegasys.cloud/api/tokens/some-token-id" \
-H "Authorization: Bearer <your_token>"
User Management¶
List Users¶
List users matching the specified pattern.
GET /api/users/{pattern}
Path Parameters:
Parameter | Description |
---|---|
pattern |
Search pattern, can include wildcards (e.g., "ragu*") |
curl -X GET "https://<your-instance>.aegis.pegasys.cloud/api/users/ragu*" \
-H "Authorization: Bearer <your_token>"
Update User¶
Update a user's role and status.
PUT /api/users/{email}
Path Parameters:
Parameter | Description |
---|---|
email |
The email of the user to update |
curl -X PUT "https://<your-instance>.aegis.pegasys.cloud/api/users/user@example.com" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{
"role": "admin",
"isActive": true
}'
{
"status": "pass",
"email": "user@example.com"
}
Update User (Deprecated)¶
Update a user's role and status using the deprecated POST method.
⚠️ Deprecated: This POST endpoint is deprecated. Use
PUT /api/users/{email}
instead.
POST /api/users/{email}
Path Parameters:
Parameter | Description |
---|---|
email |
The email of the user to update |
curl -X POST "https://<your-instance>.aegis.pegasys.cloud/api/users/user@example.com" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{
"role": "admin",
"isActive": true
}'
{
"role": "admin",
"isActive": true
}
Delete User¶
Delete a user.
DELETE /api/users/{email}
Path Parameters:
Parameter | Description |
---|---|
email |
The email of the user to delete |
curl -X DELETE "https://<your-instance>.aegis.pegasys.cloud/api/users/user@example.com" \
-H "Authorization: Bearer <your_token>"