> For the complete documentation index, see [llms.txt](https://docs.licensespring.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.licensespring.com/common-scenarios/glossary/postman-collections/management-api-collection.md).

# Management API Collection

#### Management API Base URL

All Management API requests use the domain: [https://saas.licensespring.com](https://saas.licensespring.com/)\
Do **not** use [https://api.licensespring.com](https://api.licensespring.com/) for Management API requests. That domain is reserved for the License API.

#### Required Authentication Key

The Management API requires the following key:

* `managementApiKey`

The keys below **are not valid** for the Management API:

* `apiKey`
* `sharedKey`

These keys apply exclusively to the License API and cannot be used for Management API authentication.

These settings are accessible in the LicenseSpring development environment, which must be selected in Postman.

![Select environment](/files/89a2a7da473e82f27ed6e1b847b3c04339bc71fa)

![](/files/17eac0bd39a91373401edecab77ee91874dbf5b5)

### Management API variables

The Management API collection uses several environment variables that are automatically populated by running the corresponding List requests inside each folder. These variables allow PATCH, DELETE, and GET-by-ID operations to work without manual input.

#### Automatically populated variables

When you run the first request in a folder (e.g., *List Customers*, *List Products*, *List Licenses*), the script extracts the ID of the **first** returned item and stores it in the environment:

| Variable          | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| `customer_id`     | Set by running **GET Customers**                              |
| `product_id`      | Set by running **GET Products**                               |
| `license_id`      | Set by running **GET Licenses**                               |
| `labels_id`       | Set by running **GET Labels**                                 |
| `features_id`     | Set by running the corresponding **List Features** request    |
| `user_id`         | Set by running **List Users**                                 |
| `order_id`        | Set by running **List Orders**                                |
| `accounts_id`     | Set by running **List Accounts**                              |
| `activation_id`   | Set by running **List Activations**                           |
| `installation_id` | Set by running **List Installations**                         |
| `…`               | All other variables are set by their respective List requests |

If a List request returns an empty array, it means no resources exist yet. You can either:

* Create the resource in the LicenseSpring UI, **or**
* Use the POST request provided in the same folder.

### How the Management API Collection Works

Each folder in the Management API collection follows a consistent workflow:

{% stepper %}
{% step %}

### Run the List request

* Retrieves all resources of that type.
* Automatically stores the ID of the first item in the environment variable.
* Example: `GET Products` → sets `{{product_id}}`.
  {% endstep %}

{% step %}

### Run other requests (Show, Patch, Delete, etc.)

* These requests automatically read the ID from the environment variable.
* No need to manually replace values.
* Simplifies testing and minimizes errors.
  {% endstep %}
  {% endstepper %}

#### Why the first resource in the list?

For convenience and automation. If you want to target a different resource, you can simply change the environment variable manually (see below).

### Manual variable adjustment (optional)

If you prefer to use an ID other than the automatically selected one, you can manually set a value in the environment:

{% stepper %}
{% step %}

### Copy the ID from the UI

Example: from <https://saas.licensespring.com/orders/order\\_id/license\\>\_
{% endstep %}

{% step %}

### Paste it into the matching environment variable

Example: set `license_id` to the copied value.
{% endstep %}

{% step %}

### Run any request in the folder

It will now use your manually selected ID.
{% endstep %}
{% endstepper %}

![Add your license\_id](/files/54315328532155b1e680b57dd9605c2038eda216)

Or set it up from using **POST/create request** inside request body:

![Add value to existing variable](/files/2e1779d8f0f37407d10d241541b33a781fd16d84)

* Important: the script will override your `product_id` if you run the List request again in that folder. Please delete/remove the post-response script as shown in the image if you want to preserve your manually set value.

![](/files/ca2cd1e2ad92a4e4351956cddb0b2444b0fde818)

### OAuth Folders inside the Management API Collection

Some folders include OAuth-based Management API endpoints. These require:

* `license_id`, or
* `customer_id`, or
* `customer_account_code`

These variables are populated automatically by running the corresponding List requests. If you want OAuth requests to target different resources, update these variables manually.

If your organization has enabled OAuth scoping (customer-level, license-level, or account-level), the IDs must match the scope assigned on your LicenseSpring platform.

### Example workflow

Products Folder Example:

{% stepper %}
{% step %}
Run `GET Products` → sets `{{product_id}}`
{% endstep %}

{% step %}
Run `GET Product (Show)` → uses `{{product_id}}`
{% endstep %}

{% step %}
Run `PATCH Product` → updates the same product
{% endstep %}

{% step %}
Run `DELETE Product` → deletes the same resource
{% endstep %}
{% endstepper %}

Every folder works the same way.

### Common Issues

<details>

<summary>404 Not Found</summary>

You ran PATCH/DELETE but no ID was set. Run the folder’s List request first.

</details>

<details>

<summary>401 Unauthorized</summary>

Your `managementApiKey` is missing or has a trailing space.

</details>

<details>

<summary>Invalid URL</summary>

Your management API URL has a trailing slash or extra space.

NOTE: Always ensure there are **no extra spaces** in any environment variable.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.licensespring.com/common-scenarios/glossary/postman-collections/management-api-collection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
