Skip to content
Primary navigation

List audit logs

AuditLogListPage admin().organization().auditLogs().list(AuditLogListParamsparams = AuditLogListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/organization/audit_logs

List user actions and configuration changes within this organization.

ParametersExpand Collapse
AuditLogListParams params
Optional<List<String>> actorEmails

Return only events performed by users with these emails.

Optional<List<String>> actorIds

Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.

Optional<String> after

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Optional<String> before

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.

Optional<EffectiveAt> effectiveAt

Return only events whose effective_at (Unix seconds) is in this range.

Optional<Long> gt

Return only events whose effective_at (Unix seconds) is greater than this value.

Optional<Long> gte

Return only events whose effective_at (Unix seconds) is greater than or equal to this value.

Optional<Long> lt

Return only events whose effective_at (Unix seconds) is less than this value.

Optional<Long> lte

Return only events whose effective_at (Unix seconds) is less than or equal to this value.

Optional<List<EventType>> eventTypes

Return only events with a type in one of these values. For example, project.created. For all options, see the documentation for the audit log object.

API_KEY_CREATED("api_key.created")
API_KEY_UPDATED("api_key.updated")
API_KEY_DELETED("api_key.deleted")
CERTIFICATE_CREATED("certificate.created")
CERTIFICATE_UPDATED("certificate.updated")
CERTIFICATE_DELETED("certificate.deleted")
CERTIFICATES_ACTIVATED("certificates.activated")
CERTIFICATES_DEACTIVATED("certificates.deactivated")
CHECKPOINT_PERMISSION_CREATED("checkpoint.permission.created")
CHECKPOINT_PERMISSION_DELETED("checkpoint.permission.deleted")
EXTERNAL_KEY_REGISTERED("external_key.registered")
EXTERNAL_KEY_REMOVED("external_key.removed")
GROUP_CREATED("group.created")
GROUP_UPDATED("group.updated")
GROUP_DELETED("group.deleted")
INVITE_SENT("invite.sent")
INVITE_ACCEPTED("invite.accepted")
INVITE_DELETED("invite.deleted")
IP_ALLOWLIST_CREATED("ip_allowlist.created")
IP_ALLOWLIST_UPDATED("ip_allowlist.updated")
IP_ALLOWLIST_DELETED("ip_allowlist.deleted")
IP_ALLOWLIST_CONFIG_ACTIVATED("ip_allowlist.config.activated")
IP_ALLOWLIST_CONFIG_DEACTIVATED("ip_allowlist.config.deactivated")
LOGIN_SUCCEEDED("login.succeeded")
LOGIN_FAILED("login.failed")
LOGOUT_SUCCEEDED("logout.succeeded")
LOGOUT_FAILED("logout.failed")
ORGANIZATION_UPDATED("organization.updated")
PROJECT_CREATED("project.created")
PROJECT_UPDATED("project.updated")
PROJECT_ARCHIVED("project.archived")
PROJECT_DELETED("project.deleted")
RATE_LIMIT_UPDATED("rate_limit.updated")
RATE_LIMIT_DELETED("rate_limit.deleted")
RESOURCE_DELETED("resource.deleted")
TUNNEL_CREATED("tunnel.created")
TUNNEL_UPDATED("tunnel.updated")
TUNNEL_DELETED("tunnel.deleted")
ROLE_CREATED("role.created")
ROLE_UPDATED("role.updated")
ROLE_DELETED("role.deleted")
ROLE_ASSIGNMENT_CREATED("role.assignment.created")
ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")
SCIM_ENABLED("scim.enabled")
SCIM_DISABLED("scim.disabled")
SERVICE_ACCOUNT_CREATED("service_account.created")
SERVICE_ACCOUNT_UPDATED("service_account.updated")
SERVICE_ACCOUNT_DELETED("service_account.deleted")
USER_ADDED("user.added")
USER_UPDATED("user.updated")
USER_DELETED("user.deleted")
Optional<Long> limit

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Optional<List<String>> projectIds

Return only events for these projects.

Optional<List<String>> resourceIds

Return only events performed on these targets. For example, a project ID updated.

ReturnsExpand Collapse
class AuditLogListResponse:

A log of a user action or configuration change within this organization.

String id

The ID of this log.

long effectiveAt

The Unix timestamp (in seconds) of the event.

formatunixtime
Type type

The event type.

One of the following:
API_KEY_CREATED("api_key.created")
API_KEY_UPDATED("api_key.updated")
API_KEY_DELETED("api_key.deleted")
CERTIFICATE_CREATED("certificate.created")
CERTIFICATE_UPDATED("certificate.updated")
CERTIFICATE_DELETED("certificate.deleted")
CERTIFICATES_ACTIVATED("certificates.activated")
CERTIFICATES_DEACTIVATED("certificates.deactivated")
CHECKPOINT_PERMISSION_CREATED("checkpoint.permission.created")
CHECKPOINT_PERMISSION_DELETED("checkpoint.permission.deleted")
EXTERNAL_KEY_REGISTERED("external_key.registered")
EXTERNAL_KEY_REMOVED("external_key.removed")
GROUP_CREATED("group.created")
GROUP_UPDATED("group.updated")
GROUP_DELETED("group.deleted")
INVITE_SENT("invite.sent")
INVITE_ACCEPTED("invite.accepted")
INVITE_DELETED("invite.deleted")
IP_ALLOWLIST_CREATED("ip_allowlist.created")
IP_ALLOWLIST_UPDATED("ip_allowlist.updated")
IP_ALLOWLIST_DELETED("ip_allowlist.deleted")
IP_ALLOWLIST_CONFIG_ACTIVATED("ip_allowlist.config.activated")
IP_ALLOWLIST_CONFIG_DEACTIVATED("ip_allowlist.config.deactivated")
LOGIN_SUCCEEDED("login.succeeded")
LOGIN_FAILED("login.failed")
LOGOUT_SUCCEEDED("logout.succeeded")
LOGOUT_FAILED("logout.failed")
ORGANIZATION_UPDATED("organization.updated")
PROJECT_CREATED("project.created")
PROJECT_UPDATED("project.updated")
PROJECT_ARCHIVED("project.archived")
PROJECT_DELETED("project.deleted")
RATE_LIMIT_UPDATED("rate_limit.updated")
RATE_LIMIT_DELETED("rate_limit.deleted")
RESOURCE_DELETED("resource.deleted")
TUNNEL_CREATED("tunnel.created")
TUNNEL_UPDATED("tunnel.updated")
TUNNEL_DELETED("tunnel.deleted")
ROLE_CREATED("role.created")
ROLE_UPDATED("role.updated")
ROLE_DELETED("role.deleted")
ROLE_ASSIGNMENT_CREATED("role.assignment.created")
ROLE_ASSIGNMENT_DELETED("role.assignment.deleted")
SCIM_ENABLED("scim.enabled")
SCIM_DISABLED("scim.disabled")
SERVICE_ACCOUNT_CREATED("service_account.created")
SERVICE_ACCOUNT_UPDATED("service_account.updated")
SERVICE_ACCOUNT_DELETED("service_account.deleted")
USER_ADDED("user.added")
USER_UPDATED("user.updated")
USER_DELETED("user.deleted")
Optional<Actor> actor

The actor who performed the audit logged action.

Optional<ApiKey> apiKey

The API Key used to perform the audit logged action.

Optional<String> id

The tracking id of the API key.

Optional<ServiceAccount> serviceAccount

The service account that performed the audit logged action.

Optional<String> id

The service account id.

Optional<Type> type

The type of API key. Can be either user or service_account.

One of the following:
USER("user")
SERVICE_ACCOUNT("service_account")
Optional<User> user

The user who performed the audit logged action.

Optional<String> id

The user id.

Optional<String> email

The user email.

Optional<Session> session

The session in which the audit logged action was performed.

Optional<String> ipAddress

The IP address from which the action was performed.

Optional<User> user

The user who performed the audit logged action.

Optional<String> id

The user id.

Optional<String> email

The user email.

Optional<Type> type

The type of actor. Is either session or api_key.

One of the following:
SESSION("session")
API_KEY("api_key")
Optional<ApiKeyCreated> apiKeyCreated

The details for events with this type.

Optional<String> id

The tracking ID of the API key.

Optional<Data> data

The payload used to create the API key.

Optional<List<String>> scopes

A list of scopes allowed for the API key, e.g. ["api.model.request"]

Optional<ApiKeyDeleted> apiKeyDeleted

The details for events with this type.

Optional<String> id

The tracking ID of the API key.

Optional<ApiKeyUpdated> apiKeyUpdated

The details for events with this type.

Optional<String> id

The tracking ID of the API key.

Optional<ChangesRequested> changesRequested

The payload used to update the API key.

Optional<List<String>> scopes

A list of scopes allowed for the API key, e.g. ["api.model.request"]

Optional<CertificateCreated> certificateCreated

The details for events with this type.

Optional<String> id

The certificate ID.

Optional<String> name

The name of the certificate.

Optional<CertificateDeleted> certificateDeleted

The details for events with this type.

Optional<String> id

The certificate ID.

Optional<String> certificate

The certificate content in PEM format.

Optional<String> name

The name of the certificate.

Optional<CertificateUpdated> certificateUpdated

The details for events with this type.

Optional<String> id

The certificate ID.

Optional<String> name

The name of the certificate.

Optional<CertificatesActivated> certificatesActivated

The details for events with this type.

Optional<List<Certificate>> certificates
Optional<String> id

The certificate ID.

Optional<String> name

The name of the certificate.

Optional<CertificatesDeactivated> certificatesDeactivated

The details for events with this type.

Optional<List<Certificate>> certificates
Optional<String> id

The certificate ID.

Optional<String> name

The name of the certificate.

Optional<CheckpointPermissionCreated> checkpointPermissionCreated

The project and fine-tuned model checkpoint that the checkpoint permission was created for.

Optional<String> id

The ID of the checkpoint permission.

Optional<Data> data

The payload used to create the checkpoint permission.

Optional<String> fineTunedModelCheckpoint

The ID of the fine-tuned model checkpoint.

Optional<String> projectId

The ID of the project that the checkpoint permission was created for.

Optional<CheckpointPermissionDeleted> checkpointPermissionDeleted

The details for events with this type.

Optional<String> id

The ID of the checkpoint permission.

Optional<ExternalKeyRegistered> externalKeyRegistered

The details for events with this type.

Optional<String> id

The ID of the external key configuration.

Optional<JsonValue> data

The configuration for the external key.

Optional<ExternalKeyRemoved> externalKeyRemoved

The details for events with this type.

Optional<String> id

The ID of the external key configuration.

Optional<GroupCreated> groupCreated

The details for events with this type.

Optional<String> id

The ID of the group.

Optional<Data> data

Information about the created group.

Optional<String> groupName

The group name.

Optional<GroupDeleted> groupDeleted

The details for events with this type.

Optional<String> id

The ID of the group.

Optional<GroupUpdated> groupUpdated

The details for events with this type.

Optional<String> id

The ID of the group.

Optional<ChangesRequested> changesRequested

The payload used to update the group.

Optional<String> groupName

The updated group name.

Optional<InviteAccepted> inviteAccepted

The details for events with this type.

Optional<String> id

The ID of the invite.

Optional<InviteDeleted> inviteDeleted

The details for events with this type.

Optional<String> id

The ID of the invite.

Optional<InviteSent> inviteSent

The details for events with this type.

Optional<String> id

The ID of the invite.

Optional<Data> data

The payload used to create the invite.

Optional<String> email

The email invited to the organization.

Optional<String> role

The role the email was invited to be. Is either owner or member.

Optional<IpAllowlistConfigActivated> ipAllowlistConfigActivated

The details for events with this type.

Optional<List<Config>> configs

The configurations that were activated.

Optional<String> id

The ID of the IP allowlist configuration.

Optional<String> name

The name of the IP allowlist configuration.

Optional<IpAllowlistConfigDeactivated> ipAllowlistConfigDeactivated

The details for events with this type.

Optional<List<Config>> configs

The configurations that were deactivated.

Optional<String> id

The ID of the IP allowlist configuration.

Optional<String> name

The name of the IP allowlist configuration.

Optional<IpAllowlistCreated> ipAllowlistCreated

The details for events with this type.

Optional<String> id

The ID of the IP allowlist configuration.

Optional<List<String>> allowedIps

The IP addresses or CIDR ranges included in the configuration.

Optional<String> name

The name of the IP allowlist configuration.

Optional<IpAllowlistDeleted> ipAllowlistDeleted

The details for events with this type.

Optional<String> id

The ID of the IP allowlist configuration.

Optional<List<String>> allowedIps

The IP addresses or CIDR ranges that were in the configuration.

Optional<String> name

The name of the IP allowlist configuration.

Optional<IpAllowlistUpdated> ipAllowlistUpdated

The details for events with this type.

Optional<String> id

The ID of the IP allowlist configuration.

Optional<List<String>> allowedIps

The updated set of IP addresses or CIDR ranges in the configuration.

Optional<LoginFailed> loginFailed

The details for events with this type.

Optional<String> errorCode

The error code of the failure.

Optional<String> errorMessage

The error message of the failure.

Optional<JsonValue> loginSucceeded

This event has no additional fields beyond the standard audit log attributes.

Optional<LogoutFailed> logoutFailed

The details for events with this type.

Optional<String> errorCode

The error code of the failure.

Optional<String> errorMessage

The error message of the failure.

Optional<JsonValue> logoutSucceeded

This event has no additional fields beyond the standard audit log attributes.

Optional<OrganizationUpdated> organizationUpdated

The details for events with this type.

Optional<String> id

The organization ID.

Optional<ChangesRequested> changesRequested

The payload used to update the organization settings.

Optional<String> apiCallLogging

How your organization logs data from supported API calls. One of disabled, enabled_per_call, enabled_for_all_projects, or enabled_for_selected_projects

Optional<String> apiCallLoggingProjectIds

The list of project ids if api_call_logging is set to enabled_for_selected_projects

Optional<String> description

The organization description.

Optional<String> name

The organization name.

Optional<String> threadsUiVisibility

Visibility of the threads page which shows messages created with the Assistants API and Playground. One of ANY_ROLE, OWNERS, or NONE.

Optional<String> title

The organization title.

Optional<String> usageDashboardVisibility

Visibility of the usage dashboard which shows activity and costs for your organization. One of ANY_ROLE or OWNERS.

Optional<Project> project

The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project.

Optional<String> id

The project ID.

Optional<String> name

The project title.

Optional<ProjectArchived> projectArchived

The details for events with this type.

Optional<String> id

The project ID.

Optional<ProjectCreated> projectCreated

The details for events with this type.

Optional<String> id

The project ID.

Optional<Data> data

The payload used to create the project.

Optional<String> name

The project name.

Optional<String> title

The title of the project as seen on the dashboard.

Optional<ProjectDeleted> projectDeleted

The details for events with this type.

Optional<String> id

The project ID.

Optional<ProjectUpdated> projectUpdated

The details for events with this type.

Optional<String> id

The project ID.

Optional<ChangesRequested> changesRequested

The payload used to update the project.

Optional<String> title

The title of the project as seen on the dashboard.

Optional<RateLimitDeleted> rateLimitDeleted

The details for events with this type.

Optional<String> id

The rate limit ID

Optional<RateLimitUpdated> rateLimitUpdated

The details for events with this type.

Optional<String> id

The rate limit ID

Optional<ChangesRequested> changesRequested

The payload used to update the rate limits.

Optional<Long> batch1DayMaxInputTokens

The maximum batch input tokens per day. Only relevant for certain models.

Optional<Long> maxAudioMegabytesPer1Minute

The maximum audio megabytes per minute. Only relevant for certain models.

Optional<Long> maxImagesPer1Minute

The maximum images per minute. Only relevant for certain models.

Optional<Long> maxRequestsPer1Day

The maximum requests per day. Only relevant for certain models.

Optional<Long> maxRequestsPer1Minute

The maximum requests per minute.

Optional<Long> maxTokensPer1Minute

The maximum tokens per minute.

Optional<RoleAssignmentCreated> roleAssignmentCreated

The details for events with this type.

Optional<String> id

The identifier of the role assignment.

Optional<String> principalId

The principal (user or group) that received the role.

Optional<String> principalType

The type of principal (user or group) that received the role.

Optional<String> resourceId

The resource the role assignment is scoped to.

Optional<String> resourceType

The type of resource the role assignment is scoped to.

Optional<RoleAssignmentDeleted> roleAssignmentDeleted

The details for events with this type.

Optional<String> id

The identifier of the role assignment.

Optional<String> principalId

The principal (user or group) that had the role removed.

Optional<String> principalType

The type of principal (user or group) that had the role removed.

Optional<String> resourceId

The resource the role assignment was scoped to.

Optional<String> resourceType

The type of resource the role assignment was scoped to.

Optional<RoleCreated> roleCreated

The details for events with this type.

Optional<String> id

The role ID.

Optional<List<String>> permissions

The permissions granted by the role.

Optional<String> resourceId

The resource the role is scoped to.

Optional<String> resourceType

The type of resource the role belongs to.

Optional<String> roleName

The name of the role.

Optional<RoleDeleted> roleDeleted

The details for events with this type.

Optional<String> id

The role ID.

Optional<RoleUpdated> roleUpdated

The details for events with this type.

Optional<String> id

The role ID.

Optional<ChangesRequested> changesRequested

The payload used to update the role.

Optional<String> description

The updated role description, when provided.

Optional<JsonValue> metadata

Additional metadata stored on the role.

Optional<List<String>> permissionsAdded

The permissions added to the role.

Optional<List<String>> permissionsRemoved

The permissions removed from the role.

Optional<String> resourceId

The resource the role is scoped to.

Optional<String> resourceType

The type of resource the role belongs to.

Optional<String> roleName

The updated role name, when provided.

Optional<ScimDisabled> scimDisabled

The details for events with this type.

Optional<String> id

The ID of the SCIM was disabled for.

Optional<ScimEnabled> scimEnabled

The details for events with this type.

Optional<String> id

The ID of the SCIM was enabled for.

Optional<ServiceAccountCreated> serviceAccountCreated

The details for events with this type.

Optional<String> id

The service account ID.

Optional<Data> data

The payload used to create the service account.

Optional<String> role

The role of the service account. Is either owner or member.

Optional<ServiceAccountDeleted> serviceAccountDeleted

The details for events with this type.

Optional<String> id

The service account ID.

Optional<ServiceAccountUpdated> serviceAccountUpdated

The details for events with this type.

Optional<String> id

The service account ID.

Optional<ChangesRequested> changesRequested

The payload used to updated the service account.

Optional<String> role

The role of the service account. Is either owner or member.

Optional<UserAdded> userAdded

The details for events with this type.

Optional<String> id

The user ID.

Optional<Data> data

The payload used to add the user to the project.

Optional<String> role

The role of the user. Is either owner or member.

Optional<UserDeleted> userDeleted

The details for events with this type.

Optional<String> id

The user ID.

Optional<UserUpdated> userUpdated

The details for events with this type.

Optional<String> id

The project ID.

Optional<ChangesRequested> changesRequested

The payload used to update the user.

Optional<String> role

The role of the user. Is either owner or member.

List audit logs

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.auditlogs.AuditLogListPage;
import com.openai.models.admin.organization.auditlogs.AuditLogListParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        AuditLogListPage page = client.admin().organization().auditLogs().list();
    }
}
{
    "object": "list",
    "data": [
        {
            "id": "audit_log-xxx_yyyymmdd",
            "type": "project.archived",
            "effective_at": 1722461446,
            "actor": {
                "type": "api_key",
                "api_key": {
                    "type": "user",
                    "user": {
                        "id": "user-xxx",
                        "email": "user@example.com"
                    }
                }
            },
            "project.archived": {
                "id": "proj_abc"
            },
        },
        {
            "id": "audit_log-yyy__20240101",
            "type": "api_key.updated",
            "effective_at": 1720804190,
            "actor": {
                "type": "session",
                "session": {
                    "user": {
                        "id": "user-xxx",
                        "email": "user@example.com"
                    },
                    "ip_address": "127.0.0.1",
                    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
                    "ja3": "a497151ce4338a12c4418c44d375173e",
                    "ja4": "q13d0313h3_55b375c5d22e_c7319ce65786",
                    "ip_address_details": {
                      "country": "US",
                      "city": "San Francisco",
                      "region": "California",
                      "region_code": "CA",
                      "asn": "1234",
                      "latitude": "37.77490",
                      "longitude": "-122.41940"
                    }
                }
            },
            "api_key.updated": {
                "id": "key_xxxx",
                "data": {
                    "scopes": ["resource_2.operation_2"]
                }
            },
        }
    ],
    "first_id": "audit_log-xxx__20240101",
    "last_id": "audit_log_yyy__20240101",
    "has_more": true
}
Returns Examples
{
    "object": "list",
    "data": [
        {
            "id": "audit_log-xxx_yyyymmdd",
            "type": "project.archived",
            "effective_at": 1722461446,
            "actor": {
                "type": "api_key",
                "api_key": {
                    "type": "user",
                    "user": {
                        "id": "user-xxx",
                        "email": "user@example.com"
                    }
                }
            },
            "project.archived": {
                "id": "proj_abc"
            },
        },
        {
            "id": "audit_log-yyy__20240101",
            "type": "api_key.updated",
            "effective_at": 1720804190,
            "actor": {
                "type": "session",
                "session": {
                    "user": {
                        "id": "user-xxx",
                        "email": "user@example.com"
                    },
                    "ip_address": "127.0.0.1",
                    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
                    "ja3": "a497151ce4338a12c4418c44d375173e",
                    "ja4": "q13d0313h3_55b375c5d22e_c7319ce65786",
                    "ip_address_details": {
                      "country": "US",
                      "city": "San Francisco",
                      "region": "California",
                      "region_code": "CA",
                      "asn": "1234",
                      "latitude": "37.77490",
                      "longitude": "-122.41940"
                    }
                }
            },
            "api_key.updated": {
                "id": "key_xxxx",
                "data": {
                    "scopes": ["resource_2.operation_2"]
                }
            },
        }
    ],
    "first_id": "audit_log-xxx__20240101",
    "last_id": "audit_log_yyy__20240101",
    "has_more": true
}