Variable postAgentMessageSchemaConst
postAgentMessageSchema: ZodObject<
{
patientId: ZodOptional<ZodString>;
externalPatientId: ZodOptional<ZodString>;
text: ZodOptional<ZodString>;
idempotencyKey: ZodOptional<ZodString>;
attachments: ZodOptional<
ZodArray<
ZodObject<
{
stagingKey: ZodString;
fileName: ZodOptional<ZodString>;
mimeType: ZodOptional<ZodString>;
},
$strict,
>,
>,
>;
},
$strict,
> = ...
Body of
POST /v1/agent/messages— a patient turn in the AI agent conversation.The message enters the SAME per-patient pipeline every other channel uses, so it is subject to the same safety layers (moderation, emergency detection, scope classification) and the same escalation rules: if an async consult or telehealth invite is already open for this patient, the message is routed to the human clinician instead of being answered by the agent. Accepted with
202— the reply appears onGET /v1/agent/messagesa few seconds later.At least one of
text/attachmentsis required.