ドキュメント本文へスキップ
API

AI でメールを書く

プロンプトから、あなたが送るメールの文体で書くメール本文。

POST/emails/compose

実際の呼び出しをワークスペースに対して実行します。

POST /emails/compose

プロンプトから、あなたが送るメールの文体で書くメール本文。

例

emails:send が必要です。prompt は指示、下書きのたたき台、またはいくつかのメモです。subject、to、cc は挨拶や口調を合わせる手がかりになり、threadId はそのスレッドを文脈として読んで返信を書き、これには threads:read も必要です。

curl
curl -X POST "$OE/emails/compose" -H "$AUTH" -H "Content-Type: application/json" \  -d '{ "prompt": "Thank Ada for the signed contract and ask for the invoice by Friday.", "to": ["[email protected]"] }'
レスポンス
{  "object": "composition",  "body": "Hi Ada,\n\nThank you for sending the signed contract. Could you send the invoice by Friday?\n\nBest,\nGrace"}

何も保存も送信もされません。本文は POST /emails で送信するか、POST /drafts で保存してください。

呼び出しのたびに AI アクションを 1 回分消費します。その日の分をすべて使い切ったワークスペースには 429 ai_quota_exceeded が返ります。

リファレンス