Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview

Rename a session

The name becomes the caller’s: an agent whose display-name grant reads until_user_edits stops renaming the session, unless the name is empty. A session_display_name_changed event announces it on the session’s log.

PATCH/v1/sessions/{session_id}
Authorization
AuthorizationBearer token · headerrequired
Path parameters
session_idstring<uuid>required
Session id
Request body
requiredapplication/json
display_namestringrequired
Empty clears the name, which leaves it to an agent holding the display-name grant.
max length 200
Responses
200The renamed session.
agent_idstring<uuid>required
agent_version_idstring<uuid>required
created_atstring<date-time>required
created_bySessionCreatorBodyrequired
Who created the session: the header-surface user or the API key a backend presented.
Show properties
One of:
object
display_namestring | nullrequired
primary_emailstring | nullrequired
user_idstring<uuid>required
typestringrequired
Allowed:user
object
api_key_idstring<uuid>required
labelstringrequired
typestringrequired
Allowed:api_key
display_namestringrequired
display_name_authorDisplayNameAuthorBodyrequired
Who wrote a session's display name.
Allowed:useragent
idstring<uuid>required
metadataobjectrequired
The labels the session was created with, or its root's for a session an agent spawned.
statusSessionStatusBodyrequired
Whether a run is under way. Input is accepted either way: it starts a run when the session is `idle` and steers the live one when it is `active`.
Allowed:idleactive
workspace_idstring<uuid>required
400Malformed body or path parameter, or a display_name over 200 characters.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403A workspace credential lacking session.manage. A session token may rename only its own session and never lands here.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such session, or the caller cannot see it.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PATCH "https://api.us.cloud.subako.ai/v1/sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "display_name": "string"
}'
Response
{
  "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",
  "agent_version_id": "1c2a713c-7248-4a56-a9eb-0bdcb3a41741",
  "created_at": "2019-08-24T14:15:22Z",
  "created_by": {
    "display_name": "string",
    "primary_email": "string",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "type": "user"
  },
  "display_name": "string",
  "display_name_author": "user",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "status": "idle",
  "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}