Every call to the 1Password Events API must be authorized with a valid JWT-encoded bearer token in the HTTP request header. The token authenticates the client and authorizes it to access specific resources (events), without exposing 1Password account credentials.
You’ll get a bearer token when you set up a new Events Reporting integration, or when you issue a new token in an existing integration.When you generate the token, you’ll choose which events the token is scoped to, then save the token in 1Password.After you set up the integration, you can also issue or revoke tokens at any time.
When you make a call to the Events API, you must include the Authorizationrequest header with your bearer token.The following example uses curl on the command line to make a GET request to the introspect endpoint. API calls to this endpoint allow you to check that your bearer token is valid and confirm which events it’s authorized to access.
In your terminal, format your curl request using the following structure:
The ... at the end of the bearer token here indicates it’s been truncated for the example. You’ll need to include the full credential string for your token.
Option 2: Use an environment variable to load your API token to avoid revealing your bearer token in plaintext. You’ll need to use double quotes for the authorization header to allow for variable expansion. For example:
If you’ve installed jq , you can add | jq at the end of your request to pretty-print the JSON response.
If your token is authenticated, the API will return a 200 response that includes the events (features) scoped to your token. For example:
If you get a 401 Unauthorized error, make sure your bearer token is in the Authorization header and is formatted correctly.Learn more about status codes in the Events API.
To issue a new bearer token for an existing integration:
Sign in to your account on 1Password.com and select Integrations in the sidebar.
Choose the Events Reporting integration where you want to issue a token and select Add a token.
Set up a new bearer token:
Token Name: Enter a name for the token.
Expires After: (Optional) Choose when the token will expire: 30 days, 90 days, or 180 days. The default setting is Never.
Events to Report: Choose which events the token can access. The default setting includes all events: sign-in attempts, item usages, and audit events.
Select Issue Token.
On the “Save your token” page, select Save in 1Password. Choose the vault where you want to save your token, then select Save. Your bearer token will be saved as an API Credential item in 1Password.
If you set a bearer token to expire, you can also edit the item you saved in 1Password if you want to add the token’s expiry date.