Skip to main content

Structured output schemas

MailSlurp AI transforms convert emails, attachments, and SMS messages into structured data using AI models. You can define schemas for the data you want to extract and AI models were return data in that shape. This data can be stored in tables in MailSlurp, fetched by API, or sent to your system via webhooks or custom sync destinations like Google Sheets, Notion, or Airtable.

Output schema

MailSlurp uses a subset of the OpenAPI Schema types to define a response your AI analysis should use. Define properties and expected values in your schema and AI will use these as instructions and fill the values.

Example response types

Say you want a response for an invoice that can be modelled like so:

Loading...

You can define a corresponding schema for this type like so:

Loading...

Defining schemas with prompts

Defining schemas in visual editor

Defining schemas in code