Get Email Drafts
curl --request POST \
--url https://omnicommerce.ai/api/v1/email/drafts/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "connected-mailbox",
"draftIds": [
"draft-1"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connectionId: 'connected-mailbox', draftIds: ['draft-1']})
};
fetch('https://omnicommerce.ai/api/v1/email/drafts/query', 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/query"
payload = {
"connectionId": "connected-mailbox",
"draftIds": ["draft-1"]
}
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>",
"success": true,
"draftIds": [
"<string>"
],
"succeededCount": 123,
"failedCount": 123,
"results": [
{
"draftId": "<string>",
"success": true,
"code": "draft_not_found",
"error": "<string>",
"draft": {
"draftId": "<string>",
"messageId": "<string>",
"threadId": "<string>",
"subject": "<string>",
"to": "<string>",
"cc": "<string>",
"bcc": "<string>",
"bodyText": "<string>",
"webLink": "<string>",
"isDraft": true
}
}
],
"provider": "gmail",
"emailAddress": "<string>"
}
}Email
Get Email Drafts
Read exact unsent drafts in one connected mailbox. Pass one to twenty draft resource IDs, in request order. Duplicate IDs are read once. The result includes a per-draft outcome for every distinct ID.
Authorization
Requires email:read 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
/
query
Get Email Drafts
curl --request POST \
--url https://omnicommerce.ai/api/v1/email/drafts/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connectionId": "connected-mailbox",
"draftIds": [
"draft-1"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connectionId: 'connected-mailbox', draftIds: ['draft-1']})
};
fetch('https://omnicommerce.ai/api/v1/email/drafts/query', 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/query"
payload = {
"connectionId": "connected-mailbox",
"draftIds": ["draft-1"]
}
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>",
"success": true,
"draftIds": [
"<string>"
],
"succeededCount": 123,
"failedCount": 123,
"results": [
{
"draftId": "<string>",
"success": true,
"code": "draft_not_found",
"error": "<string>",
"draft": {
"draftId": "<string>",
"messageId": "<string>",
"threadId": "<string>",
"subject": "<string>",
"to": "<string>",
"cc": "<string>",
"bcc": "<string>",
"bodyText": "<string>",
"webLink": "<string>",
"isDraft": true
}
}
],
"provider": "gmail",
"emailAddress": "<string>"
}
}Authorizations
Body
application/json