Skip to content

Update an assistant

Get an API key to send requests.

POSThttps://gptunnel.ru/v1/assistant/update

You 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

ParameterTypeDescription
Authorization*stringAPI key

Request body

ParameterTypeDescription
id*stringAssistant ID from the /v1/assistant/create or /v1/assistant/list response
mentionstringNew assistant code. Changes the page address and the assistantCode value used in chat
titlestringName, up to 16 characters
subtitlestringSubheading, up to 32 characters
descriptionstringDescription shown in the catalog
picturestringAvatar URL
instructionstringSystem instruction (prompt)
modelIdstringText model ID from /v1/models
temperaturenumberGeneration temperature, from 0 to 1
sqlStorebooleanAccess to the assistant’s own SQLite database (experimental)
accessobjectPrivacy and catalog visibility settings. Only the fields you supply are updated.
databaseobject | nullReplaces all knowledge base settings. Send null to unlink the knowledge base.
mcpArray<object>Replaces all MCP settings. Send an empty array to disable the MCP server for this assistant.
apiFunctionsArray<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.

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 json
import os
from 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))

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": []
}

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
}
}