List audit logs

GEThttps:/api.openai.com/v1/organization/audit_logs

List user actions and configuration changes within this organization.

Query parameters

  • effective_at
    object

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

  • project_ids[]
    array
    Return only events for these projects.
  • event_types[]
    array

    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.

  • actor_ids[]
    array
    Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID.
  • actor_emails[]
    array
    Return only events performed by users with these emails.
  • resource_ids[]
    array
    Return only events performed on these targets. For example, a project ID updated.
  • limit
    integer
    Defaults: 20
    A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
  • 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.

Response

A list of paginated Audit Log objects.

Example request
1
curl https://api.openai.com/v1/organization/audit_logs \
2
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
3
-H "Content-Type: application/json"
Example response
1
{
2
"object": "list",
3
"data": [
4
{
5
"id": "audit_log-xxx_yyyymmdd",
6
"type": "project.archived",
7
"effective_at": 1722461446,
8
"actor": {
9
"type": "api_key",
10
"api_key": {
11
"type": "user",
12
"user": {
13
"id": "user-xxx",
14
"email": "user@example.com"
15
}
16
}
17
},
18
"project.archived": {
19
"id": "proj_abc"
20
},
21
},
22
{
23
"id": "audit_log-yyy__20240101",
24
"type": "api_key.updated",
25
"effective_at": 1720804190,
26
"actor": {
27
"type": "session",
28
"session": {
29
"user": {
30
"id": "user-xxx",
31
"email": "user@example.com"
32
},
33
"ip_address": "127.0.0.1",
34
"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",
35
"ja3": "a497151ce4338a12c4418c44d375173e",
36
"ja4": "q13d0313h3_55b375c5d22e_c7319ce65786",
37
"ip_address_details": {
38
"country": "US",
39
"city": "San Francisco",
40
"region": "California",
41
"region_code": "CA",
42
"asn": "1234",
43
"latitude": "37.77490",
44
"longitude": "-122.41940"
45
}
46
}
47
},
48
"api_key.updated": {
49
"id": "key_xxxx",
50
"data": {
51
"scopes": ["resource_2.operation_2"]
52
}
53
},
54
}
55
],
56
"first_id": "audit_log-xxx__20240101",
57
"last_id": "audit_log_yyy__20240101",
58
"has_more": true
59
}
Built with