Update an assistant
Get an API key to send requests.
Request
Section titled “Request”https://gptunnel.ru/v1/assistant/updateYou can edit your own assistant. An organization owner or administrator can edit assistants in that organization using its API key. A team manager can edit assistants owned by regular employees on their team. Managers cannot edit assistants owned by the organization owner, an administrator, or another manager.
Only the assistant owner can change the API function and MCP settings. Fields omitted from the request keep their current values.
Request headers
| Parameter | Type | Description |
|---|---|---|
Authorization* | string | API key |
Request body
| Parameter | Type | Description |
|---|---|---|
id* | string | Assistant ID from the /v1/assistant/create or /v1/assistant/list response |
mention | string | New assistant code. Changes the page address and the assistantCode value used in chat |
title | string | Name, up to 16 characters |
subtitle | string | Subheading, up to 32 characters |
description | string | Description shown in the catalog |
picture | string | Avatar URL |
instruction | string | System instruction (prompt) |
modelId | string | Text model ID from /v1/models |
temperature | number | Generation temperature, from 0 to 1 |
sqlStore | boolean | Access to the assistant’s own SQLite database (experimental) |
access | object | Privacy and catalog visibility settings. Only the fields you supply are updated. |
database | object | null | Replaces all knowledge base settings. Send null to unlink the knowledge base. |
mcp | Array<object> | Replaces all MCP settings. Send an empty array to disable the MCP server for this assistant. |
apiFunctions | Array<object> | Replaces the entire array of API functions. |
The nested fields in access, database, mcp, and apiFunctions have the same structure as in the create assistant request.
Examples of requests
Section titled “Examples of requests”Set GPTUNNEL_API_KEY to your API key and GPTUNNEL_ASSISTANT_ID to the ID returned when you created your test assistant. This example updates its subtitle.
import jsonimport osfrom urllib.request import Request, urlopen
body = { "id": os.environ['GPTUNNEL_ASSISTANT_ID'], "subtitle": "Updated QA subtitle"}request = Request( 'https://gptunnel.ru/v1/assistant/update', headers={ 'Authorization': os.environ['GPTUNNEL_API_KEY'], 'Content-Type': 'application/json', }, data=json.dumps(body).encode('utf-8'),)with urlopen(request, timeout=60) as response: print(json.load(response))curl --request POST \ --url 'https://gptunnel.ru/v1/assistant/update' \ --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}" \ --header 'Content-Type: application/json' \ --data '{ "id": "'"${GPTUNNEL_ASSISTANT_ID:?Set GPTUNNEL_ASSISTANT_ID}"'", "subtitle": "Updated QA subtitle"}'const response = await fetch('https://gptunnel.ru/v1/assistant/update', { method: 'POST', headers: { Authorization: process.env.GPTUNNEL_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "id": process.env.GPTUNNEL_ASSISTANT_ID, "subtitle": "Updated QA subtitle" }),})if (!response.ok) throw new Error(await response.text())console.log(await response.json())To update the system instruction and make the assistant private, send its id and the two fields shown below.
{ "id": "68c9b2d1e4b0a2d3c4f5e6b8", "instruction": "Новый системный промпт", "access": { "isPrivate": true }}To unlink the knowledge base and disable the MCP server, send the following fields.
{ "id": "68c9b2d1e4b0a2d3c4f5e6b8", "database": null, "mcp": []}Example response
Section titled “Example response”The response contains the updated assistant. An excerpt follows.
{ "object": "assistant", "id": "68c9b2d1e4b0a2d3c4f5e6b8", "mention": "example-assistant", "title": "Помощник", "modelId": "gpt-6-luna", "instruction": "Новый системный промпт", "access": { "isPrivate": true }}The API key owner does not have permission to edit this assistant.
{ "error": { "message": "Not allowed to update this assistant", "type": "invalid_request_error", "param": null, "code": null }}{ "error": { "message": "Assistant not found", "type": "invalid_request_error", "param": null, "code": null }}{ "error": { "message": "Mention 'tax-helper' is already taken", "type": "invalid_request_error", "param": null, "code": "mention_taken" }}