Skip to Content
Endpoints

Audit Logs

How to retrieve audit logs using the public API

The audit logs endpoint allows administrators to retrieve security and activity events for compliance and monitoring purposes.

List Audit Logs

GET/api/public/v0/audit-logs

Returns a paginated list of audit log events. This endpoint uses cursor-based pagination for efficient retrieval of large datasets.

Authentication

Requires an API key with Admin role permissions. See Authentication for more details.

Restricted API Keys

You can create API keys that are restricted to only access this endpoint by naming them with the SIEM-LOG-ONLY prefix. This is useful for SIEM integrations or third-party services that only need audit log access.

For example, an API key named SIEM-LOG-ONLY-splunk or SIEM-LOG-ONLY-datadog will:

  • Be allowed to access GET /api/public/v0/audit-logs
  • Be blocked from accessing all other API endpoints (returns 403 Forbidden)

This provides a security best practice of least-privilege access for audit log integrations.

Subscription Requirements

This endpoint is only available on plans with the Advanced Auth feature (Business and Enterprise plans). Requests from tenants without this feature will receive a 402 Payment Required response.

Query Parameters

ParameterTypeDescriptionDefaultExample
afternumberCursor for pagination. Returns events with an ID greater than this value. When omitted or 0, the list starts at the first event of the current month (UTC), and is empty if the month has no events yet.0after=12345
countnumberNumber of events to return per page. Accepted range: 1–1,000.100count=250

Response Format

Status: 200 OK

{
  after: number          // Cursor for the next page: the last event's ID, or the request's `after` (0 if omitted) when `events` is empty
  count: number          // Number of events returned in this response
  events: Array<{
    id: number           //   Event ID
    user: {              //   User who performed the action (null for system events)
      id: number         //     User ID
      name: string       //     Name of the user
      email: string      //     Email address of the user
    } | null
    action: string       //   Action type (see Action Types below)
    ip: string           //   IP address of the request
    userAgent: string    //   User agent string
    createdAt: datetime  //   Time of the event
    meta?: object        //   Additional context about the action (see Action Types below)
  }>
}

Action Types

The meta field provides additional context about the action. It is omitted from the response when empty. New meta fields are sometimes added to existing actions. Older events are updated to include them where the information is available, so some older events may not include every field listed below.

For authentication failure actions, user identifies the account associated with the attempted credential. It does not mean the request successfully authenticated as that user. The reason and flow meta fields describe why authentication failed and which authentication flow was involved.

For SCIM actions, user is the owner of the API key the identity provider uses. The provisioned user is identified by the userId and userName meta fields.

For actions an owner or admin takes on another user, such as delete_user or request_password_reset, user is the owner or admin. The affected user is identified by the user_id and email meta fields.

ActionDescriptionMeta Fields
2fa_disableTOTP disabled or a passkey removedmethod (totp or passkey), name (passkey name, for passkey only)
2fa_enableTOTP enabled or a passkey addedmethod (totp or passkey), name (passkey name, for passkey only)
2fa_revokeAn owner or admin revoked a user's TOTP, backup codes and passkeys, and signed them outuser_id, email (the user whose two-factor authentication was revoked)
api_key.createdAPI key was createdapi_key_id, api_key_name
api_key.deletedAPI key was deletedapi_key_id, api_key_name, plus user_id and email of the key's owner when an admin deleted another user's key
api_key.updatedAPI key was renamedapi_key_id, api_key_name, previous_api_key_name, plus user_id and email of the key's owner when an admin renamed another user's key
archive_projectProject was archivedproject_id, project_code, project_title
auth.2fa_failedTwo-factor authentication failedreason, flow
auth.api_key_failedAPI key authentication failedreason, flow, api_key_id, api_key_name
auth.google_login_failedGoogle login failedreason, flow
auth.ip_or_user_agent_changedIP address or user agent changed during session
auth.oauth_token_failedOAuth token authentication failedreason, flow, oauth_authorization_id
auth.other_sessions_revokedAll other sessions were revokedcount (active, non-staff sessions revoked)
auth.password_login_failedPassword login failedreason, flow
auth.password_verification_failedPassword verification failedreason, flow
auth.saml_login_failedSAML login failedreason, flow
auth.session_failedSession authentication failedreason, flow, source
auth.session_revokedSession was revokedsession_id, ip and user_agent of the revoked session
cancel_inviteUser invitation was cancelledemail (the invited email address)
company_settings_changedCompany name or URL was changedOnly the changed settings, each with its previous_ value: name, url (the subdomain)
create_projectProject was createdproject_id, project_code, project_title
delete_projectProject was deletedproject_id, project_code, project_title
delete_userAn owner or admin deleted a useruser_id, email, name, role (the deleted user, as they were before deletion anonymized them)
email_changeUser changed their email addressold (previous email), new (new email)
integration.createdIssue tracker integration was createdintegration_id, integration_title, integration_type, plus type-specific fields: new_url and view_url (custom), account (GitHub), email and url (Jira), organization_key (Linear)
integration.deletedIssue tracker integration was deletedintegration_id, integration_title, integration_type, linked_project_count
integration.project_linkedProject was linked to an issue tracker integrationintegration_id, integration_title, integration_type, project_id, project_code, project_title, plus relation-config fields per integration type: github_repo (GitHub), jira_project_id and jira_project_name (Jira), linear_team_id and linear_team_name (Linear). When the project was previously linked, the prior config is included with a previous_ prefix (e.g., previous_integration_id, previous_integration_title, previous_github_repo)
integration.project_unlinkedProject was unlinked from an issue tracker integrationSame as integration.project_linked but without the previous_ fields
integration.updatedIssue tracker integration configuration was updatedintegration_id, integration_title, integration_type, plus only the fields that changed (from the same set as integration.created)
invite_userUser was invited to the organizationemail (the invited email address), permissions (a JSON string with role, allow_all_projects and project_ids)
loginUser logged inmethod (totp, backup_code or passkey, for 2FA logins only)
logoutUser logged out
migration_credentials_sharedAccess to the tool being migrated from was shared with the QA Sphere migration teamsource (qase, testrail, testomat or zebrunner)
oauth.authorization_createdOAuth authorization granted (e.g., for QAS CLI)grant_type, client_id, authorization_id
oauth.authorization_revokedOAuth authorization revokedclient_id, authorization_id, user_id (the user whose authorization was revoked), revoked_by (client when the OAuth client revoked it)
password_changeUser changed their password
password_resetPassword was reset
registerNew user registered
report_share_link.createdA link to a report was createdshare_link_id, report_id, project_id, project_code, public, expires_at (when the link expires)
report_share_link.revokedA link to a report was revokedshare_link_id, report_id, project_id, project_code
request_password_resetAn admin reset a user's password and emailed them a reset linkuser_id, email (the user whose password was reset)
resend_inviteUser invitation was sent againSame as invite_user
scim.user_createUser provisioned via SCIMuserId, userName, apiKeyId, externalId (when set on the user)
scim.user_deactivateUser suspended via SCIMSame as scim.user_create
scim.user_reactivateUser unsuspended via SCIMSame as scim.user_create
scim.user_updateUser attributes updated via SCIMSame as scim.user_create
security_settings_changedSecurity settings were changedOnly the changed settings, each with its previous_ value: enforce_2fa, allowed_auth_providers, ip_allowlist, google_domain_allowlist, saml_idp_metadata_url, saml_idp_metadata_xml (**** when set, as the XML itself isn't recorded)
slack_disconnectSlack workspace was disconnected
slack_installSlack workspace was connectedteam_id, team_name, domain
slack_link_userSlack user was linked to a QA Sphere userteam_id, slack_user_id, source (oauth_install when auto-linked during install)
slack_subscribeSlack channel subscribed to project eventsteam_id, channel_id, channel_name, project_id, project_code, event_types
slack_unsubscribeSlack channel unsubscribed from project eventsteam_id, channel_id, channel_name, project_id, project_code, event_types, remaining
suspend_userAn owner or admin suspended a user and signed them outuser_id, email (the suspended user)
unarchive_projectProject was unarchivedproject_id, project_code, project_title
unsuspend_userAn owner or admin unsuspended a useruser_id, email (the unsuspended user)
update_userA user's role or project access was changeduser_id, email (the updated user), plus the changed fields, each with its previous_ value: role, allow_all_projects, project_codes (when allow_all_projects is false). Project access isn't recorded for owners and admins, who see every project, so its previous_ fields are missing when the user was one. When ownership is transferred, a second event records the previous owner becoming an admin
webhook.createdWebhook was createdwebhook_id, webhook_name, endpoint, enabled, event_types, allow_all_projects, allowed_project_count (when allow_all_projects is false). secret, headers and payload appear as **** when set (values are redacted)
webhook.deletedWebhook was deletedSame as webhook.created
webhook.updatedWebhook configuration was updatedwebhook_id, webhook_name, plus only the fields that changed (from the same set as webhook.created; secret/headers/payload changes appear as ****)

Example Request

curl \
  -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/audit-logs?count=50"

Example Response

{
  "after": 156,
  "count": 3,
  "events": [
    {
      "id": 154,
      "user": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com"
      },
      "action": "login",
      "ip": "203.0.113.10",
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
      "createdAt": "2025-01-28T10:30:00Z"
    },
    {
      "id": 155,
      "user": {
        "id": 1,
        "name": "John Doe",
        "email": "john@example.com"
      },
      "action": "archive_project",
      "ip": "203.0.113.10",
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
      "createdAt": "2025-01-28T11:00:00Z",
      "meta": {
        "project_id": "1CKgJ5HMU_2apSDSQWRw6Ys",
        "project_code": "PROJ",
        "project_title": "My Project"
      }
    },
    {
      "id": 156,
      "user": {
        "id": 2,
        "name": "Jane Smith",
        "email": "jane@example.com"
      },
      "action": "email_change",
      "ip": "203.0.113.11",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
      "createdAt": "2025-01-28T12:00:00Z",
      "meta": {
        "old": "jane.old@example.com",
        "new": "jane@example.com"
      }
    }
  ]
}

Pagination

This endpoint uses cursor-based pagination for efficient retrieval:

  1. Make an initial request without the after parameter to get the first page, which starts at the first event of the current month
  2. Use the after value from the response as the after parameter for the next request
  3. Continue until you receive fewer events than requested (end of data)

Pagination Example

# First page
curl -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/audit-logs?count=100"
# Response: { "after": 100, "count": 100, "events": [...] }

# Second page (using after value from previous response)
curl -H "Authorization: ApiKey your.api.key.here" \
  "https://your-company.your-region-code.qasphere.com/api/public/v0/audit-logs?after=100&count=100"
# Response: { "after": 156, "count": 56, "events": [...] }
# count < 100 indicates this is the last page

When after is 0 or omitted, the response starts from the first event of the current month. If no events exist for the current month, an empty result is returned. The after value in the response equals the input after value when there are no more events to return.

Error Responses

Status CodeDescription
402Subscription plan lacks Advanced Auth feature
403The caller is not an owner or admin

This endpoint enables you to:

  • Monitor user authentication activity
  • Track security-related changes (2FA, password changes)
  • Audit project lifecycle events
  • Integrate with SIEM systems for compliance
  • Build custom security dashboards