Create Email Draft
curl --request POST \
--url https://omnicommerce.ai/api/v1/email/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "buyer@example.com",
"subject": "Re: Order 1042",
"body": "Thanks for your order. It ships tomorrow."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: 'buyer@example.com',
subject: 'Re: Order 1042',
body: JSON.stringify('Thanks for your order. It ships tomorrow.')
})
};
fetch('https://omnicommerce.ai/api/v1/email/drafts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/email/drafts"
payload = {
"to": "buyer@example.com",
"subject": "Re: Order 1042",
"body": "Thanks for your order. It ships tomorrow."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"connectionId": "<string>",
"provider": "gmail",
"emailAddress": "<string>",
"draft": {
"draftId": "<string>",
"messageId": "<string>",
"threadId": "<string>",
"webLink": "<string>"
},
"note": "<string>"
}
}Email
Create Email Draft
Save a draft in your mailbox; nothing is sent. Pass replyToMessageId (and threadId) from Search Emails to draft a reply in its conversation. Review and send it from Gmail or Outlook.
When the provider saved a draft whose threading could not be verified, the request fails with unverifiedDraftId in data so you can find or discard it.
Authorization
Requires email:write and the integration permission the matching chat tool needs, with a person’s credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account’s connectionId is refused.
POST
/
api
/
v1
/
email
/
drafts
Create Email Draft
curl --request POST \
--url https://omnicommerce.ai/api/v1/email/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "buyer@example.com",
"subject": "Re: Order 1042",
"body": "Thanks for your order. It ships tomorrow."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: 'buyer@example.com',
subject: 'Re: Order 1042',
body: JSON.stringify('Thanks for your order. It ships tomorrow.')
})
};
fetch('https://omnicommerce.ai/api/v1/email/drafts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/email/drafts"
payload = {
"to": "buyer@example.com",
"subject": "Re: Order 1042",
"body": "Thanks for your order. It ships tomorrow."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"connectionId": "<string>",
"provider": "gmail",
"emailAddress": "<string>",
"draft": {
"draftId": "<string>",
"messageId": "<string>",
"threadId": "<string>",
"webLink": "<string>"
},
"note": "<string>"
}
}Authorizations
Body
application/json