Getting started overview

This guide provides a rapid path to making your first successful API call to the Postman API. The Postman API allows programmatic interaction with your Postman workspace, including managing collections, environments, mocks, and monitors. By following these steps, you will set up your Postman account, generate an API key, and execute a basic request to verify your setup.

The process involves:

  1. Creating or logging into a Postman account.
  2. Generating a Postman API Key.
  3. Making your first authenticated request using the API Key.

Before proceeding, ensure you have a Postman account. If you do not have one, you can sign up for a Postman Basic plan, which includes a free tier for individual use and small teams.

Quick Reference Table

Step What to Do Where
1. Sign Up/Log In Create a new Postman account or log into an existing one. Postman Home Page
2. Generate API Key Navigate to your personal API keys section and create a new key. Postman Dashboard > Settings > API Keys
3. Make First Request Use the generated API key as an X-Api-Key header to query your collections. Any HTTP client (e.g., cURL, Postman Desktop App)
4. Validate Response Confirm a 200 OK status and a list of your Postman collections. HTTP client response body

Create an account and get keys

  1. Create or Log In to Postman: Navigate to the Postman website. If you don't have an account, sign up for a free account. If you already have one, log in to your Postman workspace.

  2. Access API Keys Section: Once logged in, go to your workspace. In the top-right corner, click on your avatar or initials to open the dropdown menu. Select "Settings", and then navigate to the "API Keys" tab in the left sidebar.

  3. Generate a New API Key: Click the "Generate API Key" button. Provide a name for your key (e.g., "My First API Key"). Click "Generate." Postman will display your new API key. It is crucial to copy this key immediately, as it will only be shown once for security reasons. If you lose it, you will need to generate a new key.

    The Postman API uses this API key for authentication. It is a bearer token that grants access to your Postman resources. Protecting this key is essential, similar to how you would protect a password or other sensitive credentials.

Your first request

With your API key in hand, you can now make your first authenticated call to the Postman API. We will use the Get All Collections endpoint as a simple test. This endpoint retrieves a list of all collections within your workspace.

The base URL for the Postman API is https://api.getpostman.com.

Using cURL:

Open your terminal or command prompt and execute the following cURL command. Replace YOUR_POSTMAN_API_KEY with the key you generated.

curl --request GET \
  --url https://api.getpostman.com/collections \
  --header 'X-Api-Key: YOUR_POSTMAN_API_KEY'

Using Postman Desktop/Web App:

  1. Create a New Request: Open your Postman application (desktop or web). Click the "+" button to create a new request.

  2. Set Request Method and URL: Select GET as the HTTP method. Enter the request URL: https://api.getpostman.com/collections.

  3. Add Authorization Header: Go to the "Headers" tab. Add a new header with:

    • Key: X-Api-Key
    • Value: YOUR_POSTMAN_API_KEY (replace with your actual key)
    Alternatively, you can go to the "Authorization" tab, select type "API Key", enter X-Api-Key for the key, your API key for the value, and select "Add to: Header" for the "Add to" option.

  4. Send the Request: Click the "Send" button.

Expected Response:

A successful response will have a 200 OK status code and a JSON body similar to this, listing your collections:

{
  "collections": [
    {
      "id": "12345-abcdef-ghijkl",
      "name": "My First Collection",
      "owner": "1234567"
    },
    {
      "id": "67890-ghijkl-mnopq",
      "name": "API Documentation",
      "owner": "1234567"
    }
  ]
}

If you receive a similar response, you have successfully authenticated and made your first call to the Postman API!

Common next steps

After successfully making your first request, consider these common next steps to deepen your engagement with the Postman API:

  • Explore the API Reference: Dive into the comprehensive Postman API Reference to discover other available endpoints. You can manage environments, mocks, monitors, and more.

  • Postman Collection SDK: For programmatic interaction, especially in JavaScript environments, explore the Postman Collection SDK. It allows you to parse, manipulate, and execute Postman collections programmatically.

  • Integrate with CI/CD: Learn how to integrate the Postman API with your Continuous Integration/Continuous Deployment (CI/CD) pipelines. This enables automated API testing and deployment of API definitions. Resources like AWS CodePipeline integrations often provide examples of integrating API testing tools.

  • Webhooks: Set up Postman webhooks to receive real-time notifications about events in your Postman workspace, such as collection updates or monitor failures.

  • Environments and Globals: Programmatically manage Postman environments and global variables to adapt your API calls to different stages (development, staging, production) or user contexts.

  • Workspaces and Teams: If you are working in a team, learn how to manage workspaces and team members through the API to streamline collaboration and access control.

Troubleshooting the first call

If your first Postman API call does not return a 200 OK status, consider the following common issues:

  • Incorrect API Key: Double-check that you copied the API key correctly and that there are no extra spaces or characters. Remember, keys are only shown once during generation. If unsure, generate a new key.

  • Missing Header: Ensure the X-Api-Key header is correctly included in your request. For cURL, this is --header 'X-Api-Key: YOUR_POSTMAN_API_KEY'. For Postman app, it's added under the "Headers" tab or "Authorization" tab as type API Key.

  • Invalid Endpoint: Verify the request URL: https://api.getpostman.com/collections. Even a minor typo can lead to a 404 Not Found error.

  • Network Issues: Check your internet connection. Proxy settings or firewalls might also interfere with outgoing requests. If you are behind a corporate firewall, you might need to configure proxy settings in your HTTP client.

  • Rate Limiting: While unlikely for a first call, be aware that the Postman API has rate limits. If you are testing rapidly, you might temporarily hit these limits. The API returns a 429 Too Many Requests status in such cases, along with X-RateLimit-Limit and X-RateLimit-Remaining headers (Postman API rate limits documentation).

  • Outdated Postman App: If using the Postman Desktop App, ensure it's updated to the latest version to avoid any client-side issues.

  • Workspace Permissions: Ensure the API key is associated with an account that has access to the workspace and resources you are trying to query.