On this page

Test the Okta REST APIs with Postman

A great way to learn an Application Programming Interface (API) is to issue requests and inspect the responses. You can use Okta Postman Collections to learn how to incorporate Okta APIs into your workflow. To use these collections, complete the following steps:

  1. Sign up for Okta if you don't have an existing Okta org.
  2. Set up your Postman environment.
  3. Import the Okta collection that you want to test.
  4. Set up Okta for API access.

You can then send test requests to your Okta org and verify the results.

Sign up for Okta

You need an Okta Integrator Free Plan org to get started. Don't have one? Create an org for free (opens new window). The Integrator Free Plan org is assigned a base URL such as integrator-1234567.okta.com. This is your unique subdomain in Okta.

Note: Use this unique subdomain whenever you see the {yourOktaDomain} variable in this document.

Set up your Postman environment

  1. Install the Postman app (opens new window).

  2. Start Postman if it's not open already.

  3. In the upper-left corner, click the hamburger menu > File > Import if you're on Windows. Click Import if you're on MacOS.

  4. In the Import dialog, paste the following link into the Paste cURL, Raw text or URL... textbox: https://developer.okta.com/docs/api/postman/example.oktapreview.com.environment.

    Note: You can also download this environment locally and import it as a file.

  5. In the upper-right corner, click the box that lists the environments, and then select {yourOktaDomain} from the list. The initial value is No Environment if you just installed Postman.

    Postman environment list: Displays an arrow pointing to the box in the upper-right corner of the window that contains environments for use with Postman

  6. In the upper-right corner, next to {yourOktaDomain}, click Environment quick look Postman environment quick look button.

  7. In the upper-right corner of the {yourOktaDomain} dialog, click Edit.

  8. In the environment tab, do the following:

    1. Click the environment name, delete the placeholder text, and name your environment. For example: integrator-1234567 Okta Org
    2. For the url variable, in the Initial Value and Current Value columns, replace the placeholder text with your org's full URL. For example: https://integrator-1234567.okta.com. Remember to remove the -admin part of your subdomain.
  9. Click Save near the top of the tab.

  10. To close the environment tab, hover over the tab and click the x.

Import a collection

Go to the Okta Postman Collections (opens new window) reference to fork the collection that you want to test.

To fork a collection from the Okta Postman Collections (opens new window) reference page, complete the following steps:

  1. Click the Collections icon from the Okta Public API Collections left-hand navigation panel.

  2. Click on the collection you want to fork, click the menu icon, and then select Fork.

  3. Specify a name and workspace for your forked collection.

Set up Okta for API access

To access Okta APIs from Postman, you need to authenticate with the Okta API resource server. Okta APIs support the OAuth 2.0 authentication scheme that uses access tokens. Access tokens enable the bearer to perform specific actions on specific Okta endpoints, defined by the scopes in the token.

See Set up Okta for API access for step-by-step instructions on how to set up Okta to obtain user-based or service-based access tokens.

Note: Okta doesn't recommend using the Okta-propriety SSWS API token authentication scheme. This API token scheme allows you to access a broad range of APIs because there's no scope associated with the token. Access to the APIs depends on the privileges of the user that created the API token. The API token also has a fixed expiry date.

Tips

Use the following tips to work more efficiently with your collection.

Find IDs for Okta API requests

Your imported collections contain URLs and JSON request bodies that have sample data with variables such as {userId}. You can replace the variables in the URL and body with the IDs of the resources that you want to specify.

  1. To get a user's ID, send a request to list the users in your org like you did in the previous section. Each user listed in the response has an ID:

Response example for a request that highlights the ID in the response

  1. Copy the id of the resource for use in your next request. In this example, use the id for Tony Stark. You can add the id value in your Postman environment and use the corresponding variable in your request URL or body.

You can retain headers when you click HAL links in the responses.

To retain the headers:

  1. Click the gear icon from the toolbar in the upper-right corner of the page.
  2. Select Settings.
  3. In the Headers section, enable Retain headers when clicking on links.

Next steps

Use Postman to learn more about the Okta APIs: