> ## Documentation Index
> Fetch the complete documentation index at: https://www.1password.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# API conventions

> Conventions used across the 1Password Events API, including authorization, endpoint paths, request headers, pagination, rate limits, and error handling.

The 1Password Events API is a REST-style API that supports standard HTTP methods and follows the [OpenAPI 3.1.0 specification.](https://spec.openapis.org/oas/v3.1.0.html) All communication between clients and servers is over HTTPS.

The following conventions cover how to authorize and structure requests and interpret responses and errors.

## Authorization

The Events API uses the OAuth 2.0 client credentials grant to issue access tokens to integrations.

1. [Create an OAuth application](https://www.1password.dev/events-api/v3/manage-integrations.md#create-an-oauth-application) in your 1Password account with the `audit-events.view` scope.

2. Send your client credentials in a POST request to the [OAuth token endpoint](https://www.1password.dev/users-api/request-access-token.md) to request an access token.

3. Send the access token in the `Authorization` header for each Events API request, prefixed with `Bearer`:

   ```
   Authorization: Bearer <YOUR_ACCESS_TOKEN>
   ```

4. Request a new token when the current one expires, or [revoke a token](https://www.1password.dev/events-api/v3/manage-integrations.md#revoke-an-access-token) when it's no longer needed.

Access tokens expire after 15 minutes (900 seconds).

Learn more about [how to authorize your integrations using OAuth 2.0](https://www.1password.dev/events-api/v3/manage-integrations.md).

## Endpoints

An Events API endpoint URL consists of a base URL and an endpoint path. The path identifies the API version, the account, and the resource.

### Base URLs

Choose the base URL that matches the [region of your 1Password account.](https://support.1password.com/regions/) Use the same base URL to request an access token and retrieve audit events.

| Base URL | Description |
| - | - |
| `https://api.1password.com` | Server for accounts hosted on 1password.com. |
| `https://api.1password.ca` | Server for accounts hosted on 1password.ca. |
| `https://api.1password.eu` | Server for accounts hosted on 1password.eu. |
| `https://api.ent.1password.com` | Server for accounts hosted on ent.1password.com. |

If your integration supports accounts in multiple regions, let users choose the base URL.

### Endpoint paths

Append the endpoint path to your base URL. For example:

```text theme={null}
GET https://api.1password.com/v3/accounts/{account}/audit-events
```

Replace `{account}` with the ID of the 1Password account that owns the OAuth application, or use `-` to select the account associated with your token.

Endpoint paths are matched exactly. Use the path without a trailing slash.

See the [Events API reference](https://www.1password.dev/events-api/v3/reference.md) for endpoint details.

## Requests

### Request methods

| Method | Usage |
| - | - |
| `GET` | [Retrieve audit events](https://www.1password.dev/events-api/v3/reference/retrieve-audit-events.md) for a 1Password account. |

### Request headers

* **`Authorization`**: Your OAuth access token, prefixed with `Bearer`. Required on every request. See [Authorization](#authorization).
* **`User-Agent`**: Recommended. Send an identifiable `User-Agent` header in the format `<CompanyOrProductName>/<version>` so requests can be attributed to a specific integration. This helps with support and troubleshooting, and with analytics on integration usage.

```http theme={null}
Authorization: Bearer <YOUR_ACCESS_TOKEN>
User-Agent: AcmeSIEM/1.0.0
```

Requests to the OAuth API endpoints send parameters as URL-encoded form data and require a `Content-Type: application/x-www-form-urlencoded` header. Learn more about [requesting an access token](https://www.1password.dev/events-api/v3/manage-integrations.md#request-an-access-token).

### Request bodies

Audit events requests use query parameters for pagination and time filters. Leave the request body empty.

## Query parameters

Add filters and pagination parameters to the endpoint URL. Start the query string with `?`, separate parameters with `&`, and URL-encode their values. For example:

```text theme={null}
GET https://api.1password.com/v3/accounts/-/audit-events?start_time=2026-11-15T00%3A00%3A00Z&end_time=2026-11-16T00%3A00%3A00Z&max_page_size=100
```

Unknown or repeated query parameters return `400 Bad Request`. See [Retrieve audit events](https://www.1password.dev/events-api/v3/reference/retrieve-audit-events.md) for the supported parameters.

### Filtering

The [Retrieve audit events](https://www.1password.dev/events-api/v3/reference/retrieve-audit-events.md) endpoint supports two date and time parameters in [RFC 3339 format](https://datatracker.ietf.org/doc/html/rfc3339):

* `start_time`: Return events with an `insert_time` strictly after this value.
* `end_time`: Return events with an `insert_time` strictly before this value.

The parameters filter on when 1Password received and stored the event. Learn more about [dates and times in the API](#dates-and-times).

If you provide both parameters, `start_time` must be earlier than `end_time`. Otherwise, the API returns `400 Bad Request`.

* If you omit both `start_time` and `end_time`, the API returns events received in the last hour.
* If you include only `end_time`, the API returns events received in the hour before that time.
* If you include only `start_time`, the API returns events received after that time, up to the latest searchable events.

The Events API can retrieve events from the last 120 days. If `start_time` or `end_time` is more than 120 days ago, the API uses the time 120 days ago for that parameter. If `start_time` is in the future, the API returns an empty result.

### Pagination

Use the following query parameters to page through results.

* `max_page_size`: The maximum number of events to return per page. The default is 100 when you omit it or set it to `0`. Values below 0 or above 1000 return `400 Bad Request`.
* `page_token`: An opaque string that identifies the next page of results to retrieve.

> [!WARNING]
>
> Don't use the `start_time` or `end_time` query parameters in a request that also uses `page_token`. Doing so returns a `400 Bad Request` error.

#### Pagination workflow

1. Make a GET call to `/v3/accounts/{account}/audit-events` with any combination of `max_page_size`, `start_time`, and `end_time` that you need.
2. Process the events in `results`. Check whether `next_page_token` has a value.
3. If there are more pages of events, use `next_page_token` as `page_token` in the next request. The token carries the original query settings. For example:

   ```shell theme={null}
   curl --get \
     --url "https://api.1password.com/v3/accounts/-/audit-events" \
     --header "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
     --data-urlencode "page_token=<NEXT_PAGE_TOKEN>"
   ```

   Repeat until `next_page_token` is empty. Omit `page_token` to start a new query. Sending `page_token=` returns `400 Bad Request`.

#### Continuous polling

To poll for new events, retrieve and process every page in the current query. Use the last processed event's `insert_time` as `start_time` for the next poll.

1. Set `start_time` to the earliest insertion time you want to retrieve. Retrieve and process every page in the query.

2. After the last page, save the `insert_time` of the last event you processed in the query. Keep the previous checkpoint if the query returned no events.

3. On your next scheduled poll, use the saved timestamp as `start_time` and leave `end_time` unset. If you haven't processed any events yet, retry with your original starting time. For example:

   ```shell theme={null}
   curl --get \
     --url "https://api.1password.com/v3/accounts/-/audit-events" \
     --header "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
     --data-urlencode "start_time=2026-11-15T18:36:31.883698939Z"
   ```

4. Retrieve and process every page before advancing the checkpoint again.

Keep the full precision of `insert_time`. Page tokens let you retrieve events with the same timestamp across pages in a query. A new query skips events at its `start_time`. To recheck for events that became searchable after a poll, use a `start_time` before the saved timestamp and skip events you've already stored by `id`.

If your integration retries a query after a partial failure, use each event's `id` to skip events you've already stored.

## Responses

A successful request returns `200 OK` with a JSON body. The `results` array contains the events on the current page. When the query finds no events, `results` is an empty array. An empty `next_page_token` marks the last page.

See [Pagination](#pagination) for how to retrieve each page and [Errors](#errors) for other response statuses.

### Dates and times

Event timestamps use [RFC 3339 format.](https://datatracker.ietf.org/doc/html/rfc3339)

* `create_time` records when the event occurred.
* `insert_time` records when 1Password received and stored the event.

The time bounds filter on `insert_time`. If a client sends an event after it occurs, the response can include an event whose `create_time` is earlier than the requested time range. Learn more about [filtering by time](#filtering).

## Rate limits

All integrations in an account share two limits. Both apply.

* 600 requests per minute
* 30,000 requests per hour

The API can include these headers. They describe the window with fewer requests remaining:

* `RateLimit-Limit`: The total number of requests allowed for the current time window.
* `RateLimit-Remaining`: How many requests you can still make in the current window.
* `RateLimit-Reset`: The time when the current window resets, as a Unix timestamp in seconds.

Requests to the [OAuth API endpoints](https://www.1password.dev/events-api/v3/manage-integrations.md#authorization-endpoints) are rate limited separately. See [Users API conventions](https://www.1password.dev/users-api/conventions.md#rate-limits) for the shared OAuth endpoint limits.

If the Events API returns `429 Too Many Requests`, stop sending additional requests. Wait the number of seconds in `Retry-After`, then resume requests.

## Errors

The API uses HTTP status codes to indicate the result of a request. When a response includes a JSON error body, `code` identifies the error and `message` describes it. For example:

```json theme={null}
{
  "code": "invalid_argument",
  "message": "page_token must not be empty"
}
```

The JSON error format is provisional. Use HTTP status codes to handle errors in your integration.

| Status | Code | Meaning |
| - | - | - |
| `400 Bad Request` | `invalid_argument` | A request parameter is invalid, such as an empty `page_token` or invalid time bounds. |
| `401 Unauthorized` | `unauthenticated` | The request is missing a valid access token. Check the `Authorization` header and account region. |
| `403 Forbidden` | `permission_denied` | The token lacks the `audit-events.view` scope or belongs to a different account. |
| `429 Too Many Requests` | `resource_exhausted` | The request exceeded a [rate limit](#rate-limits). Wait for the time specified in `Retry-After`. |
| `500 Internal Server Error` | `internal` | An unexpected error occurred. Retry the request later. |
| `503 Service Unavailable` | `unavailable` | The service is temporarily unavailable. Retry the request later. |
| `504 Gateway Timeout` | `deadline_exceeded` | The request exceeded its deadline. Retry the request later. |

An expired access token can also return `403 Forbidden` with an empty body. [Request a new access token](https://www.1password.dev/events-api/v3/manage-integrations.md#request-an-access-token) and retry.

See the [Retrieve audit events reference](https://www.1password.dev/events-api/v3/reference/retrieve-audit-events.md) for the response schemas.


## Related topics

- [Authorize your integrations using OAuth 2.0](https://www.1password.dev/events-api/v3/manage-integrations.md)
- [1Password Events API reference](https://www.1password.dev/events-api/v3/reference.md)
- [API conventions](https://www.1password.dev/users-api/conventions.md)
