---
docId: doc_6cbeb2e452684441b7c01a76872268bc
title: Unlink a subagent
description: "Removes a subagent link from the parent’s draft without deleting the subagent."
api:
  group: agentes/subagentes
  auth: bearer
  operations:
    - operationId: removeSubagentLink
      method: DELETE
      path: '/v1/agents/{agentId}/draft/subagents/{childId}'
      postmanName: Unlink a subagent
---

<script>
  import { Ways } from '$lib/components';
</script>

# Unlink a subagent

Remove a subagent from the parent’s draft by specifying its `childId` in the URL. [Publish the parent](/api-reference/agents/publications/publish) to stop using it. The subagent is preserved and stays linked to its other parents.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/agents/$AGENT_ID/draft/subagents/$CHILD_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.subagents.unlink("agent_123", "agent_456");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Parent agent id | ✓ |
| `childId` | string | Subagent id | ✓ |

## Response

`200 OK`. The fields are those from [Update the draft](/api-reference/agents/drafts/update#response):

```json
{
  "status": "success",
  "data": {
    "changed": true,
    "draft": { "versionId": "v7", "number": 7 },
    "version": {
      "versionId": "v7",
      "number": 7,
      "basedOnVersionId": "v6",
      "restoredFromVersionId": null,
      "copiedFrom": null,
      "createdAt": "2026-10-28T12:14:00.000Z",
      "createdBy": { "kind": "api_key", "keyId": "k3yId" },
      "source": "api",
      "via": null,
      "note": ""
    }
  }
}
```

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `403` | `FORBIDDEN` | The credential can't edit the parent agent |
| `404` | `AGENT_NOT_FOUND` | The parent agent doesn't exist in the workspace or was deleted |
| `409` | `CONFLICT` | Someone else changed this at the same time. Try again |

## Notes

- Removing the link creates a version of the parent and **doesn't publish**: the published parent keeps using the subagent until you [publish](/api-reference/agents/publications/publish) that version.
- If the subagent wasn't linked, it answers `changed: false` without creating a version.
- This operation takes no body, so the new version ends up with an empty note.
- To turn a link off without removing it, use [Link a subagent](/api-reference/agents/subagents/link) with `"enabled": false`.
