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

# Migrate from the legacy Events API to the Events API v3

> Migrate a custom or vendor-managed integration to the Events API v3 before legacy endpoints stop working on June 30, 2027.

> [!WARNING]
>
> The legacy Events API v1 and v2 endpoints will stop working on June 30, 2027. Migrate your integration to the Events API v3 before that date to keep receiving events.

If you built your integration, update how it authorizes requests, retrieves events, and processes responses. If you use a vendor's integration, check when it will support the v3 endpoint with OAuth.

## Migrate a vendor-managed integration

Ask your security information and event management (SIEM) vendor which version of its integration supports the Events API v3 endpoint with OAuth, when that version will be available, and how to switch without interrupting event collection. Plan to complete the migration before June 30, 2027.

When your vendor's update is available, [create an OAuth application](https://www.1password.dev/events-api/v3/get-started.md#create-an-oauth-application), configure the updated integration with its client credentials, and confirm that new events arrive in your SIEM before you disable the legacy integration.

To find an integration guide for your SIEM, see [Events Reporting integrations in the 1Password Marketplace](https://marketplace.1password.com/?category=event-reporting).

## Migrate a custom integration

### Create an OAuth application

You'll need permission to manage integrations in your 1Password account. For example, you can be an [owner](https://support.1password.com/groups/#owners), an [administrator](https://support.1password.com/groups/#administrators), an [External Account Manager](https://support.1password.com/msp-technician-permissions/), or a member of the [Security group](https://support.1password.com/groups/#security).

Create an OAuth application for your Events API integration even if you already use OAuth for another 1Password API. Use the **Client credentials** grant type and the **View audit events** scope (`audit-events.view`).

> [!NOTE]
>
> An OAuth application's scopes are set when you create it. If your integration needs different scopes, create a new application.

1. [Sign in](https://start.1password.com/signin) to your account on 1Password.com.

2. Select [**Integrations**](https://start.1password.com/integrations/directory) in the sidebar. If you've set up other integrations in your account, select **Directory** on the Integrations page.

3. Select **Events reporting**.

4. Select **Continue with OAuth**.

5. Configure your OAuth application:

   * **Application Name**: Enter a name to help you identify the integration.
   * **Scopes**: Check that **View audit events** is selected.
   * **Description**: (Optional) Add a description with additional information about your OAuth application.

   When you're finished, select **Next** to generate your client ID and client secret.

   > [!WARNING]
   >
   > 1Password shows the client secret once. Save it before you continue.

6. Select **Save in 1Password** and choose a vault for the client ID and client secret. Then select **View integration**.

When you select **Events reporting** in the directory, 1Password chooses the **Client credentials** grant type for you and marks that step as complete. If you select **Directory** > **OAuth Application**, choose **Client credentials** as the grant type, then select the **View audit events** scope.

Request an access token with your client ID and client secret. Replace `api.1password.com` with the [host for your account's region](#send-requests-to-the-new-endpoint) if needed.

```shell theme={null}
curl --request POST 'https://api.1password.com/v1/oauth/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --user '<client_id>:<client_secret>' \
  --data 'grant_type=client_credentials'
```

Send the `access_token` from the response in the `Authorization: Bearer` header in place of your legacy token. The access token expires after 15 minutes (900 seconds). Request another access token with the same client credentials when it expires.

Remove calls to the legacy token introspection endpoint (`/api/v2/auth/introspect` or `/api/auth/introspect`). To check whether a v3 OAuth access token is active, call [`POST /v1/oauth/introspect`](https://www.1password.dev/users-api/introspect-access-token) with the same client credentials you used to request the token. You can also use `expires_in` from the token response to track when the token expires.

### Send requests to the new endpoint

Use the same new host to request access tokens and retrieve events.

| Legacy host | v3 host |
| - | - |
| `events.1password.com` | `api.1password.com` |
| `events.1password.ca` | `api.1password.ca` |
| `events.1password.eu` | `api.1password.eu` |
| `events.ent.1password.com` | `api.ent.1password.com` |

Replace POST requests to `auditevents`, `itemusages`, and `signinattempts` with `GET /v3/accounts/{account}/audit-events`. Use your account ID for `{account}`, or use `-` to select the account associated with your access token.

Leave the request body empty and send parameters in the query string. Replace `limit` with `max_page_size`, which has a maximum of 1,000. Omit `max_page_size` or set it to `0` for the default of 100. Unknown or repeated query parameters return `400 Bad Request`.

Send a test request. A `200 OK` response contains a `results` array, which can be empty. To test your parser with known activity, set `start_time` to an earlier insertion time.

```shell theme={null}
curl --get 'https://api.1password.com/v3/accounts/-/audit-events' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'User-Agent: <CompanyOrProductName>/<version>' \
  --data-urlencode 'max_page_size=1'
```

### Update pagination and polling

In Events API v3, `start_time` and `end_time` are exclusive and filter on `insert_time`, when 1Password stored the event. Use `create_time` to see when the event occurred. The API can retrieve events from the last 120 days, subject to [when each event type became available](https://www.1password.dev/events-api/v3/data-availability.md).

> [!NOTE]
>
> The legacy Events API filters events by when they occurred. The same time range can return different events in v3 because 1Password can store an event after it occurs. To find events that occurred within a specific time range, query a wider range by insertion time and filter the results by `create_time`.

1. Start a query with `start_time` and, for a bounded query, `end_time`. Use [RFC 3339 format](https://datatracker.ietf.org/doc/html/rfc3339) for both values. Leave `end_time` unset when polling for new events.
2. Process the events in `results`. If `next_page_token` has a value, send it as `page_token` in the query string on the next request. Omit `start_time` and `end_time` when you send `page_token`.
3. Repeat until `next_page_token` is empty. After you've processed every page, save the last processed event's `insert_time` at full precision. If the query returned no events, keep your previous starting point.
4. On the next poll, start a fresh query using that timestamp as `start_time`.

Page tokens let you retrieve events with the same `insert_time` across pages. A new query excludes 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`. Learn more about [continuous polling](https://www.1password.dev/events-api/v3/conventions.md#continuous-polling).

### Update event parsing and rules

Read events from `results` instead of `items`. Some fields can be present with an empty string (`""`) or zero (`0`). For example, a target without an identifier has `id` set to `""`. Check the field's value before you use it in a rule or a lookup.

The endpoint returns events from all categories in the requested time range in a single stream. Use `category` to route events in your integration. For example, filter for `vault-item-usage` to collect item usage or `sign-in` to collect sign-in attempts.

For sign-in attempts, read `outcome.result`. The possible values are `success`, `failure`, `timeout` when a second-factor challenge expires, and `report` when a firewall rule reports the sign-in and allows it to proceed.

Update your alerts, saved searches, and dashboards that use legacy action values. v3 uses dotted actions such as `report.view` and a separate `category` such as `report`. Some legacy action values map to the same v3 action. For example, `delete` and `autodel` both map to `user.delete`. To find automatic deletions, filter for `actor.type` set to `system`. Use `diff` to distinguish other changes where available. See [Audit event data availability](https://www.1password.dev/events-api/v3/data-availability.md) for action mappings and history by event type.

Each entry in `targets` represents an affected entity. Read its `type` and `id` together to identify it. Read additional fields from the key that matches `type` with hyphens replaced by underscores. For example, a `vault-item` target has its fields under `vault_item`. A target without additional fields omits the nested object.

```json theme={null}
{
  "type": "vault-item",
  "id": "f5b5s5n3vbf3zfh4vx5mzw6zly",
  "vault_item": {
    "id": "f5b5s5n3vbf3zfh4vx5mzw6zly"
  }
}
```

#### Audit event field mapping

| Legacy field | v3 field | What to update |
| - | - | - |
| `uuid` | `id` | Use the v3 ID to deduplicate retries of the v3 stream. |
| `timestamp` | `create_time` | Use this for the time the event occurred. |
| None | `insert_time` | Use this for polling and time bounds. |
| `actor_uuid`, `actor_details.{uuid,name,email}` | `actor.{id,name,email}` | Read actor information from the nested object. |
| `actor_type` | `actor.type` | Read the actor type from the nested object. |
| `actor_account_uuid` | `actor.linked_account.id` | This is the closest equivalent for an actor from a linked account. The linked account also contains `name`, `state`, `type`, and `domain`. |
| `account_uuid` | `context.account.id` | The context also contains `context.account.name`. |
| `action` | `action`, `category` | Update rules that depend on legacy action values. |
| `object_type`, `object_uuid`, `object_details` | `targets[]` | Iterate over all affected entities. |
| `aux_id`, `aux_uuid`, `aux_details`, `aux_info` | `targets[]` or `diff` | Look for the related entity or change. The location depends on the event type. |
| `session.{uuid,login_time}` | `context.session.{id,login_time}` | Read session details from the context. |
| `session.device_uuid` | `context.device.id` | The device can also include `name` and `model`. |
| `session.ip` | `context.location.ip_address` | Read the IP address from the location. |
| `location.country` | `context.location.region_code` | The country uses the same ISO code. |
| `location.region` | None | Remove dependencies on the subdivision, such as Ontario. |
| `location.{city,latitude,longitude}` | `context.location.{city,latitude,longitude}` | Read geographic details from the context. |
| None | `context.origin` | Identifies the source of the action, such as `password_manager`. |
| None on legacy audit events | `context.client.{name,version}` | Legacy item usages and sign-in attempts already included client metadata. |
| None | `context.os.{name,version}`, `context.user_agent` | Provides operating system and user agent details. |
| None | `diff.{type,old_value,new_value}` | Describes the change and its before and after values when available. |
| None | `correlation_id` | Groups events from the same bulk action. |

If you use a legacy `/api/v1/` endpoint, `context.account.id`, `actor.type`, and `actor.linked_account.id` are new fields. For example, when a managed service provider (MSP) technician acts in a customer's account from the provider's account, `actor.linked_account` identifies the provider's account. Events API v3 returns the actor's ID from their original account. Use `actor.linked_account` to identify the account where that ID belongs.

### Update error handling and rate limits

Handle errors by HTTP status. When the API returns a JSON error body, read `code` and `message` in place of `Error.Message`.

| Status | Code | What to do |
| - | - | - |
| `400 Bad Request` | `invalid_argument` | Check for unknown or repeated parameters, invalid bounds, or time bounds sent with a page token. |
| `401 Unauthorized` | `unauthenticated` | Check that you're sending a valid OAuth access token to the correct regional host. |
| `403 Forbidden` | `permission_denied` | Check the application's `audit-events.view` scope and the account in the request path. If the body is empty and the access token has expired, request a new token and retry. |
| `429 Too Many Requests` | `resource_exhausted` | Wait the number of seconds in `Retry-After` before sending another request. |
| `504 Gateway Timeout` | `deadline_exceeded` | Retry the request later. |

All v3 integrations for an account share limits of 600 requests per minute and 30,000 per hour. Budget requests across integrations that poll the same account. See [API conventions](https://www.1password.dev/events-api/v3/conventions.md#errors) for other errors and [rate limit headers](https://www.1password.dev/events-api/v3/conventions.md#rate-limits).

### Test and switch to Events API v3

1. Keep the legacy integration sending events to production. Set `start_time` before the planned switch so the two streams cover some of the same activity. Start the v3 integration and send its events to a test destination. Keep the legacy cursors and the v3 checkpoint separately.
2. Compare both streams over the same period. Use the legacy `timestamp` and v3 `create_time` to compare when events occurred. Check that v3 includes the categories and event details you need and that your alert rules trigger as expected. Event IDs can differ between versions, so use the [action mappings](https://www.1password.dev/events-api/v3/data-availability.md#legacy-event-mappings) and event details such as the actor and affected entity to compare events.
3. Stop legacy delivery to production and retain the last legacy cursors. Compare the staged v3 events around the switch with the events legacy already delivered. Forward the missing events to production and skip confirmed duplicates. Use the same check for late arrivals from the overlap period.
4. Send new v3 events to production. Resume polling from the last v3 checkpoint for which you've processed every page and accounted for every event. Confirm that events arrive and that your alerts, searches, and dashboards work. Then turn off the legacy integration and [revoke its bearer token](https://www.1password.dev/events-api/v2/authorization.md#revoke-a-bearer-token) if no other consumer uses it.


## Related topics

- [Audit event data availability](https://www.1password.dev/events-api/v3/data-availability.md)
- [Legacy Events API](https://www.1password.dev/events-api/v2/introduction.md)
- [Events API conventions](https://www.1password.dev/events-api/v2/conventions.md)
