---
title: "List user actions and configuration changes within this organization."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/list-audit-logs"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

# List user actions and configuration changes within this organization.

`GET` `/organization/audit_logs`

Operation ID: `list-audit-logs`

## Query parameters

- `effective_at` (object, optional) - Return only events whose `effective_at` (Unix seconds) is in this range.
- `project_ids[]` (array, optional) - Return only events for these projects.
- `event_types[]` (array, optional) - 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](/docs/api-reference/audit-logs/object).
- `actor_ids[]` (array, optional) - 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, optional) - Return only events performed by users with these emails.
- `resource_ids[]` (array, optional) - Return only events performed on these targets. For example, a project ID updated.
- `limit` (integer, optional) - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
- `after` (string, optional) - 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, optional) - 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.

## Responses

- `200` - Audit logs listed successfully.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /organization/audit_logs:
    get:
      summary: List user actions and configuration changes within this organization.
      operationId: list-audit-logs
      tags:
        - Audit Logs
      parameters:
        - name: effective_at
          in: query
          description: Return only events whose `effective_at` (Unix seconds) is in this
            range.
          required: false
          schema:
            type: object
            properties:
              gt:
                type: integer
                description: Return only events whose `effective_at` (Unix seconds) is greater
                  than this value.
              gte:
                type: integer
                description: Return only events whose `effective_at` (Unix seconds) is greater
                  than or equal to this value.
              lt:
                type: integer
                description: Return only events whose `effective_at` (Unix seconds) is less than
                  this value.
              lte:
                type: integer
                description: Return only events whose `effective_at` (Unix seconds) is less than
                  or equal to this value.
        - name: project_ids[]
          in: query
          description: Return only events for these projects.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: event_types[]
          in: query
          description: 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](/docs/api-reference/audit-logs/object).
          required: false
          schema:
            type: array
            items:
              $ref: "#/components/schemas/AuditLogEventType"
        - name: actor_ids[]
          in: query
          description: Return only events performed by these actors. Can be a user ID, a
            service account ID, or an api key tracking ID.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: actor_emails[]
          in: query
          description: Return only events performed by users with these emails.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: resource_ids[]
          in: query
          description: Return only events performed on these targets. For example, a
            project ID updated.
          required: false
          schema:
            type: array
            items:
              type: string
        - name: limit
          in: query
          description: >
            A limit on the number of objects to be returned. Limit can range
            between 1 and 100, and the default is 20.
          required: false
          schema:
            type: integer
            default: 20
        - name: after
          in: query
          description: >
            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.
          schema:
            type: string
        - name: before
          in: query
          description: >
            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.
          schema:
            type: string
      responses:
        "200":
          description: Audit logs listed successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAuditLogsResponse"
      x-oaiMeta:
        name: List audit logs
        group: audit-logs
        returns: A list of paginated [Audit Log](/docs/api-reference/audit-logs/object)
          objects.
        examples:
          request:
            curl: |
              curl https://api.openai.com/v1/organization/audit_logs \
              -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
              -H "Content-Type: application/json"
          response: >
            {
                "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
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    AuditLogEventType:
      type: string
      description: The event type.
      x-oaiExpandable: true
      enum:
        - api_key.created
        - api_key.updated
        - api_key.deleted
        - invite.sent
        - invite.accepted
        - invite.deleted
        - login.succeeded
        - login.failed
        - logout.succeeded
        - logout.failed
        - organization.updated
        - project.created
        - project.updated
        - project.archived
        - service_account.created
        - service_account.updated
        - service_account.deleted
        - rate_limit.updated
        - rate_limit.deleted
        - user.added
        - user.updated
        - user.deleted
    ListAuditLogsResponse:
      type: object
      properties:
        object:
          type: string
          enum:
            - list
          x-stainless-const: true
        data:
          type: array
          items:
            $ref: "#/components/schemas/AuditLog"
        first_id:
          type: string
          example: audit_log-defb456h8dks
        last_id:
          type: string
          example: audit_log-hnbkd8s93s
        has_more:
          type: boolean
      required:
        - object
        - data
        - first_id
        - last_id
        - has_more
    AuditLog:
      type: object
      description: A log of a user action or configuration change within this organization.
      properties:
        id:
          type: string
          description: The ID of this log.
        type:
          $ref: "#/components/schemas/AuditLogEventType"
        effective_at:
          type: integer
          description: The Unix timestamp (in seconds) of the event.
        project:
          type: object
          description: The project that the action was scoped to. Absent for actions not
            scoped to projects.
          properties:
            id:
              type: string
              description: The project ID.
            name:
              type: string
              description: The project title.
        actor:
          $ref: "#/components/schemas/AuditLogActor"
        api_key.created:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The tracking ID of the API key.
            data:
              type: object
              description: The payload used to create the API key.
              properties:
                scopes:
                  type: array
                  items:
                    type: string
                  description: A list of scopes allowed for the API key, e.g.
                    `["api.model.request"]`
        api_key.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The tracking ID of the API key.
            changes_requested:
              type: object
              description: The payload used to update the API key.
              properties:
                scopes:
                  type: array
                  items:
                    type: string
                  description: A list of scopes allowed for the API key, e.g.
                    `["api.model.request"]`
        api_key.deleted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The tracking ID of the API key.
        invite.sent:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The ID of the invite.
            data:
              type: object
              description: The payload used to create the invite.
              properties:
                email:
                  type: string
                  description: The email invited to the organization.
                role:
                  type: string
                  description: The role the email was invited to be. Is either `owner` or
                    `member`.
        invite.accepted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The ID of the invite.
        invite.deleted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The ID of the invite.
        login.failed:
          type: object
          description: The details for events with this `type`.
          properties:
            error_code:
              type: string
              description: The error code of the failure.
            error_message:
              type: string
              description: The error message of the failure.
        logout.failed:
          type: object
          description: The details for events with this `type`.
          properties:
            error_code:
              type: string
              description: The error code of the failure.
            error_message:
              type: string
              description: The error message of the failure.
        organization.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The organization ID.
            changes_requested:
              type: object
              description: The payload used to update the organization settings.
              properties:
                title:
                  type: string
                  description: The organization title.
                description:
                  type: string
                  description: The organization description.
                name:
                  type: string
                  description: The organization name.
                settings:
                  type: object
                  properties:
                    threads_ui_visibility:
                      type: string
                      description: Visibility of the threads page which shows messages created with
                        the Assistants API and Playground. One of `ANY_ROLE`,
                        `OWNERS`, or `NONE`.
                    usage_dashboard_visibility:
                      type: string
                      description: Visibility of the usage dashboard which shows activity and costs
                        for your organization. One of `ANY_ROLE` or `OWNERS`.
        project.created:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The project ID.
            data:
              type: object
              description: The payload used to create the project.
              properties:
                name:
                  type: string
                  description: The project name.
                title:
                  type: string
                  description: The title of the project as seen on the dashboard.
        project.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The project ID.
            changes_requested:
              type: object
              description: The payload used to update the project.
              properties:
                title:
                  type: string
                  description: The title of the project as seen on the dashboard.
        project.archived:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The project ID.
        rate_limit.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The rate limit ID
            changes_requested:
              type: object
              description: The payload used to update the rate limits.
              properties:
                max_requests_per_1_minute:
                  type: integer
                  description: The maximum requests per minute.
                max_tokens_per_1_minute:
                  type: integer
                  description: The maximum tokens per minute.
                max_images_per_1_minute:
                  type: integer
                  description: The maximum images per minute. Only relevant for certain models.
                max_audio_megabytes_per_1_minute:
                  type: integer
                  description: The maximum audio megabytes per minute. Only relevant for certain
                    models.
                max_requests_per_1_day:
                  type: integer
                  description: The maximum requests per day. Only relevant for certain models.
                batch_1_day_max_input_tokens:
                  type: integer
                  description: The maximum batch input tokens per day. Only relevant for certain
                    models.
        rate_limit.deleted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The rate limit ID
        service_account.created:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The service account ID.
            data:
              type: object
              description: The payload used to create the service account.
              properties:
                role:
                  type: string
                  description: The role of the service account. Is either `owner` or `member`.
        service_account.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The service account ID.
            changes_requested:
              type: object
              description: The payload used to updated the service account.
              properties:
                role:
                  type: string
                  description: The role of the service account. Is either `owner` or `member`.
        service_account.deleted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The service account ID.
        user.added:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The user ID.
            data:
              type: object
              description: The payload used to add the user to the project.
              properties:
                role:
                  type: string
                  description: The role of the user. Is either `owner` or `member`.
        user.updated:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The project ID.
            changes_requested:
              type: object
              description: The payload used to update the user.
              properties:
                role:
                  type: string
                  description: The role of the user. Is either `owner` or `member`.
        user.deleted:
          type: object
          description: The details for events with this `type`.
          properties:
            id:
              type: string
              description: The user ID.
      required:
        - id
        - type
        - effective_at
        - actor
      x-oaiMeta:
        name: The audit log object
        example: >
          {
              "id": "req_xxx_20240101",
              "type": "api_key.created",
              "effective_at": 1720804090,
              "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"
                  }
              },
              "api_key.created": {
                  "id": "key_xxxx",
                  "data": {
                      "scopes": ["resource.operation"]
                  }
              }
          }
    AuditLogActor:
      type: object
      description: The actor who performed the audit logged action.
      properties:
        type:
          type: string
          description: The type of actor. Is either `session` or `api_key`.
          enum:
            - session
            - api_key
        session:
          $ref: "#/components/schemas/AuditLogActorSession"
        api_key:
          $ref: "#/components/schemas/AuditLogActorApiKey"
    AuditLogActorSession:
      type: object
      description: The session in which the audit logged action was performed.
      properties:
        user:
          $ref: "#/components/schemas/AuditLogActorUser"
        ip_address:
          type: string
          description: The IP address from which the action was performed.
    AuditLogActorApiKey:
      type: object
      description: The API Key used to perform the audit logged action.
      properties:
        id:
          type: string
          description: The tracking id of the API key.
        type:
          type: string
          description: The type of API key. Can be either `user` or `service_account`.
          enum:
            - user
            - service_account
        user:
          $ref: "#/components/schemas/AuditLogActorUser"
        service_account:
          $ref: "#/components/schemas/AuditLogActorServiceAccount"
    AuditLogActorUser:
      type: object
      description: The user who performed the audit logged action.
      properties:
        id:
          type: string
          description: The user id.
        email:
          type: string
          description: The user email.
    AuditLogActorServiceAccount:
      type: object
      description: The service account that performed the audit logged action.
      properties:
        id:
          type: string
          description: The service account id.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
