Edit Page

Overview

A great way to learn an API is to issue requests and inspect the responses. You can easily access our Postman collections and Example environment to do just that.

Postman and an Okta Collection

To use these collections, you’ll need to set up your environment, import the collections, send a test request, and verify the results.

Set Up Your Environment

  1. Create an API token.
  2. Install the Postman App.
  3. Launch Postman and click the ‘import button’. Select import from link, and paste this link into the textbox: http://developer.okta.com/docs/api/postman/example.oktapreview.com.environment Importing the Okta Example Environment

  4. Once you have clicked import, make sure the example.oktapreview.com environment is selected. Postman app with collections

  5. Click the eye icon next to example.oktapreview.com and select Edit to replace or add these values:
    • Rename your environment to something you’ll recognize, for example myOrg.
    • url: Replace the example value with your org’s URL, for example https://myOrg.oktapreview.com. This becomes the new name of your environment. Do not include ‘-admin’ in the subdomain.
    • apikey: Enter the API token you created in your org, for example 00LzMWxMq_0sdErHy9Jf1sijEGexYZlsdGr9a4QjkS.
    • email-suffix: Enter the email suffix for your domain, for example myOrg.com.
  6. Save your changes by selecting Update. Now your environment looks similar to this example: Example.okta.com environment with required values

Import a Collection

Import the collection for the Users API:

Run in Postman

Note: You can import and work with the rest of the Okta API using the link at the top of each API reference page, or use the Collections Quick Reference. This tutorial only requires the Users collection import.

Send a Request

To test your configuration, send a request to list all the users in your org:

  1. Make sure you’ve imported the Users API collection and configured your example environment using the instructions in the previous section.
  2. Select the Collections tab in Postman, open the List Users folder, and select GET List Users.
  3. Click Send. The result pane automatically displays the results of your request: GET List Users If you receive errors, it’s likely that one of the values in the environment isn’t set correctly. Check the values and try again.

Once you have completed this simple request, you are ready to explore the Okta API.

Collections Quick Reference

Import any Okta API collection for Postman from the following list:

Collections click to Run
Authentication Run in Postman
OAuth 2.0 and OpenID Connect Run in Postman
Apps Run in Postman
Events Run in Postman
Factors Run in Postman
Groups Run in Postman
Identity Providers (IdP) Run in Postman
Logs Run in Postman
Admin Roles Run in Postman
Schemas Run in Postman
Users Run in Postman
Custom SMS Templates Run in Postman

These buttons are also available at the top of each API reference page in developer.okta.com.

Tips

Now that you have a working collection, you can use the following tips to work more efficiently.

Find IDs for Okta API Requests

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

To find an ID:

  1. List a resource collection with a search or filter. For example, list the users in your org, as you did in the previous section. List Users Response

  2. Copy the id of the resource, in this example the id for Tony Stark, in your next request.

Retaining the headers is helpful when you click HAL links in responses.

To retain the headers:

  1. Launch Postman and click the wrench icon.
  2. Select Settings.
  3. In the Headers column, enable Retain headers when clicking on links.