curl --request POST \
--url 'https://api.vida.dev/api/v2/agent/outboundEmail?token=' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"target": "person@example.com",
"to": "<unknown>",
"cc": "<unknown>",
"bcc": "<unknown>",
"subject": "<string>",
"attachments": "<array>",
"context": "<string>",
"taskContext": "<string>",
"accountId": 123,
"agentId": 123,
"roomId": "<string>",
"replyToMessageUuid": "<string>",
"scheduledFor": 123,
"meta": {},
"externalTaskId": "<string>"
}
'import requests
url = "https://api.vida.dev/api/v2/agent/outboundEmail?token="
payload = {
"content": "<string>",
"target": "person@example.com",
"to": "<unknown>",
"cc": "<unknown>",
"bcc": "<unknown>",
"subject": "<string>",
"attachments": "<array>",
"context": "<string>",
"taskContext": "<string>",
"accountId": 123,
"agentId": 123,
"roomId": "<string>",
"replyToMessageUuid": "<string>",
"scheduledFor": 123,
"meta": {},
"externalTaskId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
target: 'person@example.com',
to: '<unknown>',
cc: '<unknown>',
bcc: '<unknown>',
subject: '<string>',
attachments: '<array>',
context: '<string>',
taskContext: '<string>',
accountId: 123,
agentId: 123,
roomId: '<string>',
replyToMessageUuid: '<string>',
scheduledFor: 123,
meta: {},
externalTaskId: '<string>'
})
};
fetch('https://api.vida.dev/api/v2/agent/outboundEmail?token=', 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.vida.dev/api/v2/agent/outboundEmail?token=",
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([
'content' => '<string>',
'target' => 'person@example.com',
'to' => '<unknown>',
'cc' => '<unknown>',
'bcc' => '<unknown>',
'subject' => '<string>',
'attachments' => '<array>',
'context' => '<string>',
'taskContext' => '<string>',
'accountId' => 123,
'agentId' => 123,
'roomId' => '<string>',
'replyToMessageUuid' => '<string>',
'scheduledFor' => 123,
'meta' => [
],
'externalTaskId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.vida.dev/api/v2/agent/outboundEmail?token="
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.vida.dev/api/v2/agent/outboundEmail?token=")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/agent/outboundEmail?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyQueue outbound email(s) from your Agent
Queues email tasks for agent accounts with operator email enabled. Pass “target” or “to”/“cc”/“bcc” for one email. Use “targets” only to enqueue multiple separate emails.
curl --request POST \
--url 'https://api.vida.dev/api/v2/agent/outboundEmail?token=' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"target": "person@example.com",
"to": "<unknown>",
"cc": "<unknown>",
"bcc": "<unknown>",
"subject": "<string>",
"attachments": "<array>",
"context": "<string>",
"taskContext": "<string>",
"accountId": 123,
"agentId": 123,
"roomId": "<string>",
"replyToMessageUuid": "<string>",
"scheduledFor": 123,
"meta": {},
"externalTaskId": "<string>"
}
'import requests
url = "https://api.vida.dev/api/v2/agent/outboundEmail?token="
payload = {
"content": "<string>",
"target": "person@example.com",
"to": "<unknown>",
"cc": "<unknown>",
"bcc": "<unknown>",
"subject": "<string>",
"attachments": "<array>",
"context": "<string>",
"taskContext": "<string>",
"accountId": 123,
"agentId": 123,
"roomId": "<string>",
"replyToMessageUuid": "<string>",
"scheduledFor": 123,
"meta": {},
"externalTaskId": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
target: 'person@example.com',
to: '<unknown>',
cc: '<unknown>',
bcc: '<unknown>',
subject: '<string>',
attachments: '<array>',
context: '<string>',
taskContext: '<string>',
accountId: 123,
agentId: 123,
roomId: '<string>',
replyToMessageUuid: '<string>',
scheduledFor: 123,
meta: {},
externalTaskId: '<string>'
})
};
fetch('https://api.vida.dev/api/v2/agent/outboundEmail?token=', 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.vida.dev/api/v2/agent/outboundEmail?token=",
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([
'content' => '<string>',
'target' => 'person@example.com',
'to' => '<unknown>',
'cc' => '<unknown>',
'bcc' => '<unknown>',
'subject' => '<string>',
'attachments' => '<array>',
'context' => '<string>',
'taskContext' => '<string>',
'accountId' => 123,
'agentId' => 123,
'roomId' => '<string>',
'replyToMessageUuid' => '<string>',
'scheduledFor' => 123,
'meta' => [
],
'externalTaskId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.vida.dev/api/v2/agent/outboundEmail?token="
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.vida.dev/api/v2/agent/outboundEmail?token=")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/agent/outboundEmail?token=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"target\": \"person@example.com\",\n \"to\": \"<unknown>\",\n \"cc\": \"<unknown>\",\n \"bcc\": \"<unknown>\",\n \"subject\": \"<string>\",\n \"attachments\": \"<array>\",\n \"context\": \"<string>\",\n \"taskContext\": \"<string>\",\n \"accountId\": 123,\n \"agentId\": 123,\n \"roomId\": \"<string>\",\n \"replyToMessageUuid\": \"<string>\",\n \"scheduledFor\": 123,\n \"meta\": {},\n \"externalTaskId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Vida API Token
Body
- Option 1
- Option 2
Email body. Raw HTML is supported.
Destination email address
"person@example.com"
Destination email address or array of destination email addresses for one email
CC email address or array of CC email addresses for one email
BCC email address or array of BCC email addresses for one email
Email subject line
SendGrid-style attachment objects with base64 content
Optional context for the task
Task-specific context
Optional agent account id override
Optional campaign id override
Room id when replying to an existing email message
Email message uuid to reply to; used with roomId for thread headers
Unix seconds to schedule delivery
Optional metadata
Optional customer-provided identifier applied to created task(s)
Response
Queued successfully