> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Add system environment associations

POST https://api.getpostman.com/api-catalog/system-environments/{systemEnvironmentId}/associations
Content-Type: application/json

Adds workspace-environment associations to a system environment.

Reference: https://learning.postman.com/api-docs/api-reference/api-catalog/add-api-catalog-system-environment-associations

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /api-catalog/system-environments/{systemEnvironmentId}/associations:
    post:
      operationId: addApiCatalogSystemEnvironmentAssociations
      summary: Add system environment associations
      description: Adds workspace-environment associations to a system environment.
      tags:
        - apiCatalog
      parameters:
        - name: systemEnvironmentId
          in: path
          description: The system environment's ID.
          required: true
          schema:
            $ref: '#/components/schemas/systemEnvironmentId'
        - name: allowPartial
          in: query
          description: >-
            If false, the system only adds associations when there are no status
            errors. If true, the system skips any ineligible associations and
            adds eligible associations.
          required: false
          schema:
            $ref: '#/components/schemas/systemEnvironmentAllowPartial'
            default: false
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/addApiCatalogSystemEnvironmentAssociationsResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/AddApiCatalogSystemEnvironmentAssociationsRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/addApiCatalogSystemEnvironmentAssociations'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    systemEnvironmentId:
      type: string
      title: systemEnvironmentId
    systemEnvironmentAllowPartial:
      type: boolean
      default: false
      title: systemEnvironmentAllowPartial
    addApiCatalogSystemEnvironmentAssociationsWorkspaceEnvId:
      type: string
      description: A workspace environment ID.
      title: addApiCatalogSystemEnvironmentAssociationsWorkspaceEnvId
    workspaceEnvironmentIdsData:
      type: array
      items:
        $ref: >-
          #/components/schemas/addApiCatalogSystemEnvironmentAssociationsWorkspaceEnvId
      description: >-
        A list of workspace environment IDs to remove. Accepts both the
        environment ID or the environment's unique ID
        (`userId`-`environmentId`).
      title: workspaceEnvironmentIdsData
    addApiCatalogSystemEnvironmentAssociations:
      type: object
      properties:
        workspaceEnvironmentIds:
          $ref: '#/components/schemas/workspaceEnvironmentIdsData'
      required:
        - workspaceEnvironmentIds
      title: addApiCatalogSystemEnvironmentAssociations
    addApiCatalogSystemEnvironmentAssociationsMetaData:
      type: object
      properties:
        created:
          type: integer
          description: The number of new associations created.
        existing:
          type: integer
          description: The number of associations that already existed and were unchanged.
        replaced:
          type: integer
          description: >-
            The number of associations that were moved from a different system
            environment.
        excluded:
          type: integer
          description: >-
            The number of associations that were skipped. This only returns if
            you pass the `allowPartial` query parameter as `true`).
      required:
        - created
        - existing
        - replaced
        - excluded
      description: The response's meta information for paginated results.
      title: addApiCatalogSystemEnvironmentAssociationsMetaData
    AddApiCatalogSystemEnvironmentAssociationsDataStatus:
      type: string
      enum:
        - created
        - existing
        - replaced
        - excluded
      description: >
        The association's status:

        - `created` — An association was created.

        - `existing` — The association already existed and is unchanged.

        - `replaced` — The association was moved from a different system
        environment.

        - `excluded` — The association was skipped.
      title: AddApiCatalogSystemEnvironmentAssociationsDataStatus
    addApiCatalogSystemEnvironmentAssociationsData:
      type: object
      properties:
        id:
          type: string
          description: >-
            The association's unique ID. This value doesn't return if the item
            was excluded.
        workspaceEnvironmentId:
          type: string
          description: The workspace's environment ID.
        workspaceId:
          type: string
          description: >-
            The ID of the workspace that contains the environment. This value
            doesn't return if the item was excluded.
        associatedAt:
          type: string
          format: date-time
          description: >-
            The date and time at which the association was created. This value
            doesn't return if the item was excluded.
        status:
          $ref: >-
            #/components/schemas/AddApiCatalogSystemEnvironmentAssociationsDataStatus
          description: >
            The association's status:

            - `created` — An association was created.

            - `existing` — The association already existed and is unchanged.

            - `replaced` — The association was moved from a different system
            environment.

            - `excluded` — The association was skipped.
        previousSystemEnvironmentId:
          type: string
          description: >-
            The system environment ID the association was moved from. This only
            returns when the status is `replaced`.
        reason:
          type: string
          description: >-
            The reason the association was excluded. This only returns when the
            status is `excluded`.
      required:
        - workspaceEnvironmentId
        - status
      description: Information about the associated workspace environment.
      title: addApiCatalogSystemEnvironmentAssociationsData
    addApiCatalogSystemEnvironmentAssociationsResponse:
      type: object
      properties:
        meta:
          $ref: >-
            #/components/schemas/addApiCatalogSystemEnvironmentAssociationsMetaData
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/addApiCatalogSystemEnvironmentAssociationsData
      required:
        - meta
        - data
      title: addApiCatalogSystemEnvironmentAssociationsResponse
    apiCatalogErrorPathMessage:
      type: object
      properties:
        path:
          type: string
          description: The path in which the error occurred.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: apiCatalogErrorPathMessage
    apiCatalogError:
      type: object
      properties:
        type:
          type: string
          format: uri
          description: >-
            The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that
            identifies the type of problem.
        status:
          type: integer
          description: The HTTP status code generated by the origin server.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: An explanation about the problem.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/apiCatalogErrorPathMessage'
          description: A list of errors.
      title: apiCatalogError
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    AddApiCatalogSystemEnvironmentAssociationsRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/apiCatalogError'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
      title: AddApiCatalogSystemEnvironmentAssociationsRequestBadRequestError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Successful Response



**Request**

```json
undefined
```

**Response**

```json
{
  "meta": {
    "created": 1,
    "existing": 1,
    "replaced": 1,
    "excluded": 0
  },
  "data": [
    {
      "workspaceEnvironmentId": "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
      "status": "existing",
      "id": "019d3e30-6768-7770-91f0-a2010c886619",
      "workspaceId": "4540d410-ef72-4977-afb8-d7f53705f379",
      "associatedAt": "2026-03-30T04:30:52.000Z"
    },
    {
      "workspaceEnvironmentId": "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa",
      "status": "replaced",
      "id": "019d3e31-323f-7770-91f0-b2c7d9b0ca21",
      "workspaceId": "a5edcd30-c773-4f88-9660-9590bc0af96b",
      "associatedAt": "2026-03-30T10:01:44.767Z",
      "previousSystemEnvironmentId": "23b554c1-c30c-483d-bf98-dbe9ab7b88a0"
    },
    {
      "workspaceEnvironmentId": "87654321-9b83df88-9b5c-445b-ac23-460c37897340",
      "status": "created",
      "id": "019d3e31-323f-7770-91f0-bc5a64c75930",
      "workspaceId": "a5450abd-ec89-443c-a17a-68132e738714",
      "associatedAt": "2026-03-30T10:01:44.767Z"
    }
  ]
}
```

**SDK Code**

```python Successful Response
import requests

url = "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Successful Response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Successful Response
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Successful Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Successful Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Add System Environment Associations



**Request**

```json
{
  "workspaceEnvironmentIds": [
    "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
    "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa",
    "87654321-9b83df88-9b5c-445b-ac23-460c37897340"
  ]
}
```

**Response**

```json
{
  "meta": {
    "created": 1,
    "existing": 1,
    "replaced": 1,
    "excluded": 0
  },
  "data": [
    {
      "workspaceEnvironmentId": "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
      "status": "existing",
      "id": "019d3e30-6768-7770-91f0-a2010c886619",
      "workspaceId": "4540d410-ef72-4977-afb8-d7f53705f379",
      "associatedAt": "2026-03-30T04:30:52.000Z"
    },
    {
      "workspaceEnvironmentId": "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa",
      "status": "replaced",
      "id": "019d3e31-323f-7770-91f0-b2c7d9b0ca21",
      "workspaceId": "a5edcd30-c773-4f88-9660-9590bc0af96b",
      "associatedAt": "2026-03-30T10:01:44.767Z",
      "previousSystemEnvironmentId": "23b554c1-c30c-483d-bf98-dbe9ab7b88a0"
    },
    {
      "workspaceEnvironmentId": "87654321-9b83df88-9b5c-445b-ac23-460c37897340",
      "status": "created",
      "id": "019d3e31-323f-7770-91f0-bc5a64c75930",
      "workspaceId": "a5450abd-ec89-443c-a17a-68132e738714",
      "associatedAt": "2026-03-30T10:01:44.767Z"
    }
  ]
}
```

**SDK Code**

```python Add System Environment Associations
import requests

url = "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

payload = { "workspaceEnvironmentIds": ["12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619", "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa", "87654321-9b83df88-9b5c-445b-ac23-460c37897340"] }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Add System Environment Associations
const url = 'https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"workspaceEnvironmentIds":["12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619","56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa","87654321-9b83df88-9b5c-445b-ac23-460c37897340"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Add System Environment Associations
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

	payload := strings.NewReader("{\n  \"workspaceEnvironmentIds\": [\n    \"12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619\",\n    \"56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa\",\n    \"87654321-9b83df88-9b5c-445b-ac23-460c37897340\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Add System Environment Associations
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"workspaceEnvironmentIds\": [\n    \"12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619\",\n    \"56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa\",\n    \"87654321-9b83df88-9b5c-445b-ac23-460c37897340\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Add System Environment Associations
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"workspaceEnvironmentIds\": [\n    \"12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619\",\n    \"56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa\",\n    \"87654321-9b83df88-9b5c-445b-ac23-460c37897340\"\n  ]\n}")
  .asString();
```

```php Add System Environment Associations
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations', [
  'body' => '{
  "workspaceEnvironmentIds": [
    "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
    "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa",
    "87654321-9b83df88-9b5c-445b-ac23-460c37897340"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Add System Environment Associations
using RestSharp;

var client = new RestClient("https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"workspaceEnvironmentIds\": [\n    \"12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619\",\n    \"56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa\",\n    \"87654321-9b83df88-9b5c-445b-ac23-460c37897340\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Add System Environment Associations
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["workspaceEnvironmentIds": ["12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619", "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffa", "87654321-9b83df88-9b5c-445b-ac23-460c37897340"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```