Skip to content

Variable: activityRequestSchema

const activityRequestSchema: ZodObject<{ activity: ZodObject<{ attachments: ZodOptional<ZodArray<ZodObject<{ content: ZodObject<{ $schema: ZodString; actions: ZodOptional<…>; body: ZodArray<…>; type: ZodLiteral<…>; version: ZodString; }, $strip>; contentType: ZodLiteral<"application/vnd.microsoft.card.adaptive">; }, $strip>>>; conversation: ZodOptional<ZodObject<{ id: ZodString; }, $strip>>; from: ZodOptional<ZodObject<{ id: ZodString; name: ZodOptional<ZodString>; }, $strip>>; id: ZodOptional<ZodString>; recipient: ZodOptional<ZodObject<{ id: ZodString; name: ZodOptional<ZodString>; }, $strip>>; text: ZodOptional<ZodString>; timestamp: ZodOptional<ZodString>; type: ZodEnum<{ conversationUpdate: "conversationUpdate"; message: "message"; typing: "typing"; }>; }, $loose>; agentId: ZodOptional<ZodString>; model: ZodOptional<ZodString>; }, $strip>

The request body the conversation endpoint accepts: an inbound activity plus optional routing hints that are NOT part of the Bot Framework envelope (which agent to run, which serving model to use). Keeping them as siblings of activity leaves the protocol payload untouched.

  • activity: The inbound Bot Framework activity.
  • activity.type: Activity type; message carries user text.
  • activity.id (optional): Activity id, assigned by the sender.
  • activity.text (optional): Message text, present on a message activity.
  • activity.from (optional): Who sent the activity.
  • activity.from.id: Stable id of the user or bot.
  • activity.from.name (optional): Display name shown in the transcript.
  • activity.recipient (optional): Who the activity is addressed to.
  • activity.recipient.id: Stable id of the user or bot.
  • activity.recipient.name (optional): Display name shown in the transcript.
  • activity.conversation (optional): Conversation the activity belongs to.
  • activity.conversation.id: Conversation id; maps to the agent’s memory thread.
  • activity.attachments (optional): Adaptive Card attachments carried by the activity.
  • activity.timestamp (optional): ISO-8601 time the activity was created.
  • agentId (optional): Mastra agent to answer with. Defaults to the plugin’s default agent.
  • model (optional): Optional serving-endpoint override for this turn.