Skip to content

Preview the inbox AI summary (Gmail and Apple Mail) using the customer AI key

POST
/v1/brands/{brand}/ai/inbox-preview
curl --request POST \
--url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/ai/inbox-preview \
--header 'Content-Type: application/json' \
--data '{ "document": { "additionalProperty": "example" }, "htmlOverride": "example", "subject": "example", "preheader": "example", "opening": "example", "senderName": "example" }'
brand
required
string
/^brd_[a-z0-9]{26}$/

Example

brd_01hx0000000000000000000000
Media typeapplication/json
object
document

M5 document (schemaVersion 1)

object
key
additional properties
nullable
htmlOverride

HTML mode: replaces the block design

string
nullable <= 500000 characters
subject
string
nullable <= 998 characters /^[^\x00-\x1f\x7f]*$/
preheader
string
nullable <= 500 characters /^[^\x00-\x1f\x7f]*$/
opening

Suggested opening lines that were applied: they are prepended to the text before summarizing

string
nullable <= 300 characters /^[^\x00-\x1f\x7f]*$/
senderName

Sender name; defaults to the brand name

string
nullable <= 200 characters /^[^\x00-\x1f\x7f]*$/

Example generated

{
"document": {
"additionalProperty": "example"
},
"htmlOverride": "example",
"subject": "example",
"preheader": "example",
"opening": "example",
"senderName": "example"
}

Simulated summary

Media typeapplication/json
object
gmail
required
object
summary
required
string
bullets
required
Array<string>
apple
required
object
summary
required
string
suggestions
required

Suggested subjects, preheaders and opening lines; apply them by sending them back in subject, preheader and opening

object
subjects
required
Array<string>
preheaders
required
Array<string>
openings
required
Array<string>
provider
required
string
Allowed values: anthropic openai google
model
required
string
modelFellBack
required
boolean
truncated
required

The email text exceeded the limit and was truncated before summarizing

boolean
approximate
required

Simulation using the customer model: Gmail and Apple do not publish how they summarize

boolean

Example

{
"provider": "anthropic",
"approximate": true
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

No session, expired session, or invalid, expired or revoked API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Does not exist or is not visible to you

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Conflict

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Too many attempts

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Service temporarily unavailable

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}