> ## 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 an agent knowledge source

> Detach a Brain source from the agent. Idempotent; detaching a source that is not attached answers with `detached` set to `false`.



## OpenAPI

````yaml delete /agents/{agent_id}/knowledge-sources/{connector_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}/knowledge-sources/{connector_id}:
    delete:
      tags:
        - Agents
      summary: Detach an agent knowledge source
      description: >-
        Detach a Brain source from the agent. Idempotent; detaching a source
        that is not attached answers with `detached` set to `false`.
      operationId: detachAgentKnowledgeSource
      parameters:
        - in: path
          name: agent_id
          required: true
          schema:
            type: string
          description: ID of a custom agent.
        - in: path
          name: connector_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The detach result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent_id:
                    type: string
                  connector_id:
                    type: string
                  detached:
                    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/knowledge-sources/PFqdAMir8PA2Xc6qcszSN9'
            \
              -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_knowledge_source("abc123DEFghiJKL",
            "PFqdAMir8PA2Xc6qcszSN9")
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.

````