Skip to main content
Version: 2019-05-29 (Current)

Search Audits

Search audit logs for account activity. Use this endpoint to find and filter audit records by actor, action type, resource, and time period. Audit logs provide a comprehensive trail of all actions performed on your account.

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`scope`STRING(required)
Data type to search. Must be set to "audit" for audit log searches.
Example:"audit"
Default:"audit"
Recommended - 2 fieldsRecommended Parameters
โ–ผ
`query`STRING(optional)
Search query text for full-text search. Searches across audit descriptions, actor information, and resource identifiers.
Example:"routing_group"
`filters`OBJECT(optional)
Search filters to narrow results. Available filters include created date, actor email, actor type, auditable type, auditable UID, and verb.
Example:{"created":"2024/01/01..2024/12/31","actor_email":["admin@example.com"]}
Filter Options - 6 fieldsFilter Properties
โ–ผ
`filters[created]`DATE-TIME(optional)
Filter by creation date. Supports date ranges using format: YYYY/MM/DD..YYYY/MM/DD
Example:"2024/01/01..2024/12/31"
`filters[actor_email]`ARRAY(optional)
Filter by actor email addresses. Accepts an array of email strings to match against the user who performed the action.
Example:["admin@example.com","user@example.com"]
`filters[actor_type]`STRING(optional)
Filter by actor type. Specifies the type of entity that performed the action.
Example:"user"
Values:user
`filters[auditable_type]`STRING(optional)
Filter by auditable resource type. Specifies the type of resource that was affected by the action.
Example:"routing_group"
Values:routing_group
`filters[auditable_uid]`STRING(optional)
Filter by the unique identifier of the audited resource.
Example:"rgrp_test_5xuy4w91xqz7d1w9u0t"
`filters[verb]`STRING(optional)
Filter by action verb. Specifies the type of action that was performed.
Example:"rules_switched"
Values:rules_switched
Pagination - 2 fieldsPagination Parameters

Responsesโ€‹

200

Successful search

Returns a search object containing paginated audit log results in the data array.

Response structure:
  • object - String value "search"
  • data - Array of audit objects matching the query
  • page - Current page number
  • per_page - Records per page
  • total - Total records matching query
  • total_pages - Total number of pages
  • filters - Applied search filters
  • query - Search query used
  • scope - Resource type searched (audit)
  • location - API endpoint path
Audit object structure:
  • object - String value "audit"
  • id - Unique audit log identifier
  • actor_email - Email of the user who performed the action
  • actor_type - Type of actor (e.g., user)
  • auditable_type - Type of resource affected
  • auditable_uid - Unique ID of the affected resource
  • verb - Action performed
  • created_at - Timestamp of the action

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Missing required scope parameter
  • Invalid scope value (must be "audit")
  • Malformed filters object
  • Invalid date format in filters
  • Invalid enum value for actor_type, auditable_type, or verb

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

403

Forbidden

Access denied. Your account does not have permission to access audit logs.

Common causes:
  • Insufficient account permissions
  • Audit logs not enabled for your account
  • API key does not have audit read permissions

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/audits/search \
-X GET \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "scope=audit" \
-d "filters[created]=2024/01/01..2024/12/31" \
-d "filters[actor_email][]=admin@example.com" \
-d "filters[verb]=rules_switched"

Error and result codesโ€‹

Common Filter Patternsโ€‹

Filter SyntaxDescriptionExample
filters[created]=date..dateDate range2024/01/01..2024/12/31
filters[actor_email][]=valueEmail arrayadmin@example.com
filters[verb]=valueExact matchrules_switched
filters[auditable_type]=valueResource typerouting_group

Available Filtersโ€‹

FilterTypeDescription
createddate-timeFilter by action timestamp
actor_emailarrayFilter by user email(s)
actor_typestringFilter by actor type (user)
auditable_typestringFilter by resource type (routing_group)
auditable_uidstringFilter by resource identifier
verbstringFilter by action type (rules_switched)

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 1 fields
โ–ผ
Recommended - 3 fields
Additional - 6 fields
Your IP: ...Loading...