> This page is for Postman API Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Remove system environment associations

DELETE https://api.postman.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

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `systemEnvironmentId` (string, required) — The system environment's ID.

### Body (application/json)

This endpoint expects a removeApiCatalogSystemEnvironmentAssociations.

- `workspaceEnvironmentIds` (list of string, required) — A list of workspace environment unique IDs (`userId`-`environmentId`).

## Response

### 200

Successful Response

- `meta` (removeApiCatalogSystemEnvironmentAssociationsMetaData, required) — The response's meta information for paginated results.
- `data` (list of removeApiCatalogSystemEnvironmentAssociationsData, required) — A list of the workspace-environment associations that were removed.

## Errors

### 400 Bad Request Error

Bad Request

- `RemoveApiCatalogSystemEnvironmentAssociationsRequestBadRequestError`
  - Error (Type, Status, Title, Detail, Errors): apiCatalogError
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus

### 401 Unauthorized Error

Unauthorized

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 403 Forbidden Error

Forbidden

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 404 Not Found Error

Not Found

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 500 Internal Server Error

Internal Server Error

- `RemoveApiCatalogSystemEnvironmentAssociationsRequestInternalServerError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

## Types

### removeApiCatalogSystemEnvironmentAssociationsMetaData

The response's meta information for paginated results.

- `deleted` (integer, required) — The number of associations successfully removed.
- `notFound` (integer, required) — The number of environment IDs with no existing association to remove.

### removeApiCatalogSystemEnvironmentAssociationsData

Information about the associated workspace environment.

- `workspaceEnvironmentId` (string, required) — The workspace's environment ID.
- `status` (enum, required) — The status of the operation: - `deleted` — The association was successfully removed. - `notFound` — The association could not be removed.
  - Allowed values: `deleted`, `notFound`

### apiCatalogError

- `type` (string, optional) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `status` (integer, optional) — The HTTP status code generated by the origin server.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — An explanation about the problem.
- `errors` (list of apiCatalogErrorPathMessage, optional) — A list of errors.

### commonErrorTypeTitleDetailStatus

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

### commonErrorTypeTitleDetail

- `type` (string, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (CommonErrorTypeTitleDetailDetail, optional) — Information about the error.

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### apiCatalogErrorPathMessage

Information about the error.

- `path` (string, optional) — The path in which the error occurred.
- `message` (string, optional) — The error message.

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

### CommonErrorNameMessageError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

## Examples

### Successful Response

**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.postman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

headers = {"x-api-key": "<apiKey>"}

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

print(response.json())
```

```javascript Successful Response
const url = 'https://api.postman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations';
const options = {method: 'DELETE', headers: {'x-api-key': '<apiKey>'}};

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.postman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations"

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

	req.Header.Add("x-api-key", "<apiKey>")

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

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.postman.com/api-catalog/system-environments/23b554c1-c30c-483d-bf98-dbe9ab7b88a0/associations")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Successful Response
using RestSharp;

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

```swift Successful Response
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.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.postman.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.postman.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.postman.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.postman.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.postman.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.postman.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.postman.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.postman.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()
```