The settings endpoints let you manage API keys for programmatic access and team member access to your InfraAudit account. API key values are shown only once at creation time — store them in your secrets manager immediately.
Base path: /api/v1/settings
API keys
GET /settings/api-keys — list API keys
Returns all active API keys. Key values are never returned after creation — only the prefix is shown.
GET /api/v1/settings/api-keys
Authorization: Bearer <token>
Response
[
{
"id": 1,
"name": "CI/CD Pipeline",
"prefix": "ia_live_abc...",
"created_at": "2024-01-10T10:00:00Z",
"last_used_at": "2024-01-15T09:12:00Z"
}
]
POST /settings/api-keys — create API key
Creates a new API key. The full key value is returned only in this response.
POST /api/v1/settings/api-keys
Authorization: Bearer <token>
Content-Type: application/json
Request body
A descriptive name for this key, for example CI/CD Pipeline.
{
"name": "CI/CD Pipeline"
}
Response 201
{
"id": 2,
"name": "CI/CD Pipeline",
"key": "ia_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
Copy the key value immediately. It is shown only once and cannot be retrieved again. If you lose it, delete this key and create a new one.
DELETE /settings/api-keys/ — revoke API key
Revokes and permanently deletes an API key. Requests using the deleted key will immediately receive 401 Unauthorized.
DELETE /api/v1/settings/api-keys/{id}
Authorization: Bearer <token>
Returns 204 No Content.
Team members
GET /settings/team — list members
Returns all team members with their roles.
GET /api/v1/settings/team
Authorization: Bearer <token>
Response
[
{
"id": 1,
"email": "admin@example.com",
"role": "admin",
"joined_at": "2024-01-01T00:00:00Z",
"last_active_at": "2024-01-15T10:00:00Z"
}
]
POST /settings/team/invite — invite a member
Sends an invitation email to a new team member.
POST /api/v1/settings/team/invite
Authorization: Bearer <token>
Content-Type: application/json
Request body
Role to assign: user or admin.
{
"email": "newuser@example.com",
"role": "user"
}
PUT /settings/team/ — update member role
Updates the role for a team member.
PUT /api/v1/settings/team/{user_id}
Authorization: Bearer <token>
Content-Type: application/json
Request body
DELETE /settings/team/ — remove member
Removes a team member from the account.
DELETE /api/v1/settings/team/{user_id}
Authorization: Bearer <token>
Returns 204 No Content.