API
AI でメールの一部を書き直す
件名または本文の、最大 5 つの異なる案。
POST/emails/rewrite
実際の呼び出しをワークスペースに対して実行します。
POST /emails/rewrite
件名または本文の、最大 5 つの異なる案。
例
emails:send が必要です。action は shorten、lengthen、rephrase、formal、casual、custom のいずれかで、custom には何を変えるかを伝える instruction が必要です。target は既定の body か subject で、count は求める案の数を 1〜5 で指定し、既定は 3 です。
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 を渡すと返信先の会話に合うように書き直し、これには threads:read が必要です。
案が元の文と同じになることはなく、呼び出しのたびに AI アクションを 1 回分消費します。