iam.audit-logs.list

Search audit log entries, newest first

GET /iam/api/audit-logsIAM iam:GetAuditLogsRead

action takes comma-separated globs (iam:*,auth:SignIn); from is inclusive and to exclusive (ISO-8601); principal is exact (user/alice@acme.com, iam-user/ci, role/deployer/run-42). The response carries total.

Request syntax

GET /iam/api/audit-logs

Query parameters

  • actionOptional

    string

    Comma-separated action patterns, e.g. iam:*,auth:SignIn; omitted: every action

    Constraints: max 2000 chars

  • outcomeOptional

    enum

    success (Succeeded), error (allowed but Failed) or failure (Denied); omitted: every outcome

    One of: success, error, failure

  • principalOptional

    string

    One principal, exactly: user/alice@acme.com, iam-user/ci, role/deployer/run-42

    Constraints: max 300 chars

  • accessKeyIdOptional

    string

    Only entries made with this access key ID

    Constraints: max 64 chars

  • ipOptional

    string

    Only entries from this source IP address

    Constraints: max 64 chars

  • resourceIdOptional

    string

    Only entries about this resource ID, exactly

    Constraints: max 200 chars

  • requestIdOptional

    string

    Only the entries of this request ID

    Constraints: max 128 chars

  • callerTypeOptional

    enum

    Only entries by this kind of caller: console session, access key, connected app, CLI session, unauthenticated, SCIM provisioning, or the platform itself

    One of: session, access_key, oauth, cli_session, anonymous, scim, system

  • fromOptional

    string

    ISO-8601 time; entries at or after it (inclusive)

    Constraints: max 40 chars

  • toOptional

    string

    ISO-8601 time; entries before it (exclusive)

    Constraints: max 40 chars

  • searchOptional

    string

    Text to find, ignoring case, in the action, resource, IP address, request parameters, principal, access key ID, request ID, or the person's name or email

    Constraints: max 200 chars

  • limitRequired

    object

    Entries per page; default 50

    Constraints: JSON

  • offsetRequired

    object

    Entries to skip, for the next page; default 0

    Constraints: JSON

  • orderOptional

    enum

    desc lists the newest entry first, asc the oldest; default desc

    One of: asc, desc

    Default: "desc"

Response

200 with one page of entries in data and the number matching in total. Each entry: id, seq, createdAt, action, outcome, outcomeLabel (Succeeded, Failed or Denied), principal, callerType, userEmail, accessKeyId, ipAddress, resourceType, resourceId, resourceRn, httpMethod, requestPath, responseStatus, requestId, sessionContext, requestParams, responseElements, hash, … .

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow iam:GetAuditLogs on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud iam audit-logs list --limit '{}' --offset '{}'

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_iam_audit-logs_list.