List user actions and configuration changes within this organization.

GET /organization/audit_logs

Query parameters

  • effective_at object

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

    Hide effective_at attributes Show effective_at attributes object
    • gt integer

      Return only events whose effective_at (Unix seconds) is greater than this value.

    • gte integer

      Return only events whose effective_at (Unix seconds) is greater than or equal to this value.

    • lt integer

      Return only events whose effective_at (Unix seconds) is less than this value.

    • lte integer

      Return only events whose effective_at (Unix seconds) is less than or equal to this value.

  • project_ids[] array[string]

    Return only events for these projects.

  • event_types[] array[string]

    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.

    Values are 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, or user.deleted.

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

  • actor_emails[] array[string]

    Return only events performed by users with these emails.

  • resource_ids[] array[string]

    Return only events performed on these targets. For example, a project ID updated.

  • limit integer

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

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

Responses

  • 200 application/json

    Audit logs listed successfully.

    Hide response attributes Show response attributes object
    • object string Required

      Value is list.

    • data array[object] Required

      A log of a user action or configuration change within this organization.

      Hide data attributes Show data attributes object
      • id string Required

        The ID of this log.

      • type string Required

        The event type.

        Values are 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, or user.deleted.

      • effective_at integer Required

        The Unix timestamp (in seconds) of the event.

      • project object

        The project that the action was scoped to. Absent for actions not scoped to projects.

        Hide project attributes Show project attributes object
        • id string

          The project ID.

        • name string

          The project title.

      • actor object Required

        The actor who performed the audit logged action.

        Hide actor attributes Show actor attributes object
        • type string

          The type of actor. Is either session or api_key.

          Values are session or api_key.

        • session object

          The session in which the audit logged action was performed.

          Hide session attributes Show session attributes object
          • user object

            The user who performed the audit logged action.

            Hide user attributes Show user attributes object
            • id string

              The user id.

            • email string

              The user email.

          • ip_address string

            The IP address from which the action was performed.

        • api_key object

          The API Key used to perform the audit logged action.

          Hide api_key attributes Show api_key attributes object
          • id string

            The tracking id of the API key.

          • type string

            The type of API key. Can be either user or service_account.

            Values are user or service_account.

          • user object

            The user who performed the audit logged action.

            Hide user attributes Show user attributes object
            • id string

              The user id.

            • email string

              The user email.

          • service_account object

            The service account that performed the audit logged action.

            Hide service_account attribute Show service_account attribute object
            • id string

              The service account id.

      • api_key.created object

        The details for events with this type.

        Hide api_key.created attributes Show api_key.created attributes object
        • id string

          The tracking ID of the API key.

        • data object

          The payload used to create the API key.

          Hide data attribute Show data attribute object
          • scopes array[string]

            A list of scopes allowed for the API key, e.g. ["api.model.request"]

      • api_key.updated object

        The details for events with this type.

        Hide api_key.updated attributes Show api_key.updated attributes object
        • id string

          The tracking ID of the API key.

        • changes_requested object

          The payload used to update the API key.

          Hide changes_requested attribute Show changes_requested attribute object
          • scopes array[string]

            A list of scopes allowed for the API key, e.g. ["api.model.request"]

      • api_key.deleted object

        The details for events with this type.

        Hide api_key.deleted attribute Show api_key.deleted attribute object
        • id string

          The tracking ID of the API key.

      • invite.sent object

        The details for events with this type.

        Hide invite.sent attributes Show invite.sent attributes object
        • id string

          The ID of the invite.

        • data object

          The payload used to create the invite.

          Hide data attributes Show data attributes object
          • email string

            The email invited to the organization.

          • role string

            The role the email was invited to be. Is either owner or member.

      • invite.accepted object

        The details for events with this type.

        Hide invite.accepted attribute Show invite.accepted attribute object
        • id string

          The ID of the invite.

      • invite.deleted object

        The details for events with this type.

        Hide invite.deleted attribute Show invite.deleted attribute object
        • id string

          The ID of the invite.

      • login.failed object

        The details for events with this type.

        Hide login.failed attributes Show login.failed attributes object
        • error_code string

          The error code of the failure.

        • error_message string

          The error message of the failure.

      • logout.failed object

        The details for events with this type.

        Hide logout.failed attributes Show logout.failed attributes object
        • error_code string

          The error code of the failure.

        • error_message string

          The error message of the failure.

      • organization.updated object

        The details for events with this type.

        Hide organization.updated attributes Show organization.updated attributes object
        • id string

          The organization ID.

        • changes_requested object

          The payload used to update the organization settings.

          Hide changes_requested attributes Show changes_requested attributes object
          • title string

            The organization title.

          • description string

            The organization description.

          • name string

            The organization name.

          • settings object
            Hide settings attributes Show settings attributes object
            • threads_ui_visibility string

              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 string

              Visibility of the usage dashboard which shows activity and costs for your organization. One of ANY_ROLE or OWNERS.

      • project.created object

        The details for events with this type.

        Hide project.created attributes Show project.created attributes object
        • id string

          The project ID.

        • data object

          The payload used to create the project.

          Hide data attributes Show data attributes object
          • name string

            The project name.

          • title string

            The title of the project as seen on the dashboard.

      • project.updated object

        The details for events with this type.

        Hide project.updated attributes Show project.updated attributes object
        • id string

          The project ID.

        • changes_requested object

          The payload used to update the project.

          Hide changes_requested attribute Show changes_requested attribute object
          • title string

            The title of the project as seen on the dashboard.

      • project.archived object

        The details for events with this type.

        Hide project.archived attribute Show project.archived attribute object
        • id string

          The project ID.

      • rate_limit.updated object

        The details for events with this type.

        Hide rate_limit.updated attributes Show rate_limit.updated attributes object
        • id string

          The rate limit ID

        • changes_requested object

          The payload used to update the rate limits.

          Hide changes_requested attributes Show changes_requested attributes object
          • max_requests_per_1_minute integer

            The maximum requests per minute.

          • max_tokens_per_1_minute integer

            The maximum tokens per minute.

          • max_images_per_1_minute integer

            The maximum images per minute. Only relevant for certain models.

          • max_audio_megabytes_per_1_minute integer

            The maximum audio megabytes per minute. Only relevant for certain models.

          • max_requests_per_1_day integer

            The maximum requests per day. Only relevant for certain models.

          • batch_1_day_max_input_tokens integer

            The maximum batch input tokens per day. Only relevant for certain models.

      • rate_limit.deleted object

        The details for events with this type.

        Hide rate_limit.deleted attribute Show rate_limit.deleted attribute object
        • id string

          The rate limit ID

      • service_account.created object

        The details for events with this type.

        Hide service_account.created attributes Show service_account.created attributes object
        • id string

          The service account ID.

        • data object

          The payload used to create the service account.

          Hide data attribute Show data attribute object
          • role string

            The role of the service account. Is either owner or member.

      • service_account.updated object

        The details for events with this type.

        Hide service_account.updated attributes Show service_account.updated attributes object
        • id string

          The service account ID.

        • changes_requested object

          The payload used to updated the service account.

          Hide changes_requested attribute Show changes_requested attribute object
          • role string

            The role of the service account. Is either owner or member.

      • service_account.deleted object

        The details for events with this type.

        Hide service_account.deleted attribute Show service_account.deleted attribute object
        • id string

          The service account ID.

      • user.added object

        The details for events with this type.

        Hide user.added attributes Show user.added attributes object
        • id string

          The user ID.

        • data object

          The payload used to add the user to the project.

          Hide data attribute Show data attribute object
          • role string

            The role of the user. Is either owner or member.

      • user.updated object

        The details for events with this type.

        Hide user.updated attributes Show user.updated attributes object
        • id string

          The project ID.

        • changes_requested object

          The payload used to update the user.

          Hide changes_requested attribute Show changes_requested attribute object
          • role string

            The role of the user. Is either owner or member.

      • user.deleted object

        The details for events with this type.

        Hide user.deleted attribute Show user.deleted attribute object
        • id string

          The user ID.

    • first_id string Required
    • last_id string Required
    • has_more boolean Required
GET /organization/audit_logs
curl \
 --request GET 'https://api.openai.com/v1/organization/audit_logs' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "object": "list",
  "data": [
    {
      "id": "string",
      "type": "api_key.created",
      "effective_at": 42,
      "project": {
        "id": "string",
        "name": "string"
      },
      "actor": {
        "type": "session",
        "session": {
          "user": {
            "id": "string",
            "email": "string"
          },
          "ip_address": "string"
        },
        "api_key": {
          "id": "string",
          "type": "user",
          "user": {
            "id": "string",
            "email": "string"
          },
          "service_account": {
            "id": "string"
          }
        }
      },
      "api_key.created": {
        "id": "string",
        "data": {
          "scopes": [
            "string"
          ]
        }
      },
      "api_key.updated": {
        "id": "string",
        "changes_requested": {
          "scopes": [
            "string"
          ]
        }
      },
      "api_key.deleted": {
        "id": "string"
      },
      "invite.sent": {
        "id": "string",
        "data": {
          "email": "string",
          "role": "string"
        }
      },
      "invite.accepted": {
        "id": "string"
      },
      "invite.deleted": {
        "id": "string"
      },
      "login.failed": {
        "error_code": "string",
        "error_message": "string"
      },
      "logout.failed": {
        "error_code": "string",
        "error_message": "string"
      },
      "organization.updated": {
        "id": "string",
        "changes_requested": {
          "title": "string",
          "description": "string",
          "name": "string",
          "settings": {
            "threads_ui_visibility": "string",
            "usage_dashboard_visibility": "string"
          }
        }
      },
      "project.created": {
        "id": "string",
        "data": {
          "name": "string",
          "title": "string"
        }
      },
      "project.updated": {
        "id": "string",
        "changes_requested": {
          "title": "string"
        }
      },
      "project.archived": {
        "id": "string"
      },
      "rate_limit.updated": {
        "id": "string",
        "changes_requested": {
          "max_requests_per_1_minute": 42,
          "max_tokens_per_1_minute": 42,
          "max_images_per_1_minute": 42,
          "max_audio_megabytes_per_1_minute": 42,
          "max_requests_per_1_day": 42,
          "batch_1_day_max_input_tokens": 42
        }
      },
      "rate_limit.deleted": {
        "id": "string"
      },
      "service_account.created": {
        "id": "string",
        "data": {
          "role": "string"
        }
      },
      "service_account.updated": {
        "id": "string",
        "changes_requested": {
          "role": "string"
        }
      },
      "service_account.deleted": {
        "id": "string"
      },
      "user.added": {
        "id": "string",
        "data": {
          "role": "string"
        }
      },
      "user.updated": {
        "id": "string",
        "changes_requested": {
          "role": "string"
        }
      },
      "user.deleted": {
        "id": "string"
      }
    }
  ],
  "first_id": "audit_log-defb456h8dks",
  "last_id": "audit_log-hnbkd8s93s",
  "has_more": true
}