Skip to main content

Log audit entry

POST /api/audit

Request body

{
  "id": "entry-001",
  "userId": "user-123",
  "roleId": "developer",
  "toolPath": "github.issues.create",
  "args": { "owner": "my-org", "repo": "my-repo", "title": "Bug fix" },
  "resultStatus": "success",
  "timestamp": "2025-01-15T12:00:00Z"
}
Validated against AuditEntrySchema:
FieldTypeRequiredDescription
idstringYesUnique entry ID
userIdstringYesUser who invoked the tool
roleIdstringYesRole used for authorization
toolPathstringYesTool that was invoked
argsobjectNoArguments passed to the tool
resultStatusstringYesOne of: success, error, denied, elicited
elicitTrailstring[]NoExecution IDs of elicitations triggered
timestampstringYesISO 8601 datetime

Response (201)

{
  "logged": true
}

List audit entries

GET /api/audit?userId=<userId>&limit=<limit>
ParameterInRequiredDefaultDescription
userIdqueryNoFilter by user
limitqueryNo50Max entries to return
Response (200):
{
  "userId": "user-123",
  "limit": 50,
  "entries": []
}