Open or resume the system session
POST/sessions/system
Returns the deployment's one system session, creating it the first time, and starts no turn. The system session runs the system agent in the control agent space, in a directory under the controller's state directory that no client can open with POST /sessions/open. It takes no request body and no X-Session-ID header; the response carries the session ID in its body and in the X-Session-ID response header.
Send the system session messages over the WebSocket with system set. Its agent space cannot be changed with POST /session/reconfigure.
While PEEN_SYSTEM_AGENT is off this returns 403 SYSTEM_AGENT_OFF and creates nothing.
Responses
- 200
- 401
- 403
- 406
- 500
The system session, and whether this call created it.
Response Headers
The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.
The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.
PEEN_API_TOKEN is set and the request's bearer token is missing or wrong. code is UNAUTHORIZED. A deployment with no token never returns this.
The deployment does not allow what the request names. code is WORKSPACE_NOT_ALLOWED for a workspace outside every workspace root, a workspace file path that is not a clean relative path inside the workspace, or a file operation on the system session; AGENT_SPACE_NOT_ALLOWED for an agent space the deployment does not offer or a move of the system session; and SYSTEM_AGENT_OFF for a system session while PEEN_SYSTEM_AGENT is off.
The request's Accept header allows neither application/json nor */*, and every response is JSON. code is BAD_REQUEST and message is unsupported response representation. Omit Accept or send application/json.
An unexpected server failure. code is INTERNAL_SERVER_ERROR and message is internal server error. The controller log has the details under the response's X-Request-ID.