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

# DELETE /v1/agents/{id}/prompts/{section}

> Remove one section from an agent's prompt.

Takes the section out of the agent's prompt. **Its version history stays**, so removing a section is not the same as losing what it said — you can still read it and [restore it](/dev/endpoints/agents-prompt-version-restore).

## Endpoint

```
DELETE https://api.keebai.com/v1/agents/{id}/prompts/{section}
```

## Required scope

`agents:write`

## Path parameters

| Parameter | Type     | Description              |
| --------- | -------- | ------------------------ |
| `id`      | `string` | `ObjectId` of the agent. |
| `section` | `string` | Section type to remove.  |

## Example request

```bash curl theme={"system"}
curl -X DELETE https://api.keebai.com/v1/agents/6650a1b2c3d4e5f6a7b8c9d0/prompts/discard_rules \
  -H "Authorization: Bearer kbai_pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

## Response

### 200 OK

Returns the agent without that section.

### 401 Unauthorized

Missing, invalid, revoked, or expired token.

### 403 Forbidden

The token does not have the `agents:write` scope.

### 404 Not Found

No agent with that id in the token's company and project.

### 502 Bad Gateway

The agent service is unreachable.

## Operational notes

* **Removing a section the agent did not have succeeds.** It is idempotent: the end state is what you asked for.
* **An empty section and a missing section behave the same to the agent.** If you only want to blank it, [writing an empty string](/dev/endpoints/agents-prompt-set) keeps the row and its label.


## OpenAPI

````yaml DELETE /v1/agents/{id}/prompts/{section}
openapi: 3.0.0
info:
  title: Keebai Public API
  description: Superficie pública REST autenticada con Personal Access Tokens (PAT).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.keebai.com
    description: Production
security: []
tags: []
paths:
  /v1/agents/{id}/prompts/{section}:
    delete:
      tags:
        - agents
      summary: Borrar una seccion del prompt
      description: Saca la seccion del prompt del agente. Su historial de versiones queda.
      operationId: PublicAgentsController_removePrompt
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: section
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicAgentEnvelopeDto'
      security:
        - PAT: []
components:
  schemas:
    PublicAgentEnvelopeDto:
      type: object
      properties:
        agent:
          $ref: '#/components/schemas/PublicAgentDto'
      required:
        - agent
    PublicAgentDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        avatar_url:
          type: string
        model:
          type: string
        voice_response_enabled:
          type: boolean
          description: Indica si la respuesta de voz está habilitada.
        created_at:
          type: string
      required:
        - id
        - name
        - model
        - voice_response_enabled
  securitySchemes:
    PAT:
      scheme: bearer
      bearerFormat: kbai_pk_<hex>
      type: http
      description: >-
        Personal Access Token con prefijo `kbai_pk_`. Generar desde el portal
        con permiso `developer.manage_tokens`.

````