API
Rewrite part of an email with AI
Up to five different versions of a subject or a body.
POST/emails/rewrite
Runs the real call on your workspace.
POST /emails/rewrite
Up to five different versions of a subject or a body.
Example
Needs emails:send. action is shorten, lengthen, rephrase, formal, casual or custom, and custom needs instruction to say what to change. target is body, the default, or subject, and count asks for 1 to 5 versions, 3 by default.
curl -X POST "$OE/emails/rewrite" -H "$AUTH" -H "Content-Type: application/json" \ -d '{ "text": "Hey, did you get a chance to look at the contract?", "action": "formal", "count": 2 }'{ "object": "rewrite", "target": "body", "variations": [ "Hello, I wanted to ask whether you have had a chance to review the contract.", "Good morning. Have you been able to look over the contract yet?" ]}threadId makes the rewrite fit the conversation it replies in, and needs threads:read.
The versions never repeat the original, and each call spends one AI action.