titledescriptionupdated_date
Okta APIHow to create an Okta API token for accessing audit logs and user data.2025-10-24T16:45:21Z

What we need

[] API Token [] Okta domain (e.g., your-domain.okta.com)

Follow these steps to create an Okta API token that can be used as a bearer token:

Creating an Okta API Token

  1. Log in to your Okta Admin Dashboard

    • Navigate to your Okta Admin Dashboard (typically https://your-domain-admin.okta.com).
    • Sign in with an administrator account that has sufficient permissions.
  2. Access the API section

    • In the Admin Dashboard, navigate to Security > API.
    • Select the Tokens tab.
  3. Create a new token

    • Click the Create Token button.
    • Enter a meaningful name for your token (e.g., “Audit Logs Access”).
    • Click Create Token.
  4. Copy and secure your token

    • Once created, your token will be displayed only once.
    • Copy the token immediately and store it securely.
    • This token cannot be viewed again after you navigate away from this page.
  5. Set token expiration (Optional)

    • By default, Okta API tokens do not expire.
    • For enhanced security, consider setting an expiration date in your organization’s token settings.

Using the API Token

You can use this token in API requests by setting:

Authorization: SSWS YOUR_API_TOKEN_HERE

Note: Okta uses the SSWS (Secure, Single-Workload Service) prefix before the token, not the standard Bearer prefix.

Required Permissions

To access Okta audit logs and user data, ensure your administrator account has the following permissions:

For Audit Logs Access

  • Read-Only Administrator role or custom role with:
    • View System Log permission
    • Read-Only access to Reports

For User Data Access

  • Read-Only Administrator role or custom role with:
    • Read-Only access to Users
    • Read-Only access to User Profile

Item Checklist for Integration

  1. Okta API token
  2. Your Okta domain (e.g., your-domain.okta.com)
  3. Appropriate administrator permissions

API Endpoints

Common endpoints you can access with this token:

Audit Logs

GET https://your-domain.okta.com/api/v1/logs

User Data

GET https://your-domain.okta.com/api/v1/users

For more detailed information, refer to the Okta API Reference.