Create a new task
curl --request POST \
--url https://api.vida.dev/api/v2/tasks \
--header 'Content-Type: application/json' \
--data '
{
"type": "email",
"target": "person@example.com",
"message": "<p>Hello <strong>there</strong>.</p>",
"context": "Follow-up task context",
"greeting": "Hello from a task",
"waitToGreet": true,
"accountId": 1234,
"scheduledFor": 1712350000,
"meta": {
"email": {
"subject": "Follow-up from Vida",
"attachments": [
{
"filename": "report.pdf",
"type": "application/pdf",
"content": "BASE64_CONTENT",
"disposition": "attachment"
}
]
}
}
}
'import requests
url = "https://api.vida.dev/api/v2/tasks"
payload = {
"type": "email",
"target": "person@example.com",
"message": "<p>Hello <strong>there</strong>.</p>",
"context": "Follow-up task context",
"greeting": "Hello from a task",
"waitToGreet": True,
"accountId": 1234,
"scheduledFor": 1712350000,
"meta": { "email": {
"subject": "Follow-up from Vida",
"attachments": [
{
"filename": "report.pdf",
"type": "application/pdf",
"content": "BASE64_CONTENT",
"disposition": "attachment"
}
]
} }
}
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({
type: 'email',
target: 'person@example.com',
message: '<p>Hello <strong>there</strong>.</p>',
context: 'Follow-up task context',
greeting: 'Hello from a task',
waitToGreet: true,
accountId: 1234,
scheduledFor: 1712350000,
meta: {
email: {
subject: 'Follow-up from Vida',
attachments: [
{
filename: 'report.pdf',
type: 'application/pdf',
content: 'BASE64_CONTENT',
disposition: 'attachment'
}
]
}
}
})
};
fetch('https://api.vida.dev/api/v2/tasks', 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/tasks",
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([
'type' => 'email',
'target' => 'person@example.com',
'message' => '<p>Hello <strong>there</strong>.</p>',
'context' => 'Follow-up task context',
'greeting' => 'Hello from a task',
'waitToGreet' => true,
'accountId' => 1234,
'scheduledFor' => 1712350000,
'meta' => [
'email' => [
'subject' => 'Follow-up from Vida',
'attachments' => [
[
'filename' => 'report.pdf',
'type' => 'application/pdf',
'content' => 'BASE64_CONTENT',
'disposition' => 'attachment'
]
]
]
]
]),
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/tasks"
payload := strings.NewReader("{\n \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\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/tasks")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/tasks")
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 \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyTasks
Create a new task
Submit a new task (call, text, email, ping). For call/text/email tasks, target is required. Email tasks use message for the body, support raw HTML, and may include meta.email.subject plus SendGrid-style meta.email.attachments.
POST
/
api
/
v2
/
tasks
Create a new task
curl --request POST \
--url https://api.vida.dev/api/v2/tasks \
--header 'Content-Type: application/json' \
--data '
{
"type": "email",
"target": "person@example.com",
"message": "<p>Hello <strong>there</strong>.</p>",
"context": "Follow-up task context",
"greeting": "Hello from a task",
"waitToGreet": true,
"accountId": 1234,
"scheduledFor": 1712350000,
"meta": {
"email": {
"subject": "Follow-up from Vida",
"attachments": [
{
"filename": "report.pdf",
"type": "application/pdf",
"content": "BASE64_CONTENT",
"disposition": "attachment"
}
]
}
}
}
'import requests
url = "https://api.vida.dev/api/v2/tasks"
payload = {
"type": "email",
"target": "person@example.com",
"message": "<p>Hello <strong>there</strong>.</p>",
"context": "Follow-up task context",
"greeting": "Hello from a task",
"waitToGreet": True,
"accountId": 1234,
"scheduledFor": 1712350000,
"meta": { "email": {
"subject": "Follow-up from Vida",
"attachments": [
{
"filename": "report.pdf",
"type": "application/pdf",
"content": "BASE64_CONTENT",
"disposition": "attachment"
}
]
} }
}
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({
type: 'email',
target: 'person@example.com',
message: '<p>Hello <strong>there</strong>.</p>',
context: 'Follow-up task context',
greeting: 'Hello from a task',
waitToGreet: true,
accountId: 1234,
scheduledFor: 1712350000,
meta: {
email: {
subject: 'Follow-up from Vida',
attachments: [
{
filename: 'report.pdf',
type: 'application/pdf',
content: 'BASE64_CONTENT',
disposition: 'attachment'
}
]
}
}
})
};
fetch('https://api.vida.dev/api/v2/tasks', 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/tasks",
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([
'type' => 'email',
'target' => 'person@example.com',
'message' => '<p>Hello <strong>there</strong>.</p>',
'context' => 'Follow-up task context',
'greeting' => 'Hello from a task',
'waitToGreet' => true,
'accountId' => 1234,
'scheduledFor' => 1712350000,
'meta' => [
'email' => [
'subject' => 'Follow-up from Vida',
'attachments' => [
[
'filename' => 'report.pdf',
'type' => 'application/pdf',
'content' => 'BASE64_CONTENT',
'disposition' => 'attachment'
]
]
]
]
]),
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/tasks"
payload := strings.NewReader("{\n \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\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/tasks")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vida.dev/api/v2/tasks")
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 \"type\": \"email\",\n \"target\": \"person@example.com\",\n \"message\": \"<p>Hello <strong>there</strong>.</p>\",\n \"context\": \"Follow-up task context\",\n \"greeting\": \"Hello from a task\",\n \"waitToGreet\": true,\n \"accountId\": 1234,\n \"scheduledFor\": 1712350000,\n \"meta\": {\n \"email\": {\n \"subject\": \"Follow-up from Vida\",\n \"attachments\": [\n {\n \"filename\": \"report.pdf\",\n \"type\": \"application/pdf\",\n \"content\": \"BASE64_CONTENT\",\n \"disposition\": \"attachment\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Example:
"email"
Example:
"person@example.com"
Example:
"<p>Hello <strong>there</strong>.</p>"
Example:
"Follow-up task context"
Example:
"Hello from a task"
Example:
true
Example:
1234
Example:
1712350000
Optional task metadata. Call tasks may use bridgeAfterAnswer with destination and optional monitor to bridge the answered target to another number.
Example:
{
"email": {
"subject": "Follow-up from Vida",
"attachments": [
{
"filename": "report.pdf",
"type": "application/pdf",
"content": "BASE64_CONTENT",
"disposition": "attachment"
}
]
}
}
Response
Task created successfully
⌘I