> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gumloop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Detach a subagent

> Stop the agent delegating to `subagent_id`. Idempotent.



## OpenAPI

````yaml delete /agents/{agent_id}/subagents/{subagent_id}
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /agents/{agent_id}/subagents/{subagent_id}:
    delete:
      tags:
        - Agents
      summary: Detach a subagent
      description: Stop the agent delegating to `subagent_id`. Idempotent.
      operationId: detachAgentSubagent
      parameters:
        - in: path
          name: agent_id
          required: true
          schema:
            type: string
          description: ID of a custom agent.
        - in: path
          name: subagent_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The allowed subagents after the change.
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent_id:
                    type: string
                  subagent_ids:
                    type: array
                    items:
                      type: string
                  changed:
                    type: boolean
        '400':
          description: '`agent_not_customizable` — platform agents cannot be configured.'
        '401':
          description: Unauthorized — missing or invalid API key.
        '403':
          description: Forbidden — the caller does not have update access to this agent.
        '404':
          description: Agent not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl -X DELETE
            'https://api.gumloop.com/api/v1/agents/abc123DEFghiJKL/subagents/xyz789MNOpqrSTU'
            \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
        - lang: python
          label: Python
          source: |
            from gumloop import Gumloop

            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")

            client.agents.detach_subagent("abc123DEFghiJKL", "xyz789MNOpqrSTU")
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````