Report a notice to a session
POST/session/notices
Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by X-Session-ID. The notice is stored with source api, sent to live clients as a notice.created feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.
delivery decides when the model sees it:
queue(the default) delivers it at the session's next turn or tool boundary.wakealso starts a turn when the session is idle and a handler for the notice'stypeexists at.agents/events/<type>.mdin a harness layer. A handler that sets its owndeliveryoverrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.
Errors:
- 400
VALIDATION_FAILED: the body is missing or malformed;typeis not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters;typestarts with a reserved prefix (job.,agent.,turn.);summaryis empty or longer thanPEEN_MAX_EVENT_SUMMARY_BYTES(default 4096 bytes); ordataencodes to more thanPEEN_MAX_EVENT_DATA_BYTES(default 65536 bytes). - 404
SESSION_NOT_FOUND: the session does not exist.
Request
Responses
- 202
- 400
- 401
- 404
- 406
- 500
The notice was recorded. The body is the stored notice.
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.
The request is invalid. code is VALIDATION_FAILED for a bad parameter, body field, page bound, base64 value or file size, or a body that is not one JSON value or exceeds the body limit, and INVALID_SESSION_ID for a malformed X-Session-ID header.
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 session, or the record the request names inside it, does not exist. code is SESSION_NOT_FOUND when no session has the X-Session-ID ID, on every operation. It is NOT_FOUND when the session exists but the record the request names inside it does not, and the message names what is missing, such as job not found. It is WORKSPACE_NOT_FOUND when an opened workspace directory no longer exists.
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.