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