> ## 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.

# Save a New Agent Version — POST /api/v1/update-agent

> Create a new named snapshot of your agent configuration or update an existing version with instructions, chat flow, memory, soul, identity, and user info.

Use this endpoint to create a new named snapshot of your agent's configuration or to overwrite an existing version. You supply all the fields that define how the agent behaves — including its core instructions, chat flow, memory rules, and personality — and Botsify stores them as a discrete, reusable version.

## Request

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

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

### Body Parameters

**bot\_id** `integer` *required*

The unique identifier of the bot you want to save a version for.

**name** `string` *required*

A human-readable label for this version (e.g. `"v2.1 — Holiday Tone"`). Used to identify the version in the dashboard and API responses.

**agent** `string` *required*

The main system-level instructions that define how the agent responds to users.

**chat\_flow** `string` *required*

A serialized definition of the agent's conversation flow, including branching logic and fallback handling.

**memory** `string`

Configuration describing what the agent should retain across turns in a conversation.

**soul** `string`

A description of the agent's personality and tone (e.g. friendly, concise, empathetic).

**identity** `string`

Identity configuration such as the agent's name, role, or brand voice guidelines.

**user\_info** `string`

Rules for how the agent handles and references information about the user during a conversation.

**version\_id** `integer`

When provided alongside `edit: true`, updates the existing version with this ID rather than creating a new one.

**edit** `boolean`

Set to `true` to update an existing version. Must be used together with `version_id`.

## Example — Create a New Version

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/update-agent" \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "bot_id": 42,
    "name": "v3.0 — Spring Campaign",
    "agent": "You are a helpful assistant for Acme Corp. Always be polite and solution-oriented.",
    "chat_flow": "{\"start\": \"greeting\", \"nodes\": [...]}",
    "memory": "Remember the user'\''s name and last product inquiry.",
    "soul": "Warm, professional, and concise.",
    "identity": "Acme Support Bot",
    "user_info": "Greet returning users by name."
  }'
```

## Example — Update an Existing Version

```bash theme={null}
curl --request POST \
  --url "https://app.botsify.com/api/v1/update-agent" \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "bot_id": 42,
    "version_id": 7,
    "edit": true,
    "name": "v3.0 — Spring Campaign (revised)",
    "agent": "You are a helpful assistant for Acme Corp. Prioritize fast resolutions.",
    "chat_flow": "{\"start\": \"greeting\", \"nodes\": [...]}"
  }'
```

## Response

A successful request returns `200 OK` with the saved version object.

```json theme={null}
{
  "version": {
    "id": 15,
    "name": "v3.0 — Spring Campaign",
    "agent": "You are a helpful assistant for Acme Corp. Always be polite and solution-oriented.",
    "chat_flow": "{\"start\": \"greeting\", \"nodes\": [...]}",
    "memory": "Remember the user's name and last product inquiry.",
    "soul": "Warm, professional, and concise.",
    "identity": "Acme Support Bot",
    "user_info": "Greet returning users by name.",
    "is_active": false,
    "created_at": "2024-06-01T09:00:00Z"
  }
}
```


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