Requirements
Before you get started with the Events API, you’ll need the following.- A 1Password Business or 1Password Enterprise Password Manager account (not included with 1Password Teams).
- Permissions to manage integrations in your 1Password account. For example, you can be an owner, an administrator, an External Account Manager, or a member of the Security group.
Step 1: Create an OAuth application in your 1Password account
Create an OAuth application in your 1Password account to get the client ID and client secret your integration uses to request an access token.An OAuth application’s scopes are set when you create it. If your integration needs different scopes, create a new application.
- Sign in to your account on 1Password.com.
- Select Integrations in the sidebar. If you’ve set up other integrations in your account, select Directory on the Integrations page.
- Select Events reporting.
- Select Continue with OAuth.
-
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.
- Select Save in 1Password and choose a vault for the client ID and client secret. Then select View integration.
Step 2: Request an access token
After you create the OAuth application in your 1Password account, you’ll need an access token to make your first call to the Events API. Using curl on the command line, make a POST call to the/v1/oauth/token endpoint. Pass your client ID and client secret in the --user option so curl can encode your credentials and send them in the HTTP Basic header. Use the base URL that matches your account’s region. For example:
expires_in value is in seconds. Request a new token when the current one expires.
Learn more about OAuth 2.0 authorization in the Events API.
Step 3: Send a test request to the Events API
Use your access token in theAuthorization header to authorize a request to the Events API. Make sure the token has the audit-events.view scope.
Use the same base URL you used to request the access token. The - in the path selects the account associated with the token. In this example, max_page_size=1 limits the response to one audit event.
The User-Agent header is optional. Include it in the format <CompanyOrProductName>/<version> to identify requests from your integration.
results array. If more pages are available, the response includes a next_page_token. This example shows a vault access update.
Example response
results is empty, use an earlier start_time to expand the time range.
If you have more pages of results, take the next_page_token from the response and use it in the page_token query parameter to fetch the next page. Use the same base URL as the first request.
next_page_token is empty. Learn more about pagination and continuous polling.