To call any of our resource APIs, you must provide an OAuth 2.0 bearer access token in the Authorization header. To get an OAuth 2.0 bearer access token, you must call the Generate Tokens API using an API credential pair: a client ID and a client secret.
Creating an API Credential Pair
Access OneLogin as an account owner or administrator.
- Go to Developers > API Credentials.
- On the API Access page, click New Credential. In this example, we've named the credentials using the name of the developer and app that will be using the credentials.
Give your credential pair a meaningful name. This name will be very important if you ever need to re-access or delete the credentials.

Select a scope for the credentials.
Authentication Only
Gives the credential pair the ability to generate an access token that can perform POST calls only to authentication endpoints, providing least privileged access to authentication code. These endpoints include: [Verify Factor (SAML Assertion)](/api-docs/1/saml-assertions/verify-factor)[Generate SAML Assertion](/api-docs/1/saml-assertions/generate-saml-assertion) [Verify Factor (Login)](/api-docs/1/login-page/verify-factor) [Create Session Login Token](/api-docs/1/login-page/create-session-login-token) [Log User Out](/api-docs/1/users/log-user-out) </li> <li><p><strong>Read Users</strong></p> <p>Gives the credential pair the ability to generate an access token that can perform GET calls available for the User, Role, and Group API resources.</p></li> <li>Manage users
Gives the credential pair the ability to generate an access token that can perform GET, POST, PUT, and DELETE calls available for the User, Role, and Group API resources, with the exception of setting passwords and assigning and removing roles.
Read All
Gives the credential pair the ability to generate an access token that can perform GET calls available for all API resources.
Manage All
Gives the credential pair the ability to generate an access token that can perform GET, POST, PUT, and DELETE calls for all available API resources, including the ability to set passwords and assign and remove roles.
- Click Save. Copy your client secret and client ID for use in making the Generate Access Token API call that will provide the access token you need to make calls to API resources.
Warning: Keep these credentials secure and take care to not inadvertently embed them in shared code.
Click Done. The API Access page updates to reflect creation of the API credential pair.
Access OneLogin as an account owner or administrator.
Go to Settings > API.
- On the API Access page, click the row that corresponds to your credential pair. The credentials display.
Warning: Once you delete a credential pair, any access and refresh tokens generated by the credential pair will be revoked and will no longer work.
Access OneLogin as an account owner or administrator.
Go to Settings > API.
- On the API Access page, click the row that corresponds to your credential pair.
- Verify that you are working with the correct pair.
Click Delete. You'll be prompted to confirm your choice. The API credential pair and any access and refresh tokens it generated will stop working immediately.
Warning: Once you disable or delete a credential pair, any access and refresh tokens generated by the credential pair will be revoked and will no longer work.
Access OneLogin as an account owner or administrator.
Go to Settings > API.
- On the API Access page, click the row that corresponds to your credential pair.
- Verify that you are working with the correct pair.
Click Disable. The API credential pair and any access and refresh tokens it generated will stop working after a few minutes.
- Once disabled, the API credential will display in the Disabled section of the API Access page.

To reenable the API credential, click the API credential row in the Disabled section. Click Enable.

Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides? Check out our Knowledge Base.
Have a product idea or request? Share it in our Ideas Portal.