Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
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<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.

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. For ChatGPT connector role events, use the workspace connector resource ID shown in details.id, such as <workspace_id>__<connector_id>.

Optional<Boolean> tenantOnly

Return only tenant-scoped events associated with this organization. Required for tenant-scoped events such as role.bound_to_resource and role.unbound_from_resource. When true, all supplied event types must be tenant-scoped.

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.

Optional<Actor> actor

The actor who performed the audit logged action.

Optional<ApiKeyCreated> apiKeyCreated

The details for events with this type.

Optional<ApiKeyDeleted> apiKeyDeleted

The details for events with this type.

Optional<ApiKeyUpdated> apiKeyUpdated

The details for events with this type.

Optional<CertificateCreated> certificateCreated

The details for events with this type.

Optional<CertificateDeleted> certificateDeleted

The details for events with this type.

Optional<CertificateUpdated> certificateUpdated

The details for events with this type.

Optional<CertificatesActivated> certificatesActivated

The details for events with this type.

Optional<CertificatesDeactivated> certificatesDeactivated

The details for events with this type.

Optional<CheckpointPermissionCreated> checkpointPermissionCreated

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

Optional<CheckpointPermissionDeleted> checkpointPermissionDeleted

The details for events with this type.

Optional<ExternalKeyRegistered> externalKeyRegistered

The details for events with this type.

Optional<ExternalKeyRemoved> externalKeyRemoved

The details for events with this type.

Optional<ExternalStorageRegistered> externalStorageRegistered

The details for events with this type.

Optional<ExternalStorageRemoved> externalStorageRemoved

The details for events with this type.

Optional<GroupCreated> groupCreated

The details for events with this type.

Optional<GroupDeleted> groupDeleted

The details for events with this type.

Optional<GroupUpdated> groupUpdated

The details for events with this type.

Optional<InviteAccepted> inviteAccepted

The details for events with this type.

Optional<InviteDeleted> inviteDeleted

The details for events with this type.

Optional<InviteSent> inviteSent

The details for events with this type.

Optional<IpAllowlistConfigActivated> ipAllowlistConfigActivated

The details for events with this type.

Optional<IpAllowlistConfigDeactivated> ipAllowlistConfigDeactivated

The details for events with this type.

Optional<IpAllowlistCreated> ipAllowlistCreated

The details for events with this type.

Optional<IpAllowlistDeleted> ipAllowlistDeleted

The details for events with this type.

Optional<IpAllowlistUpdated> ipAllowlistUpdated

The details for events with this type.

Optional<LoginFailed> loginFailed

The details for events with this type.

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<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<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<ProjectArchived> projectArchived

The details for events with this type.

Optional<ProjectCreated> projectCreated

The details for events with this type.

Optional<ProjectDeleted> projectDeleted

The details for events with this type.

Optional<ProjectUpdated> projectUpdated

The details for events with this type.

Optional<RateLimitDeleted> rateLimitDeleted

The details for events with this type.

Optional<RateLimitUpdated> rateLimitUpdated

The details for events with this type.

Optional<RoleAssignmentCreated> roleAssignmentCreated

The details for events with this type.

Optional<RoleAssignmentDeleted> roleAssignmentDeleted

The details for events with this type.

Optional<RoleBoundToResource> roleBoundToResource

The details for events with this type.

Optional<RoleCreated> roleCreated

The details for events with this type.

Optional<RoleDeleted> roleDeleted

The details for events with this type.

Optional<RoleUnboundFromResource> roleUnboundFromResource

The details for events with this type.

Optional<RoleUpdated> roleUpdated

The details for events with this type.

Optional<ScimDisabled> scimDisabled

The details for events with this type.

Optional<ScimEnabled> scimEnabled

The details for events with this type.

Optional<ServiceAccountCreated> serviceAccountCreated

The details for events with this type.

Optional<ServiceAccountDeleted> serviceAccountDeleted

The details for events with this type.

Optional<ServiceAccountUpdated> serviceAccountUpdated

The details for events with this type.

Optional<UserAdded> userAdded

The details for events with this type.

Optional<UserDeleted> userDeleted

The details for events with this type.

Optional<UserUpdated> userUpdated

The details for events with this type.

Optional<WorkloadIdentityProviderMappingCreated> workloadIdentityProviderMappingCreated

The details for events with this type.

Optional<WorkloadIdentityProviderMappingDeleted> workloadIdentityProviderMappingDeleted

The details for events with this type.

Optional<WorkloadIdentityProviderMappingUpdated> workloadIdentityProviderMappingUpdated

The details for events with this type.

Optional<WorkloadIdentityProviderCreated> workloadIdentityProviderCreated

The details for events with this type.

Optional<WorkloadIdentityProviderDeleted> workloadIdentityProviderDeleted

The details for events with this type.

Optional<WorkloadIdentityProviderUpdated> workloadIdentityProviderUpdated

The details for events with this type.

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
}