> 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.

# Remove system environment associations

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

Removes workspace-environment associations from a system environment.

Reference: https://learning.postman.com/api-docs/api-reference/api-catalog/remove-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:
    delete:
      operationId: removeApiCatalogSystemEnvironmentAssociations
      summary: Remove system environment associations
      description: Removes workspace-environment associations from a system environment.
      tags:
        - apiCatalog
      parameters:
        - name: systemEnvironmentId
          in: path
          description: The system environment's ID.
          required: true
          schema:
            $ref: '#/components/schemas/systemEnvironmentId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/removeApiCatalogSystemEnvironmentAssociationsResponse
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RemoveApiCatalogSystemEnvironmentAssociationsRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/removeApiCatalogSystemEnvironmentAssociations
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
    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
    removeApiCatalogSystemEnvironmentAssociations:
      type: object
      properties:
        workspaceEnvironmentIds:
          $ref: '#/components/schemas/workspaceEnvironmentIdsData'
      required:
        - workspaceEnvironmentIds
      title: removeApiCatalogSystemEnvironmentAssociations
    removeApiCatalogSystemEnvironmentAssociationsMetaData:
      type: object
      properties:
        deleted:
          type: integer
          description: The number of associations successfully removed.
        notFound:
          type: integer
          description: >-
            The number of environment IDs with no existing association to
            remove.
      required:
        - deleted
        - notFound
      description: The response's meta information for paginated results.
      title: removeApiCatalogSystemEnvironmentAssociationsMetaData
    RemoveApiCatalogSystemEnvironmentAssociationsDataStatus:
      type: string
      enum:
        - deleted
        - notFound
      description: |
        The status of the operation:
        - `deleted` — The association was successfully removed.
        - `notFound` — The association could not be removed.
      title: RemoveApiCatalogSystemEnvironmentAssociationsDataStatus
    removeApiCatalogSystemEnvironmentAssociationsData:
      type: object
      properties:
        workspaceEnvironmentId:
          type: string
          description: The workspace's environment ID.
        status:
          $ref: >-
            #/components/schemas/RemoveApiCatalogSystemEnvironmentAssociationsDataStatus
          description: |
            The status of the operation:
            - `deleted` — The association was successfully removed.
            - `notFound` — The association could not be removed.
      required:
        - workspaceEnvironmentId
        - status
      description: Information about the associated workspace environment.
      title: removeApiCatalogSystemEnvironmentAssociationsData
    removeApiCatalogSystemEnvironmentAssociationsResponse:
      type: object
      properties:
        meta:
          $ref: >-
            #/components/schemas/removeApiCatalogSystemEnvironmentAssociationsMetaData
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/removeApiCatalogSystemEnvironmentAssociationsData
      required:
        - meta
        - data
      title: removeApiCatalogSystemEnvironmentAssociationsResponse
    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
    RemoveApiCatalogSystemEnvironmentAssociationsRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/apiCatalogError'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
      title: RemoveApiCatalogSystemEnvironmentAssociationsRequestBadRequestError
  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": {
    "deleted": 1,
    "notFound": 1
  },
  "data": [
    {
      "workspaceEnvironmentId": "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
      "status": "deleted"
    },
    {
      "workspaceEnvironmentId": "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffb",
      "status": "notFound"
    }
  ]
}
```

**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.delete(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: 'DELETE',
  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("DELETE", 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::Delete.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.delete("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('DELETE', '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.DELETE);
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 = "DELETE"
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()
```

### Remove Associations



**Request**

```json
{
  "workspaceEnvironmentIds": [
    "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
    "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffb"
  ]
}
```

**Response**

```json
{
  "meta": {
    "deleted": 1,
    "notFound": 1
  },
  "data": [
    {
      "workspaceEnvironmentId": "12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619",
      "status": "deleted"
    },
    {
      "workspaceEnvironmentId": "56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffb",
      "status": "notFound"
    }
  ]
}
```

**SDK Code**

```python Remove 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-dacc28577ffb"] }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Associations
const url = 'https://api.getpostman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations';
const options = {
  method: 'DELETE',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"workspaceEnvironmentIds":["12345678-4b076607-09cf-4f9d-8a9a-08c8f3cf4619","56781234-c71c146a-ee75-4e3d-b1c4-dacc28577ffb"]}'
};

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

```go Remove 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-dacc28577ffb\"\n  ]\n}")

	req, _ := http.NewRequest("DELETE", 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 Remove 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::Delete.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-dacc28577ffb\"\n  ]\n}"

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

```java Remove Associations
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("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-dacc28577ffb\"\n  ]\n}")
  .asString();
```

```php Remove Associations
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', '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-dacc28577ffb"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove 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.DELETE);
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-dacc28577ffb\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove 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-dacc28577ffb"]] 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 = "DELETE"
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()
```