Passer au contenu principal
PATCH
/
agent-sessions
/
{session_id}
Mettre à jour une session d'agent
import requests

url = "https://app.ubik-agent.com/api/v1/agent-sessions/{session_id}"

payload = {
    "title": "<string>",
    "tool_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
    "model_name": "<string>",
    "status": "<string>",
    "external_user_id": "<string>"
}
headers = {
    "X-API-KEY": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "title": "<string>",
  "model_name": "<string>",
  "external_user_id": "<string>",
  "active_tools": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>"
    }
  ],
  "documents": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "status": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "file_type": "<string>",
      "processing_pipeline": "<string>",
      "error_message": "<string>",
      "is_starred": false
    }
  ]
}

Autorisations

X-API-KEY
string
header
requis

En-têtes

X-End-User-ID
string | null

Paramètres de chemin

session_id
string<uuid>
requis

Corps

application/json
title
string | null

New title for the session.

tool_ids
string<uuid>[] | null

List of tool IDs to enable for this session. Replaces existing tools.

model_name
string | null

Model to use for this session.

status
string | null

Status of the session.

external_user_id
string | null

The external user ID associated with this session.

Réponse

Successful Response

id
string<uuid>
requis

Unique identifier for the session.

status
string
requis

Current status (e.g., 'active', 'completed').

created_at
string<date-time>
requis

Creation timestamp.

updated_at
string<date-time>
requis

Last update timestamp.

title
string | null

Title of the session.

model_name
string | null

Model being used.

external_user_id
string | null

The external user ID associated with this session, if any.

active_tools
PublicToolListItem · object[]

List of tools enabled for this session.

documents
PublicSessionDocumentListItem · object[]

List of documents linked to this session.