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

# Unassign Agent

> Removes an agent from the workspace. Removes client permissions from all agent campaigns, chats, and prospects. Agency plan required.

<Note>
  **Agency Plan Required** - This endpoint is only available for teams on the Agency plan.
</Note>

## Endpoint

```
DELETE https://api.kakiyo.com/v1/workspaces/:workspaceId/agents/:agentId
```

## Path Parameters

| Parameter     | Type   | Required | Description              |
| ------------- | ------ | -------- | ------------------------ |
| `workspaceId` | string | Yes      | The workspace ID         |
| `agentId`     | string | Yes      | The agent ID to unassign |

## Response

```json theme={null}
{
  "message": "Agent unassigned from workspace",
  "agentId": "69724b7100331796aae2",
  "propagated": {
    "campaigns": 5,
    "chats": 150,
    "prospects": 150
  }
}
```

## Example Request

```bash theme={null}
curl -X DELETE "https://api.kakiyo.com/v1/workspaces/69724d900007cfde1d88/agents/69724b7100331796aae2" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

The agent is not deleted, only unassigned. Client permissions are automatically removed from all associated campaigns, chats, and prospects.


## OpenAPI

````yaml DELETE /workspaces/{id}/agents/{agentId}
openapi: 3.1.0
info:
  title: Kakiyo API
  description: API for automating LinkedIn outreach campaigns with AI-powered conversations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.kakiyo.com/v1
security:
  - bearerAuth: []
paths:
  /workspaces/{id}/agents/{agentId}:
    delete:
      tags:
        - Workspaces
      summary: Unassign Agent
      description: >-
        Removes an agent from the workspace. Removes client permissions from all
        agent campaigns, chats, and prospects. Agency plan required.
      operationId: unassignAgent
      parameters:
        - name: id
          in: path
          required: true
          description: Workspace ID
          schema:
            type: string
        - name: agentId
          in: path
          required: true
          description: Agent ID to unassign
          schema:
            type: string
      responses:
        '200':
          description: Agent unassigned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Agent unassigned from workspace
                  agentId:
                    type: string
                    example: agent_abc123
                  propagated:
                    type: object
                    properties:
                      campaigns:
                        type: integer
                        example: 5
                      chats:
                        type: integer
                        example: 150
                      prospects:
                        type: integer
                        example: 150
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Agent or workspace does not belong to this team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent or workspace not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          example: validation_error
        message:
          type: string
          example: The request parameters failed validation
        details:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                example: name
              message:
                type: string
                example: The name field is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````