Create or send a mailbox draft
curl --request POST \
--url https://connie.ai/api/inbox/drafts/email \
--header 'Content-Type: application/json' \
--header 'Cookie: <api-key>' \
--data '
{
"accountId": "<string>",
"action": "send",
"draftId": "<string>",
"draftData": {
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"body": "<string>"
},
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"body": "<string>",
"replyTo": "<string>"
}
'import requests
url = "https://connie.ai/api/inbox/drafts/email"
payload = {
"accountId": "<string>",
"action": "send",
"draftId": "<string>",
"draftData": {
"to": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"],
"subject": "<string>",
"body": "<string>"
},
"to": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"],
"subject": "<string>",
"body": "<string>",
"replyTo": "<string>"
}
headers = {
"Cookie": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Cookie: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
action: 'send',
draftId: '<string>',
draftData: {
to: ['<string>'],
cc: ['<string>'],
bcc: ['<string>'],
subject: '<string>',
body: JSON.stringify('<string>')
},
to: ['<string>'],
cc: ['<string>'],
bcc: ['<string>'],
subject: '<string>',
body: JSON.stringify('<string>'),
replyTo: '<string>'
})
};
fetch('https://connie.ai/api/inbox/drafts/email', 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://connie.ai/api/inbox/drafts/email",
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([
'accountId' => '<string>',
'action' => 'send',
'draftId' => '<string>',
'draftData' => [
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'subject' => '<string>',
'body' => '<string>'
],
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'subject' => '<string>',
'body' => '<string>',
'replyTo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Cookie: <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://connie.ai/api/inbox/drafts/email"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cookie", "<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://connie.ai/api/inbox/drafts/email")
.header("Cookie", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connie.ai/api/inbox/drafts/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cookie"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"action": "created",
"draftId": "<string>",
"tracking_id": "<string>",
"provider_id": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Drafts
Create or send a mailbox draft
Creates a draft in the mailbox, or with action: send sends an existing mailbox draft. Creating needs accountId, body and at least one to recipient. Sending needs draftId, accountId and draftData with to and body.
POST
/
inbox
/
drafts
/
email
Create or send a mailbox draft
curl --request POST \
--url https://connie.ai/api/inbox/drafts/email \
--header 'Content-Type: application/json' \
--header 'Cookie: <api-key>' \
--data '
{
"accountId": "<string>",
"action": "send",
"draftId": "<string>",
"draftData": {
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"body": "<string>"
},
"to": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
],
"subject": "<string>",
"body": "<string>",
"replyTo": "<string>"
}
'import requests
url = "https://connie.ai/api/inbox/drafts/email"
payload = {
"accountId": "<string>",
"action": "send",
"draftId": "<string>",
"draftData": {
"to": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"],
"subject": "<string>",
"body": "<string>"
},
"to": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"],
"subject": "<string>",
"body": "<string>",
"replyTo": "<string>"
}
headers = {
"Cookie": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Cookie: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
action: 'send',
draftId: '<string>',
draftData: {
to: ['<string>'],
cc: ['<string>'],
bcc: ['<string>'],
subject: '<string>',
body: JSON.stringify('<string>')
},
to: ['<string>'],
cc: ['<string>'],
bcc: ['<string>'],
subject: '<string>',
body: JSON.stringify('<string>'),
replyTo: '<string>'
})
};
fetch('https://connie.ai/api/inbox/drafts/email', 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://connie.ai/api/inbox/drafts/email",
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([
'accountId' => '<string>',
'action' => 'send',
'draftId' => '<string>',
'draftData' => [
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'subject' => '<string>',
'body' => '<string>'
],
'to' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
],
'subject' => '<string>',
'body' => '<string>',
'replyTo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Cookie: <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://connie.ai/api/inbox/drafts/email"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Cookie", "<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://connie.ai/api/inbox/drafts/email")
.header("Cookie", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connie.ai/api/inbox/drafts/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Cookie"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"<string>\",\n \"action\": \"send\",\n \"draftId\": \"<string>\",\n \"draftData\": {\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n },\n \"to\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ],\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"replyTo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"action": "created",
"draftId": "<string>",
"tracking_id": "<string>",
"provider_id": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
The full Cookie header copied from a signed-in connie.ai browser request. See the Authentication page.
Query Parameters
Your workspace ID. Also accepted as workspace_id, the x-workspace-id header, or workspaceId in a JSON body. If you leave it out, the request silently runs against the first workspace you joined.
Body
application/json
Omit to create a draft.
Available options:
send Required with action: send.
Required with action: send.
Show child attributes
Show child attributes
ID of the message the draft replies to.