-
Notifications
You must be signed in to change notification settings - Fork 10
feat: added docs for audit logs #817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pmdroid
wants to merge
14
commits into
main
Choose a base branch
from
pascal/plt-1232-add-docs-for-audit-logs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3bfc158
feat: added docs for audit logs
pmdroid 7d49969
Apply suggestions from code review
pmdroid 0266449
Regenerate clean markdown files
github-actions[bot] ced6cfb
🤖 Regenerate LLMs.txt
github-actions[bot] 265a691
Regenerate clean markdown files
github-actions[bot] ea8600c
Regenerate clean markdown files
github-actions[bot] 45cdac0
Regenerate clean markdown files
github-actions[bot] 5593160
fix: endpoint uri
pmdroid 717bac0
Regenerate clean markdown files
github-actions[bot] a3c1ed5
Merge branch 'main' into pascal/plt-1232-add-docs-for-audit-logs
pmdroid a9be921
Regenerate clean markdown files
github-actions[bot] dc6018d
Regenerate clean markdown files
github-actions[bot] 45d367e
Regenerate clean markdown files
github-actions[bot] e99c5b8
Regenerate clean markdown files
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,243 @@ | ||
| --- | ||
| title: "Audit Logs" | ||
| description: "If you want audit events outside the dashboard, there's a REST API. You can pull logs programmatically to feed into your existing SIEM, compliance tooling, or internal reporting." | ||
| --- | ||
|
|
||
| # Audit Logs for AI Agent Platforms | ||
|
|
||
| If you want audit events outside the dashboard, there's a REST API. You can pull logs programmatically to feed into your existing SIEM, compliance tooling, or internal reporting. | ||
|
|
||
| ## Example | ||
|
|
||
| Fetch the 10 most recent audit logs for your organization, filtered to creation events: | ||
|
|
||
| ```bash | ||
| curl -s "https://cloud.arcade.dev/api/v1/orgs/{org_id}/audit_logs?action=AUDIT_ACTION_CREATED&limit=10" \ | ||
| -H "Authorization: Bearer $ARCADE_API_KEY" | ||
| ``` | ||
|
|
||
| ```json | ||
| { | ||
| "code": 200, | ||
| "msg": "Request successful", | ||
| "data": { | ||
| "items": [ | ||
| { | ||
| "id": "d290f1ee-6c54-4b01-90e6-d701748f0851", | ||
| "event_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", | ||
| "timestamp": "2026-02-24T12:34:56.789Z", | ||
| "action": "AUDIT_ACTION_CREATED", | ||
| "source": "AUDIT_SOURCE_API", | ||
| "display_name": "jane@example.com", | ||
| "organization_id": "550e8400-e29b-41d4-a716-446655440000", | ||
| "principal_type": "ACCOUNT", | ||
| "resource_type": "RESOURCE_TYPE_API_KEY", | ||
| "resource_display": "prod-key-1" | ||
| } | ||
| ], | ||
| "next_cursor": "MjAyNi0wMi0yNFQxMjo...", | ||
| "has_more": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| To fetch the next page, pass the cursor: | ||
|
|
||
| ```bash | ||
| curl -s "https://cloud.arcade.dev/api/v1/orgs/{org_id}/audit_logs?action=AUDIT_ACTION_CREATED&limit=10&cursor=MjAyNi0wMi0yNFQxMjo..." \ | ||
| -H "Authorization: Bearer $ARCADE_API_KEY" | ||
| ``` | ||
|
|
||
| ## Endpoints overview | ||
|
|
||
| | Endpoint | Method | Description | Auth | | ||
| | -- | -- | -- | -- | | ||
| | `/api/v1/orgs/{org_id}/audit_logs` | GET | List audit logs for an organization | User (API key/JWT) | | ||
| | `/api/v1/orgs/{org_id}/projects/{project_id}/audit_logs` | GET | List audit logs for a project | User (API key/JWT) | | ||
|
|
||
| ## List Organization Audit Logs | ||
|
|
||
| ``` | ||
| GET /api/v1/orgs/{org_id}/audit_logs | ||
| ``` | ||
|
|
||
| Returns a paginated, cursor-based list of audit log entries scoped to an organization. Results are ordered newest-first. | ||
|
|
||
| ### Authentication | ||
|
|
||
| Requires a valid user identity (API key or bearer token). The authenticated principal must be a member of the organization. | ||
|
|
||
| ### Rate limit | ||
|
|
||
| 100 requests per 60 seconds (per IP). | ||
|
|
||
| ### Path parameters | ||
|
|
||
| | Parameter | Type | Required | Description | | ||
| | -- | -- | -- | -- | | ||
| | `org_id` | UUID | Yes | Organization ID | | ||
|
|
||
| ### Query parameters | ||
|
|
||
| | Parameter | Type | Required | Default | Constraints | Description | | ||
| | -- | -- | -- | -- | -- | -- | | ||
| | `action` | string | No | `null` | \-- | Filter by action (for example `AUDIT_ACTION_CREATED`) | | ||
| | `source` | string | No | `null` | \-- | Filter by source (for example `AUDIT_SOURCE_API`) | | ||
| | `resource_type` | string | No | `null` | \-- | Filter by resource type | | ||
| | `cursor` | string | No | `null` | \-- | Pagination cursor from a previous response | | ||
| | `limit` | int | No | `50` | `1` -- `100` | Number of results per page | | ||
|
|
||
| ### Response | ||
|
|
||
| **Status:** `200 OK` | ||
|
|
||
| ```json | ||
| { | ||
| "code": 200, | ||
| "msg": "Request successful", | ||
| "data": { | ||
| "items": [ | ||
| { | ||
| "id": "d290f1ee-6c54-4b01-90e6-d701748f0851", | ||
| "event_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", | ||
| "timestamp": "2026-02-24T12:34:56.789Z", | ||
| "client_ip": "203.0.113.42", | ||
| "action": "AUDIT_ACTION_CREATED", | ||
| "source": "AUDIT_SOURCE_DASHBOARD", | ||
| "display_name": "jane@example.com", | ||
| "customer_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", | ||
| "organization_id": "550e8400-e29b-41d4-a716-446655440000", | ||
| "project_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", | ||
| "principal_id": "usr_abc123", | ||
| "user_id": "user-456", | ||
| "principal_type": "ACCOUNT", | ||
| "resource_type": "RESOURCE_TYPE_PROJECT", | ||
| "resource_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", | ||
| "resource_display": "My Project", | ||
| "data": { "key": "value" }, | ||
| "created_time": "2026-02-24T12:34:57.000Z" | ||
| } | ||
| ], | ||
| "next_cursor": "MjAyNi0wMi0yNFQxMjo...", | ||
| "has_more": true | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Pagination | ||
|
|
||
| Pagination is cursor-based. When `has_more` is `true`, pass the `next_cursor` value as the `cursor` query parameter in the next request. The cursor is an opaque base64-encoded string; do not construct or modify it. | ||
|
|
||
| --- | ||
|
|
||
| ## List Project Audit Logs | ||
|
|
||
| ``` | ||
| GET /api/v1/orgs/{org_id}/projects/{project_id}/audit_logs | ||
| ``` | ||
|
|
||
| Identical to the organization endpoint, but additionally scoped to a single project. The authenticated principal must have access to both the organization and the project. | ||
|
|
||
| ### Authentication | ||
|
|
||
| Requires a valid user identity (API key or bearer token). The principal must be a member of both the organization and the project. | ||
|
|
||
| ### Rate limit | ||
|
|
||
| 100 requests per 60 seconds (per IP). | ||
|
|
||
| ### Path parameters | ||
|
|
||
| | Parameter | Type | Required | Description | | ||
| | -- | -- | -- | -- | | ||
| | `org_id` | UUID | Yes | Organization ID | | ||
| | `project_id` | UUID | Yes | Project ID | | ||
|
|
||
| ### Query parameters | ||
|
|
||
| Same as [List Organization Audit Logs](<#query-parameters>). | ||
|
|
||
| ### Response | ||
|
|
||
| Same schema as [List Organization Audit Logs](<#response>). The `project_id` filter is applied automatically from the path. | ||
|
|
||
| --- | ||
|
|
||
| ## Enums | ||
|
|
||
| ### AuditAction | ||
|
|
||
| | Value | Number | Description | | ||
| | -- | -- | -- | | ||
| | `AUDIT_ACTION_UNSPECIFIED` | 0 | Default / unknown | | ||
| | `AUDIT_ACTION_CREATED` | 1 | Resource was created | | ||
| | `AUDIT_ACTION_UPDATED` | 2 | Resource was updated | | ||
| | `AUDIT_ACTION_DELETED` | 3 | Resource was deleted | | ||
| | `AUDIT_ACTION_DISABLED` | 4 | Resource was disabled | | ||
|
|
||
| ### AuditSource | ||
|
|
||
| | Value | Number | Description | | ||
| | -- | -- | -- | | ||
| | `AUDIT_SOURCE_UNSPECIFIED` | 0 | Default / unknown | | ||
| | `AUDIT_SOURCE_API` | 1 | API call | | ||
| | `AUDIT_SOURCE_DASHBOARD` | 2 | Dashboard action | | ||
| | `AUDIT_SOURCE_CLI` | 3 | CLI invocation | | ||
| | `AUDIT_SOURCE_SDK` | 4 | SDK call | | ||
| | `AUDIT_SOURCE_SYSTEM` | 5 | Internal system operation | | ||
|
|
||
| ### ResourceType | ||
|
|
||
| | Value | Number | Description | | ||
| | -- | -- | -- | | ||
| | `RESOURCE_TYPE_UNSPECIFIED` | 0 | Default / unknown | | ||
| | `RESOURCE_TYPE_API_KEY` | 1 | API key | | ||
| | `RESOURCE_TYPE_CUSTOMER` | 2 | Customer | | ||
| | `RESOURCE_TYPE_INVITATION` | 3 | Invitation | | ||
| | `RESOURCE_TYPE_ORGANIZATION` | 4 | Organization | | ||
| | `RESOURCE_TYPE_PROJECT` | 5 | Project | | ||
| | `RESOURCE_TYPE_PROJECT_MEMBER` | 6 | Project member | | ||
| | `RESOURCE_TYPE_USER` | 7 | User | | ||
| | `RESOURCE_TYPE_WORKER` | 8 | Worker | | ||
| | `RESOURCE_TYPE_GATEWAY` | 9 | Gateway | | ||
| | `RESOURCE_TYPE_PLUGIN` | 10 | Plugin | | ||
| | `RESOURCE_TYPE_HOOK` | 11 | Hook | | ||
| | `RESOURCE_TYPE_MODEL` | 12 | Model | | ||
| | `RESOURCE_TYPE_AUTH_PROVIDER` | 13 | Auth provider | | ||
| | `RESOURCE_TYPE_SECRET` | 14 | Secret | | ||
| | `RESOURCE_TYPE_USER_CONNECTION` | 15 | User connection | | ||
| | `RESOURCE_TYPE_DEPLOYMENT` | 16 | Deployment | | ||
| | `RESOURCE_TYPE_SETTING` | 17 | Setting | | ||
|
|
||
| --- | ||
|
|
||
| ## Response item schema | ||
|
|
||
| Each item in the `items` array of a list response has the following shape: | ||
|
|
||
| | Field | Type | Description | | ||
| | -- | -- | -- | | ||
| | `id` | UUID | Internal database ID | | ||
| | `event_id` | UUID | Event identifier | | ||
| | `timestamp` | datetime (ISO) | When the event occurred | | ||
| | `client_ip` | string / null | Originating client IP | | ||
| | `action` | string | Action name (see AuditAction) | | ||
| | `source` | string | Source name (see AuditSource) | | ||
| | `display_name` | string | Human-readable caller identity | | ||
| | `customer_id` | UUID / null | Customer ID | | ||
| | `organization_id` | UUID | Organization ID | | ||
| | `project_id` | UUID / null | Project ID | | ||
| | `principal_id` | string | Principal ID | | ||
| | `user_id` | string / null | User ID | | ||
| | `principal_type` | string | Principal type (for example `ACCOUNT`) | | ||
| | `resource_type` | string / null | Resource type (see ResourceType) | | ||
| | `resource_id` | string / null | Resource identifier | | ||
| | `resource_display` | string / null | Human-readable resource name | | ||
| | `data` | object / null | Structured event payload | | ||
| | `created_time` | datetime (ISO) | When the record was persisted | | ||
|
|
||
| --- | ||
|
|
||
| ## Failure handling | ||
|
|
||
| * Standard error envelope with `code` and `msg` fields. Common failures are `401` (unauthenticated), `403` (not a member of the org/project), and `429` (rate limited). | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write-good.Illusions: The repetition issue is between line 127 and 129, but the actual content shows proper heading structure, so no change needed