Emend
Schemas

Request Models

Data structures for requests and sessions — retrieving and deleting requests.

Requestmodel

Represents a container for one or more interactions in a session.

PropType
request_idstring
user_idstring
created_atinteger
sourcestring
agent_versionstring
session_idstring
evaluation_onlyboolean
retrieval_experiment_idstring
retrieval_experiment_arm"treatment" | "holdout"
RequestDatamodel

Contains a request with its associated interactions.

PropType
requestRequest
interactionsarray[Interaction]
Sessionmodel

Groups multiple requests by session identifier.

PropType
session_idstring
requestsarray[RequestData]
GetRequestsRequestrequest model

Request model for getting requests grouped by session.

PropType
user_idstring
request_idstring
session_idstring
sourcestring
start_timedatetime
end_timedatetime
top_kinteger
offsetinteger
GetRequestsResponseresponse model

Response model for getting requests.

PropType
successboolean
sessionsarray[Session]
has_moreboolean
msgstring
DeleteRequestRequestrequest model

Request model for deleting a request and all its associated interactions.

PropType
request_idstring
DeleteRequestResponseresponse model

Response model for request deletion requests.

PropType
successboolean
messagestring
DeleteSessionRequestrequest model

Request model for deleting all requests in a session.

PropType
session_idstring
DeleteSessionResponseresponse model

Response model for session deletion requests.

PropType
successboolean
messagestring
deleted_requests_countinteger
SetSessionOutcomeRequestrequest model

Records an optional external success, failure, or unknown outcome for an existing session. The server derives user_id and source from the earliest request ordered by (created_at, request_id); callers cannot override either field.

PropType
session_idstring
outcome"success" | "failure" | "unknown"
occurred_atinteger
labelstring
valuenumber
metadataobject
SetSessionOutcomeResponseresponse model
PropType
successboolean
recordedboolean
reasonSessionOutcomeFailureReason
messagestring
user_idstring
sourcestring
outcome_idstring | null
outcome_revisioninteger | null
outcome_contract_digeststring | null
finalized_trajectory_digeststring | null

For a canonical row, an exact retry must match the caller payload, outcome contract, and canonical trajectory. It returns the same identity fields with success=true and recorded=false. A mismatch returns success=false, recorded=false, and reason="conflicting_finalization"; it does not replace the first outcome.

A rolling-upgrade row whose four identity fields are all null still compares the caller payload and any available server-derived session context, but it cannot compare the absent contract or trajectory digests. An accepted retry preserves all four identity fields as null. A changed payload or available session context returns conflicting_finalization.

SessionOutcomeRecordmodel
PropType
outcome_idstring | null
outcome_revisioninteger | null
user_idstring
session_idstring
outcome"success" | "failure" | "unknown"
occurred_atinteger
sourcestring
labelstring
valuenumber
metadataobject
outcome_contract_digeststring | null
finalized_trajectory_digeststring | null
created_atinteger
Info
For canonical records, the four identity fields are populated together. Legacy rolling-upgrade records may return all four as null and preserve those nulls on retry; a partial identity is invalid.
GetSessionOutcomesRequestrequest model

All supplied filters combine with AND. Results use exact, case-sensitive matches and are ordered by occurred_at DESC, then user_id and session_id ascending.

PropType
session_idsarray[string]
user_idstring
sourcestring
outcome"success" | "failure" | "unknown"
labelstring
start_timeinteger
end_timeinteger
top_kinteger
offsetinteger
GetSessionOutcomesResponseresponse model
PropType
successboolean
session_outcomesarray[SessionOutcomeRecord]
messagestring