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

# Patch Instruction Section — POST /api/v1/update-instruction

> Update a single instruction field (agent, memory, soul, identity, or user_info) on an existing agent version without replacing the whole version.

Use this endpoint when you need to update just one section of an agent's configuration — for example, refining the agent's memory rules or adjusting its soul — without having to resend every other field. This is a targeted patch operation: only the field you specify is overwritten; all other configuration fields remain unchanged.

## Request

**`POST https://app.botsify.com/api/v1/update-instruction`**

**Authorization:** Bearer token — include your token in the `Authorization: Bearer <token>` header.

### Body Parameters

<ParamField body="bot_id" type="integer" required>
  The unique identifier of the bot whose version you want to patch.
</ParamField>

<ParamField body="field" type="string" required>
  The name of the instruction field to update. Must be one of:

  * `agent` — the main system instructions
  * `memory` — memory/retention configuration
  * `soul` — personality and tone description
  * `identity` — identity and brand voice settings
  * `user_info` — user context handling rules
</ParamField>

<ParamField body="content" type="string">
  The new content to write into the specified `field`. If omitted or empty, the field is cleared.
</ParamField>

<ParamField body="version_id" type="integer">
  The ID of the version to patch. When omitted, the patch is applied to the currently active version.
</ParamField>

## Example — Patch the Soul Field on a Specific Version

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/update-instruction" \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "bot_id": 42,
    "version_id": 12,
    "field": "soul",
    "content": "Empathetic, concise, and always solution-focused."
  }'
```

## Example — Patch the Active Version

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/update-instruction" \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "bot_id": 42,
    "field": "memory",
    "content": "Retain the user'\''s preferred language and last topic discussed."
  }'
```

## Response

A successful request returns `200 OK` with the updated version object, reflecting only the changed field.

```json theme={null}
{
  "version": {
    "id": 12,
    "name": "v2.0 — Tone Update",
    "agent": "You are a friendly support assistant...",
    "chat_flow": "...",
    "memory": "Retain the user's preferred language and last topic discussed.",
    "soul": "Empathetic, concise, and always solution-focused.",
    "identity": null,
    "user_info": null,
    "is_active": true,
    "updated_at": "2024-06-10T11:30:00Z"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.