Qoder enterprise audit logs record key operations within an organization, providing traceable data for security investigations, compliance audits, and external log integration.
This document describes the audit event data model and the current method for continuously retrieving new events through OpenAPI. Retrieved events can be synchronized to a SIEM, data lake, or other internal security platform.
Audit logs use a pull model: a customer-side synchronization program periodically calls Qoder OpenAPI to retrieve a batch of events and save the cursor. The next pull continues from that cursor.
This approach does not require Qoder to store the addresses or credentials of customers' external systems. Customers control the polling cadence, storage location, and retention policy.
Using the audit log OpenAPI requires the following:
Store API Keys as sensitive credentials. Do not write them to code repositories, logs, or client applications. Use a separate API Key for log synchronization and rotate it regularly according to your organization's credential management policy.
Each event has a stable
Audit events may contain email addresses, IP addresses, and client information. Integrators should configure access controls, retention periods, and data masking policies according to applicable regulations and organizational policies.
The continuous pull endpoint is intended for external systems that need incremental audit log synchronization, including SIEMs, data lakes, and security operations platforms.
Example response:
Pass back the
Do not parse, modify, or construct
Use a single worker to pull the event stream for the same organization sequentially:
The synchronization program should follow this order:
Events are returned in ingestion order, with no guarantee of strict ordering by
If the initial pull uses
Rate limits may vary by environment and organization configuration. Clients should not rely on fixed quotas and should always implement backoff for 429 responses.
1. Log retrieval
Audit logs use a pull model: a customer-side synchronization program periodically calls Qoder OpenAPI to retrieve a batch of events and save the cursor. The next pull continues from that cursor.
2. Prerequisites
Using the audit log OpenAPI requires the following:
- The organization's plan includes the
enterprise.auditcapability; - A valid API Key associated with the target organization is used;
- The API Key is passed in the request as a Bearer Token:
3. Audit event model
Each event has a stable event_id and records the event type, occurrence time, actor, resource, and execution result.
3.1 Top-level fields
| Field | Type | Description |
|---|---|---|
event_id | string | Stable unique identifier for the event. Use this field for idempotent deduplication when synchronizing downstream |
event_type | string | Specific event type, such as MemberLogin |
event_category | string | Event category, such as Member |
severity | string | Event severity, such as info, warning, or critical |
created_at | string | Event occurrence time, in RFC3339 format and UTC |
actor | object | User or system principal initiating the operation |
resource | object | Resource being operated on; may be absent in some events |
action | object | Operation type, execution status, and optional duration |
context | object | Request, client, and other context; fields vary by event type |
changes | object | Information before and after a change; present only in some change events |
metadata | object | Extended information specific to the event type |
3.2 Actor fields
| Field | Type | Description |
|---|---|---|
actor_id | string | Actor identifier |
actor_type | string | Actor type |
display_name | string | Display name; may be empty |
email | string | Email address; may be empty |
ip_address | string | Source IP address; may be empty |
user_agent | string | Client User-Agent; may be empty |
session_id | string | Session identifier; may be empty |
4. Continuously pulling audit events
The continuous pull endpoint is intended for external systems that need incremental audit log synchronization, including SIEMs, data lakes, and security operations platforms.
4.1 Query parameters
| Parameter | Required | Description |
|---|---|---|
startTime | Required for the initial pull | Synchronization start time in RFC3339 format. Ignored when nextToken is provided |
nextToken | Required for subsequent pulls | Opaque cursor returned by the previous response; must be passed back unchanged |
maxResults | No | Number of events per page; defaults to 100, maximum 1000 |
eventType | No | Event type filter; supports comma-separated exact values or a trailing wildcard such as ai.* |
eventCategory | No | Event category filter; supports multiple comma-separated values |
startTime provides only a lower time bound. The endpoint continuously pulls from that time through the latest events, without a fixed end time. The accessible historical range is subject to the organization's actual data retention policy.
4.2 Initial pull
| Response field | Description |
|---|---|
events | Events in this batch, returned in ingestion order |
nextToken | Cursor for the next pull; returned even when there are no new events |
hasMore | true indicates a remaining backlog and requires an immediate next pull; false indicates that the consumer is currently caught up |
returnedCount | Actual number of events returned in this batch |
4.3 Subsequent pulls
Pass back the nextToken from the previous response unchanged:
nextToken yourself. The cursor format is a server-side implementation detail and may evolve between versions.
5. Continuous synchronization workflow
Use a single worker to pull the event stream for the same organization sequentially:
- Successfully write the entire batch of events downstream;
- Persist the
nextTokenreturned with this batch; - If writing or cursor persistence fails, retry with the old cursor;
- Always deduplicate downstream idempotently by
event_id.
5.1 Ordering semantics
Events are returned in ingestion order, with no guarantee of strict ordering by created_at. Late-arriving or backfilled events may appear later in the event stream.
Integrators should:
- Deduplicate by
event_id; - Use
created_atfor business-time analysis; - Avoid using time gaps between adjacent events to determine whether events are missing;
- Allow for some late-arriving events in alerting and statistics tasks.
5.2 Filters
If the initial pull uses eventType or eventCategory, subsequent requests must retain the same filters. The server does not save filter sessions or check whether filters have changed. Changing filters midstream may skip events that the cursor has already passed.
Use separate synchronization tasks and separate nextToken values for different filters.
5.3 Polling and backoff
hasMore=true: request the next batch immediately;hasMore=false: wait before polling again with the returnednextToken;- Consecutive empty batches: gradually increase the interval, preferably to no more than 10 minutes;
- New events retrieved: return to a shorter polling interval;
- HTTP 429: wait according to the
Retry-Afterresponse header and retry with the same cursor; - Network errors or 5xx: retry with exponential backoff without advancing the cursor.
6. Error handling
| HTTP status code | Meaning | Recommended handling |
|---|---|---|
| 400 | Invalid parameters, missing startTime on the initial pull, or an invalid cursor | Correct the parameters; if the cursor is invalid, restart with an explicit startTime and deduplicate by event_id |
| 401 | Missing or invalid API Key | Check the Authorization header and credential status |
| 403 | The API Key cannot access the organization, or the organization's plan does not include auditing | Check the organization associated with the key and the enterprise.audit capability |
| 404 | Organization, route, or resource does not exist | Check the organization ID, request path, and environment configuration |
| 429 | The request triggered rate limiting or concurrency protection | Wait according to Retry-After, then retry the same request |
| 503 | The audit query service is temporarily unavailable | Retry with exponential backoff; contact Qoder support if failures persist |