# Unlink a tool from an agent

> DELETE https://api.nabrah.ai/api/ext/tool/unlink/{link_id}

Group: Tools. Page: https://www.nabrah.ai/en/docs/api-reference/tools/unlink-a-tool-from-an-agent

Remove the link between a tool and an agent, so the agent can no longer call that tool. This deletes only the link, not the tool or the agent themselves — both remain in the project and any other links are unaffected. Identified by the link_id path parameter and authenticated with your API key.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Path parameters

- `link_id` (string, required): The ID of the tool-agent link to remove. This is the link_id returned by POST /api/ext/tool/link, and also appears as link_id in GET /api/ext/tool/{tool_id}/agents and GET /api/ext/tool/agent/{agent_id}.

## Response

### 200 Successful Response

Content type: `application/json`

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.nabrah.ai/api/ext/tool/unlink/<link_id>' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/tool/unlink/<link_id>"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.delete(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/tool/unlink/<link_id>", {
  method: "DELETE",
  headers: { "X-API-Key": "<your-api-key>" },
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

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

func main() {
	req, _ := http.NewRequest("DELETE", "https://api.nabrah.ai/api/ext/tool/unlink/<link_id>", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
