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

# Delete Sub-Agent From Parent

> Remove a sub-agent assignment from a parent agent.



## OpenAPI

````yaml /api-reference/openapi.json delete /api/parent_agents/{parent_agent_id}/sub_agents/{agent_group_id}
openapi: 3.1.0
info:
  title: Maadify API
  description: Public and admin API endpoints for Maadify.
  version: 1.0.0
servers:
  - url: https://app.maadify.com
    description: Production
security: []
tags:
  - name: Parent agents
    description: Create, update, and configure parent agents.
  - name: Sub-agents
    description: Create sub-agents and assign them to parent agents.
  - name: Tools
    description: Search tools and manage tool assignments.
  - name: Prompt templates
    description: Search and manage prompt templates.
  - name: Users
    description: Search users available to the authenticated tenant.
  - name: Models
    description: Search available LLM models.
  - name: Files
    description: Check file upload status.
paths:
  /api/parent_agents/{parent_agent_id}/sub_agents/{agent_group_id}:
    delete:
      tags:
        - Sub-agents
      summary: Delete Sub-Agent From Parent
      description: Remove a sub-agent assignment from a parent agent.
      operationId: >-
        delete_sub_agent_from_parent_endpoint_api_parent_agents__parent_agent_id__sub_agents__agent_group_id__delete
      parameters:
        - name: parent_agent_id
          in: path
          required: true
          schema:
            type: integer
            title: Parent Agent Id
        - name: agent_group_id
          in: path
          required: true
          schema:
            type: integer
            title: Agent Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentGroupMutationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    AgentGroupMutationResponse:
      properties:
        success:
          type: boolean
          title: Success
          description: Whether the request was successful.
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Type of error if the request failed.
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message or informational message.
        data:
          $ref: '#/components/schemas/AgentGroupMutationData'
          description: Parent-agent sub-agent assignment mutation results.
      type: object
      required:
        - success
        - data
      title: AgentGroupMutationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentGroupMutationData:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AgentGroupMutationItem'
          type: array
          title: Items
          description: Created or deleted parent-agent sub-agent assignment rows.
      type: object
      title: AgentGroupMutationData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AgentGroupMutationItem:
      properties:
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
          description: Agent group link ID.
        parent_agent_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Parent Agent Id
          description: Parent agent ID.
        sub_agent_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sub Agent Id
          description: Sub-agent ID.
        parent_agent_type_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Type Key
          description: Parent Agent Type key at the time of assignment.
        agent_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Key
          description: Parent agent action key at the time of assignment.
        parent_agent_tenant:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Agent Tenant
          description: Parent agent tenant ID at the time of assignment.
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
          description: Creation timestamp.
      additionalProperties: true
      type: object
      title: AgentGroupMutationItem
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````