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

# Delete a ruleset assignment

DELETE https://api.postman.com/rulesets/{rulesetId}/assignments

Unassigns a ruleset from a governance group.

Reference: https://learning.postman.com/api-docs/api-reference/api-governance/delete-ruleset-assignment

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

- `rulesetId` (string, required) — The ruleset's ID.

### Query parameters

- `targetType` (enum, required) — The assignment target type. Currently only `governance_group` is supported.
  - Allowed values: `governance_group`
- `targetId` (string, required) — The target governance group's ID.

## Response

### 200

Deleted

## Errors

### 400 Bad Request Error

Bad Request

- `DeleteRulesetAssignmentRequestBadRequestError`

### 401 Unauthorized Error

Unauthorized

- `DeleteRulesetAssignmentRequestUnauthorizedError`

### 403 Forbidden Error

Forbidden

- `DeleteRulesetAssignmentRequestForbiddenError`

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

- `DeleteRulesetAssignmentRequestInternalServerError`

## Types

### commonErrorTypeTitleDetail

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

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

### commonErrorNameMessageDetails

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

### commonErrorNameMessage

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

### CommonErrorTypeTitleDetailStatusType

The type of error.

### CommonErrorTypeTitleDetailDetail

Information about the error.

### CommonErrorNameMessageDetailsError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.
- `details` (CommonErrorNameMessageDetailsErrorDetails, optional) — Information about the error.

### CommonErrorNameMessageError

Information about the error.

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

### CommonErrorNameMessageDetailsErrorDetails

Information about the error.

## Examples

**Response**

```json
{}
```

**SDK Code**

```python Ruleset Assignment Deleted
import requests

url = "https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments"

querystring = {"targetId":"01JWSGROUP0123456789ABCDEF","targetType":"governance_group"}

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

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

print(response.json())
```

```javascript Ruleset Assignment Deleted
const url = 'https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group';
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 Ruleset Assignment Deleted
package main

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

func main() {

	url := "https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group"

	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 Ruleset Assignment Deleted
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group")

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 Ruleset Assignment Deleted
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Ruleset Assignment Deleted
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Ruleset Assignment Deleted
using RestSharp;

var client = new RestClient("https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Ruleset Assignment Deleted
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/rulesets/01JABCDEF0123456789ABCDEFG/assignments?targetId=01JWSGROUP0123456789ABCDEF&targetType=governance_group")! 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()
```