Class: OpenAI::Resources::Admin::Organization::AuditLogs

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/resources/admin/organization/audit_logs.rb,
sig/openai/resources/admin/organization/audit_logs.rbs

Overview

List user actions and configuration changes within this organization.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AuditLogs

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AuditLogs.

Parameters:



80
81
82
# File 'lib/openai/resources/admin/organization/audit_logs.rb', line 80

def initialize(client:)
  @client = client
end

Instance Method Details

#list(actor_emails: nil, actor_ids: nil, after: nil, before: nil, effective_at: nil, event_types: nil, limit: nil, project_ids: nil, resource_ids: nil, tenant_only: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Admin::Organization::AuditLogListResponse>

List user actions and configuration changes within this organization.

Parameters:

  • actor_emails (Array<String>)

    Return only events performed by users with these emails.

  • actor_ids (Array<String>)

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

  • after (String)

    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.

  • before (String)

    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.

  • effective_at (OpenAI::Models::Admin::Organization::AuditLogListParams::EffectiveAt)

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

  • event_types (Array<Symbol, OpenAI::Models::Admin::Organization::AuditLogListParams::EventType>)

    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.

  • limit (Integer)

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

  • project_ids (Array<String>)

    Return only events for these projects.

  • resource_ids (Array<String>)

    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>.

  • tenant_only (Boolean)

    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.

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/openai/resources/admin/organization/audit_logs.rb', line 63

def list(params = {})
  parsed, options = OpenAI::Admin::Organization::AuditLogListParams.dump_request(params)
  query = OpenAI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "organization/audit_logs",
    query: query,
    page: OpenAI::Internal::ConversationCursorPage,
    model: OpenAI::Models::Admin::Organization::AuditLogListResponse,
    security: {admin_api_key_auth: true},
    options: options
  )
end