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 · headerrequiredPath parameters
session_idstring<uuid>requiredSession id
Request body
requiredapplication/jsondisplay_namestringrequiredEmpty clears the name, which leaves it to an agent holding the
display-name grant.
max length 200
Responses
200The renamed session.
agent_idstring<uuid>requiredagent_version_idstring<uuid>requiredcreated_atstring<date-time>requiredcreated_bySessionCreatorBodyrequiredWho created the session: the header-surface user or the API key a
backend presented.
Show propertiesHide properties
One of:
object
display_namestring | nullrequiredprimary_emailstring | nullrequireduser_idstring<uuid>requiredtypestringrequiredAllowed:
userobject
api_key_idstring<uuid>requiredlabelstringrequiredtypestringrequiredAllowed:
api_keydisplay_namestringrequireddisplay_name_authorDisplayNameAuthorBodyrequiredWho wrote a session's display name.
Allowed:
useragentidstring<uuid>requiredmetadataobjectrequiredThe labels the session was created with, or its root's for a session
an agent spawned.
statusSessionStatusBodyrequiredWhether 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:
idleactiveworkspace_idstring<uuid>required400Malformed body or path parameter, or a display_name over 200 characters.
errorErrorDetailrequiredWhat 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 propertiesHide properties
codeErrorCoderequiredThe 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_requestsinternalmessagestringrequired401Missing, malformed, or invalid bearer token.
errorErrorDetailrequiredWhat 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 propertiesHide properties
codeErrorCoderequiredThe 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_requestsinternalmessagestringrequired403A workspace credential lacking session.manage. A session token may rename only its own session and never lands here.
errorErrorDetailrequiredWhat 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 propertiesHide properties
codeErrorCoderequiredThe 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_requestsinternalmessagestringrequired404No such session, or the caller cannot see it.
errorErrorDetailrequiredWhat 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 propertiesHide properties
codeErrorCoderequiredThe 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_requestsinternalmessagestringrequired