Create draft
curl --request POST \
--url https://api.cx.stax.ai/inbox/draft \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": true,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": true,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": [
"<string>"
],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": [
"<string>"
],
"draft": true,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": true,
"message_folders": [
"<string>"
],
"outbox": true,
"private": true,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": true,
"responses": [
"<string>"
],
"safe_for_everyone": true,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": true,
"send_failed": true,
"send_scheduled": true,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": [
"<string>"
],
"tags": [
"<string>"
],
"tasks": [
"<string>"
],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.cx.stax.ai/inbox/draft"
payload = {
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": True,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": True,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": ["<string>"],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": ["<string>"],
"draft": True,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": True,
"message_folders": ["<string>"],
"outbox": True,
"private": True,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": True,
"responses": ["<string>"],
"safe_for_everyone": True,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": True,
"send_failed": True,
"send_scheduled": True,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": ["<string>"],
"tags": ["<string>"],
"tasks": ["<string>"],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
attachments: [
{
content_id: '<string>',
file: '<string>',
filename: '<string>',
isInline: true,
size: 123,
source_id: '<string>',
url: '<string>'
}
],
bcc: '<string>',
bookmark: true,
brief: '<string>',
cc: '<string>',
checksum: '<string>',
clients: ['<string>'],
created_at: '<string>',
date: '<string>',
deleted_at: '<string>',
domains: ['<string>'],
draft: true,
from: '<string>',
html: '<string>',
importance: 123,
in_reply_to: '<string>',
internal: true,
message_folders: ['<string>'],
outbox: true,
private: true,
read: '<string>',
references: '<string>',
reply: '<string>',
requires_response: true,
responses: ['<string>'],
safe_for_everyone: true,
schedule_id: '<string>',
schedule_send_at: '<string>',
secure: true,
send_failed: true,
send_scheduled: true,
send_state: '<string>',
sentiment: 123,
source: '<string>',
source_history_id: '<string>',
source_id: '<string>',
subject: '<string>',
summary: ['<string>'],
tags: ['<string>'],
tasks: ['<string>'],
team: '<string>',
text: '<string>',
thread: '<string>',
to: '<string>',
unique_key: '<string>',
user: '<string>'
})
};
fetch('https://api.cx.stax.ai/inbox/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cx.stax.ai/inbox/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'attachments' => [
[
'content_id' => '<string>',
'file' => '<string>',
'filename' => '<string>',
'isInline' => true,
'size' => 123,
'source_id' => '<string>',
'url' => '<string>'
]
],
'bcc' => '<string>',
'bookmark' => true,
'brief' => '<string>',
'cc' => '<string>',
'checksum' => '<string>',
'clients' => [
'<string>'
],
'created_at' => '<string>',
'date' => '<string>',
'deleted_at' => '<string>',
'domains' => [
'<string>'
],
'draft' => true,
'from' => '<string>',
'html' => '<string>',
'importance' => 123,
'in_reply_to' => '<string>',
'internal' => true,
'message_folders' => [
'<string>'
],
'outbox' => true,
'private' => true,
'read' => '<string>',
'references' => '<string>',
'reply' => '<string>',
'requires_response' => true,
'responses' => [
'<string>'
],
'safe_for_everyone' => true,
'schedule_id' => '<string>',
'schedule_send_at' => '<string>',
'secure' => true,
'send_failed' => true,
'send_scheduled' => true,
'send_state' => '<string>',
'sentiment' => 123,
'source' => '<string>',
'source_history_id' => '<string>',
'source_id' => '<string>',
'subject' => '<string>',
'summary' => [
'<string>'
],
'tags' => [
'<string>'
],
'tasks' => [
'<string>'
],
'team' => '<string>',
'text' => '<string>',
'thread' => '<string>',
'to' => '<string>',
'unique_key' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/inbox/draft"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cx.stax.ai/inbox/draft")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/inbox/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>"
}{}{}{}Inbox
Create draft
Create a new email draft message. The draft will be assigned a unique thread ID if not provided, and will be marked as unread initially.
POST
/
inbox
/
draft
Create draft
curl --request POST \
--url https://api.cx.stax.ai/inbox/draft \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": true,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": true,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": [
"<string>"
],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": [
"<string>"
],
"draft": true,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": true,
"message_folders": [
"<string>"
],
"outbox": true,
"private": true,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": true,
"responses": [
"<string>"
],
"safe_for_everyone": true,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": true,
"send_failed": true,
"send_scheduled": true,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": [
"<string>"
],
"tags": [
"<string>"
],
"tasks": [
"<string>"
],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
'import requests
url = "https://api.cx.stax.ai/inbox/draft"
payload = {
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": True,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": True,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": ["<string>"],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": ["<string>"],
"draft": True,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": True,
"message_folders": ["<string>"],
"outbox": True,
"private": True,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": True,
"responses": ["<string>"],
"safe_for_everyone": True,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": True,
"send_failed": True,
"send_scheduled": True,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": ["<string>"],
"tags": ["<string>"],
"tasks": ["<string>"],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
_id: '<string>',
attachments: [
{
content_id: '<string>',
file: '<string>',
filename: '<string>',
isInline: true,
size: 123,
source_id: '<string>',
url: '<string>'
}
],
bcc: '<string>',
bookmark: true,
brief: '<string>',
cc: '<string>',
checksum: '<string>',
clients: ['<string>'],
created_at: '<string>',
date: '<string>',
deleted_at: '<string>',
domains: ['<string>'],
draft: true,
from: '<string>',
html: '<string>',
importance: 123,
in_reply_to: '<string>',
internal: true,
message_folders: ['<string>'],
outbox: true,
private: true,
read: '<string>',
references: '<string>',
reply: '<string>',
requires_response: true,
responses: ['<string>'],
safe_for_everyone: true,
schedule_id: '<string>',
schedule_send_at: '<string>',
secure: true,
send_failed: true,
send_scheduled: true,
send_state: '<string>',
sentiment: 123,
source: '<string>',
source_history_id: '<string>',
source_id: '<string>',
subject: '<string>',
summary: ['<string>'],
tags: ['<string>'],
tasks: ['<string>'],
team: '<string>',
text: '<string>',
thread: '<string>',
to: '<string>',
unique_key: '<string>',
user: '<string>'
})
};
fetch('https://api.cx.stax.ai/inbox/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cx.stax.ai/inbox/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'_id' => '<string>',
'attachments' => [
[
'content_id' => '<string>',
'file' => '<string>',
'filename' => '<string>',
'isInline' => true,
'size' => 123,
'source_id' => '<string>',
'url' => '<string>'
]
],
'bcc' => '<string>',
'bookmark' => true,
'brief' => '<string>',
'cc' => '<string>',
'checksum' => '<string>',
'clients' => [
'<string>'
],
'created_at' => '<string>',
'date' => '<string>',
'deleted_at' => '<string>',
'domains' => [
'<string>'
],
'draft' => true,
'from' => '<string>',
'html' => '<string>',
'importance' => 123,
'in_reply_to' => '<string>',
'internal' => true,
'message_folders' => [
'<string>'
],
'outbox' => true,
'private' => true,
'read' => '<string>',
'references' => '<string>',
'reply' => '<string>',
'requires_response' => true,
'responses' => [
'<string>'
],
'safe_for_everyone' => true,
'schedule_id' => '<string>',
'schedule_send_at' => '<string>',
'secure' => true,
'send_failed' => true,
'send_scheduled' => true,
'send_state' => '<string>',
'sentiment' => 123,
'source' => '<string>',
'source_history_id' => '<string>',
'source_id' => '<string>',
'subject' => '<string>',
'summary' => [
'<string>'
],
'tags' => [
'<string>'
],
'tasks' => [
'<string>'
],
'team' => '<string>',
'text' => '<string>',
'thread' => '<string>',
'to' => '<string>',
'unique_key' => '<string>',
'user' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/inbox/draft"
payload := strings.NewReader("{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cx.stax.ai/inbox/draft")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/inbox/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"_id\": \"<string>\",\n \"attachments\": [\n {\n \"content_id\": \"<string>\",\n \"file\": \"<string>\",\n \"filename\": \"<string>\",\n \"isInline\": true,\n \"size\": 123,\n \"source_id\": \"<string>\",\n \"url\": \"<string>\"\n }\n ],\n \"bcc\": \"<string>\",\n \"bookmark\": true,\n \"brief\": \"<string>\",\n \"cc\": \"<string>\",\n \"checksum\": \"<string>\",\n \"clients\": [\n \"<string>\"\n ],\n \"created_at\": \"<string>\",\n \"date\": \"<string>\",\n \"deleted_at\": \"<string>\",\n \"domains\": [\n \"<string>\"\n ],\n \"draft\": true,\n \"from\": \"<string>\",\n \"html\": \"<string>\",\n \"importance\": 123,\n \"in_reply_to\": \"<string>\",\n \"internal\": true,\n \"message_folders\": [\n \"<string>\"\n ],\n \"outbox\": true,\n \"private\": true,\n \"read\": \"<string>\",\n \"references\": \"<string>\",\n \"reply\": \"<string>\",\n \"requires_response\": true,\n \"responses\": [\n \"<string>\"\n ],\n \"safe_for_everyone\": true,\n \"schedule_id\": \"<string>\",\n \"schedule_send_at\": \"<string>\",\n \"secure\": true,\n \"send_failed\": true,\n \"send_scheduled\": true,\n \"send_state\": \"<string>\",\n \"sentiment\": 123,\n \"source\": \"<string>\",\n \"source_history_id\": \"<string>\",\n \"source_id\": \"<string>\",\n \"subject\": \"<string>\",\n \"summary\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"tasks\": [\n \"<string>\"\n ],\n \"team\": \"<string>\",\n \"text\": \"<string>\",\n \"thread\": \"<string>\",\n \"to\": \"<string>\",\n \"unique_key\": \"<string>\",\n \"user\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "<string>"
}{}{}{}Authorizations
Body
application/json
Draft message data (to field is required)
MessageFolders references the folders catalog rows this message belongs to
(by their local ObjectID) — the per-mailbox equivalent of Tags (which is a
team-wide label system). Each catalog row carries the provider's external_id;
storing the local _id keeps renames free and gives referential integrity.
Gmail = multi-label, Outlook = single-folder; the array models both.