---
title: "Update a brain"
description: "Update a brain's name, description, emoji, usage hint, visibility or\nskills. Omitted fields are left as they are."
---

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

Path: AI Gateway API › Brains

`PATCH /brains/{brain_id}`

Update a brain's name, description, emoji, usage hint, visibility or
skills. Omitted fields are left as they are.

## Authentication

- `HTTPBearer`, http, header `Authorization`

## Path parameters

- `brain_id` (`update_brain.path.brain_id`; string, required)
  - format `uuid`

## Header parameters

- `X-On-Behalf-Of` (`update_brain.header.X-On-Behalf-Of`; any of, optional)
  - any of: `string`, `null`
- `X-External-User-Id` (`update_brain.header.X-External-User-Id`; any of, optional)
  - any of: `string`, `null`
- `X-App-Id` (`update_brain.header.X-App-Id`; any of, optional)
  - any of: `string`, `null`

## Request body

_Required._

- `name` (`update_brain.name`; any of, optional)
  - any of: `string`, `null`
- `description` (`update_brain.description`; any of, optional)
  - any of: `string`, `null`
- `emoji` (`update_brain.emoji`; any of, optional)
  - any of: `string`, `null`
- `usage_hint` (`update_brain.usage_hint`; any of, optional)
  - any of: `string`, `null`
- `visibility` (`update_brain.visibility`; any of, optional)
  - any of: `string`, `null`
- `skill_ids` (`update_brain.skill_ids`; any of, optional)
  - any of: `array<string>`, `null`

## Example request

```json
{
  "name": "string",
  "description": "string",
  "emoji": "string",
  "usage_hint": "string",
  "visibility": "private",
  "skill_ids": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://truememory-api.mvstg.com/brains/<brain_id>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "description": "string",
  "emoji": "string",
  "usage_hint": "string",
  "visibility": "private",
  "skill_ids": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://truememory-api.mvstg.com/brains/<brain_id>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    description: 'string',
    emoji: 'string',
    usage_hint: 'string',
    visibility: 'private',
    skill_ids: ['497f6eca-6276-4993-bfeb-53cbbbba6f08']
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://truememory-api.mvstg.com/brains/<brain_id>"

payload = {
    "name": "string",
    "description": "string",
    "emoji": "string",
    "usage_hint": "string",
    "visibility": "private",
    "skill_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Successful Response

#### Example

```json
{
  "id": "string",
  "user_id": "string",
  "app_id": "string",
  "name": "string",
  "description": "string",
  "emoji": "string",
  "usage_hint": "string",
  "visibility": "private",
  "skills": [
    {
      "id": "string",
      "key": "string",
      "name": "string"
    }
  ],
  "document_count": 0,
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "skill_ids": [
    "string"
  ]
}
```

- `id` (`update_brain.response.200.id`; string, required)
- `user_id` (`update_brain.response.200.user_id`; any of, required)
  - any of: `string`, `null`
- `app_id` (`update_brain.response.200.app_id`; any of, required)
  - any of: `string`, `null`
- `name` (`update_brain.response.200.name`; string, required)
- `description` (`update_brain.response.200.description`; any of, required)
  - any of: `string`, `null`
- `created_at` (`update_brain.response.200.created_at`; string, required)
  - format `date-time`
- `updated_at` (`update_brain.response.200.updated_at`; string, required)
  - format `date-time`
- `skill_ids` (`update_brain.response.200.skill_ids`; array<string>, required) — Ids of ``skills``, for clients that only need to seed a multi-select. Derived rather than stored so it cannot disagree with ``skills``.
- `emoji` (`update_brain.response.200.emoji`; any of, optional)
  - any of: `string`, `null`
- `usage_hint` (`update_brain.response.200.usage_hint`; any of, optional)
  - any of: `string`, `null`
- `visibility` (`update_brain.response.200.visibility`; string, optional)
  - one of `"private"`, `"app"`, `"public"`; default `"private"`
- `skills` (`update_brain.response.200.skills`; array<object>, optional)
  - `id` (`update_brain.response.200.skills.id`; string, required)
  - `key` (`update_brain.response.200.skills.key`; string, required)
  - `name` (`update_brain.response.200.skills.name`; string, required)
- `document_count` (`update_brain.response.200.document_count`; integer, optional)
  - default `0`

### 422

Validation Error

#### Example

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

- `detail` (`update_brain.response.422.detail`; array<object>, optional)
  - `loc` (`update_brain.response.422.detail.loc`; array<any of>, required)
    - any of: `string`, `integer`
  - `msg` (`update_brain.response.422.detail.msg`; string, required)
  - `type` (`update_brain.response.422.detail.type`; string, required)
  - `input` (`update_brain.response.422.detail.input`; unknown, optional)
  - `ctx` (`update_brain.response.422.detail.ctx`; object, optional)


Source: https://truememory-docs.mvstg.com/api/brains/update/index.md
