Requirements
Before you get started with the Users API, you’ll need:- A 1Password Business or 1Password Enterprise Password Manager account (not included with 1Password Teams)
- Permissions to manage integrations in your 1Password account (for example, as an owner, administrator, or member of the Security group)
Step 1: Create an OAuth application in your 1Password account
To call the Users API, you’ll first create an OAuth application in your 1Password account, which generates the client credentials your integration will use to request an access token.- Sign in to your 1Password account.
- Select Integrations in the sidebar. If you’ve set up other integrations in your account, you’ll also need to select Directory on the Integrations page.
- Select OAuth Application.
- Select Client credentials as the grant type, then select Next.
-
Configure your OAuth application:
- Application name: Enter a name to help you identify the integration.
- Scopes: Select one or more of the scopes from the “Select scopes” list, according to the access required for your integration: view users, suspend user, and reactivate user.
- Description: (Optional) Add a description with additional information about your OAuth application.
- Select Save in 1Password and choose the vault where you want to save your client credentials. 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 Users 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 that curl will encode your credentials and send them in the HTTP Basic header. For example:
See the example token request in the OAuth authorization guide for more information.
Step 3: Send a test request to the Users API
Use your access token in theAuthorization header to authorize a request to the Users API. Make sure the endpoint you call can be used with the scopes you set for the access token.
For example, if your access token is scoped to list all users, you can make a call to the /v1/accounts/{account}/users endpoint. Make sure the base URL you use in the endpoint matches the region of your 1Password account. To limit the number of results per page, use the max_page_size query parameter. For example:
next_page_token. For example:
next_page_token from the response, then use it with the page_token query parameter to fetch the next page of results. Learn more about pagination in the Users API.