List audit logs
List user actions and configuration changes within this organization.
ParametersExpand Collapse
query AdminOrganizationAuditLogListParams
Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
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.
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.
Return only events whose effective_at (Unix seconds) is in this range.
Return only events whose effective_at (Unix seconds) is in this range.
EventTypes param.Field[[]string]OptionalReturn 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.
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.
ReturnsExpand Collapse
type AdminOrganizationAuditLogListResponse struct{…}A log of a user action or configuration change within this organization.
A log of a user action or configuration change within this organization.
Type AdminOrganizationAuditLogListResponseTypeThe event type.
The event type.
Actor AdminOrganizationAuditLogListResponseActorOptionalThe actor who performed the audit logged action.
The actor who performed the audit logged action.
APIKey AdminOrganizationAuditLogListResponseActorAPIKeyOptionalThe API Key used to perform the audit logged action.
The API Key used to perform the audit logged action.
Session AdminOrganizationAuditLogListResponseActorSessionOptionalThe session in which the audit logged action was performed.
The session in which the audit logged action was performed.
APIKeyCreated AdminOrganizationAuditLogListResponseAPIKeyCreatedOptionalThe details for events with this type.
The details for events with this type.
APIKeyDeleted AdminOrganizationAuditLogListResponseAPIKeyDeletedOptionalThe details for events with this type.
The details for events with this type.
APIKeyUpdated AdminOrganizationAuditLogListResponseAPIKeyUpdatedOptionalThe details for events with this type.
The details for events with this type.
CertificateCreated AdminOrganizationAuditLogListResponseCertificateCreatedOptionalThe details for events with this type.
The details for events with this type.
CertificateDeleted AdminOrganizationAuditLogListResponseCertificateDeletedOptionalThe details for events with this type.
The details for events with this type.
CertificateUpdated AdminOrganizationAuditLogListResponseCertificateUpdatedOptionalThe details for events with this type.
The details for events with this type.
CertificatesActivated AdminOrganizationAuditLogListResponseCertificatesActivatedOptionalThe details for events with this type.
The details for events with this type.
CertificatesDeactivated AdminOrganizationAuditLogListResponseCertificatesDeactivatedOptionalThe details for events with this type.
The details for events with this type.
CheckpointPermissionCreated AdminOrganizationAuditLogListResponseCheckpointPermissionCreatedOptionalThe project and fine-tuned model checkpoint that the checkpoint permission was created for.
The project and fine-tuned model checkpoint that the checkpoint permission was created for.
CheckpointPermissionDeleted AdminOrganizationAuditLogListResponseCheckpointPermissionDeletedOptionalThe details for events with this type.
The details for events with this type.
ExternalKeyRegistered AdminOrganizationAuditLogListResponseExternalKeyRegisteredOptionalThe details for events with this type.
The details for events with this type.
ExternalKeyRemoved AdminOrganizationAuditLogListResponseExternalKeyRemovedOptionalThe details for events with this type.
The details for events with this type.
GroupCreated AdminOrganizationAuditLogListResponseGroupCreatedOptionalThe details for events with this type.
The details for events with this type.
GroupDeleted AdminOrganizationAuditLogListResponseGroupDeletedOptionalThe details for events with this type.
The details for events with this type.
GroupUpdated AdminOrganizationAuditLogListResponseGroupUpdatedOptionalThe details for events with this type.
The details for events with this type.
InviteAccepted AdminOrganizationAuditLogListResponseInviteAcceptedOptionalThe details for events with this type.
The details for events with this type.
InviteDeleted AdminOrganizationAuditLogListResponseInviteDeletedOptionalThe details for events with this type.
The details for events with this type.
InviteSent AdminOrganizationAuditLogListResponseInviteSentOptionalThe details for events with this type.
The details for events with this type.
IPAllowlistConfigActivated AdminOrganizationAuditLogListResponseIPAllowlistConfigActivatedOptionalThe details for events with this type.
The details for events with this type.
IPAllowlistConfigDeactivated AdminOrganizationAuditLogListResponseIPAllowlistConfigDeactivatedOptionalThe details for events with this type.
The details for events with this type.
IPAllowlistCreated AdminOrganizationAuditLogListResponseIPAllowlistCreatedOptionalThe details for events with this type.
The details for events with this type.
IPAllowlistDeleted AdminOrganizationAuditLogListResponseIPAllowlistDeletedOptionalThe details for events with this type.
The details for events with this type.
IPAllowlistUpdated AdminOrganizationAuditLogListResponseIPAllowlistUpdatedOptionalThe details for events with this type.
The details for events with this type.
LoginFailed AdminOrganizationAuditLogListResponseLoginFailedOptionalThe details for events with this type.
The details for events with this type.
This event has no additional fields beyond the standard audit log attributes.
LogoutFailed AdminOrganizationAuditLogListResponseLogoutFailedOptionalThe details for events with this type.
The details for events with this type.
This event has no additional fields beyond the standard audit log attributes.
OrganizationUpdated AdminOrganizationAuditLogListResponseOrganizationUpdatedOptionalThe details for events with this type.
The details for events with this type.
ChangesRequested AdminOrganizationAuditLogListResponseOrganizationUpdatedChangesRequestedOptionalThe payload used to update the organization settings.
The payload used to update the organization settings.
How your organization logs data from supported API calls. One of disabled, enabled_per_call, enabled_for_all_projects, or enabled_for_selected_projects
The list of project ids if api_call_logging is set to enabled_for_selected_projects
Project AdminOrganizationAuditLogListResponseProjectOptionalThe 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.
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.
ProjectArchived AdminOrganizationAuditLogListResponseProjectArchivedOptionalThe details for events with this type.
The details for events with this type.
ProjectCreated AdminOrganizationAuditLogListResponseProjectCreatedOptionalThe details for events with this type.
The details for events with this type.
ProjectDeleted AdminOrganizationAuditLogListResponseProjectDeletedOptionalThe details for events with this type.
The details for events with this type.
ProjectUpdated AdminOrganizationAuditLogListResponseProjectUpdatedOptionalThe details for events with this type.
The details for events with this type.
RateLimitDeleted AdminOrganizationAuditLogListResponseRateLimitDeletedOptionalThe details for events with this type.
The details for events with this type.
RateLimitUpdated AdminOrganizationAuditLogListResponseRateLimitUpdatedOptionalThe details for events with this type.
The details for events with this type.
ChangesRequested AdminOrganizationAuditLogListResponseRateLimitUpdatedChangesRequestedOptionalThe payload used to update the rate limits.
The payload used to update the rate limits.
RoleAssignmentCreated AdminOrganizationAuditLogListResponseRoleAssignmentCreatedOptionalThe details for events with this type.
The details for events with this type.
RoleAssignmentDeleted AdminOrganizationAuditLogListResponseRoleAssignmentDeletedOptionalThe details for events with this type.
The details for events with this type.
RoleCreated AdminOrganizationAuditLogListResponseRoleCreatedOptionalThe details for events with this type.
The details for events with this type.
RoleDeleted AdminOrganizationAuditLogListResponseRoleDeletedOptionalThe details for events with this type.
The details for events with this type.
RoleUpdated AdminOrganizationAuditLogListResponseRoleUpdatedOptionalThe details for events with this type.
The details for events with this type.
ScimDisabled AdminOrganizationAuditLogListResponseScimDisabledOptionalThe details for events with this type.
The details for events with this type.
ScimEnabled AdminOrganizationAuditLogListResponseScimEnabledOptionalThe details for events with this type.
The details for events with this type.
ServiceAccountCreated AdminOrganizationAuditLogListResponseServiceAccountCreatedOptionalThe details for events with this type.
The details for events with this type.
ServiceAccountDeleted AdminOrganizationAuditLogListResponseServiceAccountDeletedOptionalThe details for events with this type.
The details for events with this type.
ServiceAccountUpdated AdminOrganizationAuditLogListResponseServiceAccountUpdatedOptionalThe details for events with this type.
The details for events with this type.
UserAdded AdminOrganizationAuditLogListResponseUserAddedOptionalThe details for events with this type.
The details for events with this type.
UserDeleted AdminOrganizationAuditLogListResponseUserDeletedOptionalThe details for events with this type.
The details for events with this type.
List audit logs
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAdminAPIKey("My Admin API Key"),
)
page, err := client.Admin.Organization.AuditLogs.List(context.TODO(), openai.AdminOrganizationAuditLogListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"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
}