curl --request POST \
--url https://api.talqing.com/v1/email/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_email": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"recipients": [
{
"input": {}
}
],
"timezone": "<string>",
"body_format": "text",
"draft_attempts": 1,
"draft_concurrency": 5,
"draft_gap_seconds": 0,
"draft_retry_after_minutes": 30,
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_name": "<string>",
"reply_to": "<string>",
"send_attempts": 3,
"send_daily_cap": {
"kind": "fixed",
"limit": 200
},
"send_gap_seconds": 1,
"send_retry_after_minutes": 30,
"start_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}
'import requests
url = "https://api.talqing.com/v1/email/batches"
payload = {
"from_email": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"recipients": [{ "input": {} }],
"timezone": "<string>",
"body_format": "text",
"draft_attempts": 1,
"draft_concurrency": 5,
"draft_gap_seconds": 0,
"draft_retry_after_minutes": 30,
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_name": "<string>",
"reply_to": "<string>",
"send_attempts": 3,
"send_daily_cap": {
"kind": "fixed",
"limit": 200
},
"send_gap_seconds": 1,
"send_retry_after_minutes": 30,
"start_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"window": {
"end": "<string>",
"start": "<string>",
"days": [1, 2, 3, 4, 5, 6, 7]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_email: '<string>',
integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
recipients: [{input: {}}],
timezone: '<string>',
body_format: 'text',
draft_attempts: 1,
draft_concurrency: 5,
draft_gap_seconds: 0,
draft_retry_after_minutes: 30,
field_map: {body: JSON.stringify('<string>'), subject: '<string>', to: '<string>'},
from_name: '<string>',
reply_to: '<string>',
send_attempts: 3,
send_daily_cap: {kind: 'fixed', limit: 200},
send_gap_seconds: 1,
send_retry_after_minutes: 30,
start_at: '2023-11-07T05:31:56Z',
task_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template: {body: JSON.stringify('<string>'), subject: '<string>', to: '<string>'},
window: {end: '<string>', start: '<string>', days: [1, 2, 3, 4, 5, 6, 7]}
})
};
fetch('https://api.talqing.com/v1/email/batches', 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.talqing.com/v1/email/batches",
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([
'from_email' => '<string>',
'integration_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'recipients' => [
[
'input' => [
]
]
],
'timezone' => '<string>',
'body_format' => 'text',
'draft_attempts' => 1,
'draft_concurrency' => 5,
'draft_gap_seconds' => 0,
'draft_retry_after_minutes' => 30,
'field_map' => [
'body' => '<string>',
'subject' => '<string>',
'to' => '<string>'
],
'from_name' => '<string>',
'reply_to' => '<string>',
'send_attempts' => 3,
'send_daily_cap' => [
'kind' => 'fixed',
'limit' => 200
],
'send_gap_seconds' => 1,
'send_retry_after_minutes' => 30,
'start_at' => '2023-11-07T05:31:56Z',
'task_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'template' => [
'body' => '<string>',
'subject' => '<string>',
'to' => '<string>'
],
'window' => [
'end' => '<string>',
'start' => '<string>',
'days' => [
1,
2,
3,
4,
5,
6,
7
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.talqing.com/v1/email/batches"
payload := strings.NewReader("{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.talqing.com/v1/email/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/email/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"body_format": "text",
"counts": {
"canceled": 123,
"draft": 123,
"draft_failed": 123,
"drafting": 123,
"pending": 123,
"queued": 123,
"send_failed": 123,
"sending": 123,
"sent": 123,
"skipped": 123,
"total": 123
},
"created_at": "2023-11-07T05:31:56Z",
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_failures": [
{
"count": 123,
"reason": "<string>"
}
],
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"drafted_at": "2023-11-07T05:31:56Z",
"drafted_versions": [
{
"count": 123,
"version": 123
}
],
"failure_reason": "<string>",
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_email": "<string>",
"from_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_columns": [
"<string>"
],
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integration_name": "<string>",
"name": "<string>",
"next_draft_at": "2023-11-07T05:31:56Z",
"next_draft_reason": "start",
"output_columns": [
"<string>"
],
"provider_cost": 123,
"published_task_version": 123,
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_daily_cap_today": 123,
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"sent_today": 123,
"skips": {
"duplicate_recipient": 123,
"operator": 123,
"unfillable": 123
},
"stale_redraftable": 123,
"stale_sent": 123,
"start_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Create Email Batch
Create an email batch: a list, what writes each email, and a connected Resend account to send from.
Two ways to write the email. task_id + field_map: an agent task drafts
every row. Or template (to, subject, body): a fixed email where
{{column}} takes that row’s cell, HTML-escaped when body_format is html.
A template batch is born drafted with no drafting and no cost; a row with a
blank placeholder cell is draft_failed until the cell is filled.
Read your provider’s terms first. Resend’s Acceptable Use Policy prohibits unsolicited mail of any kind — cold outreach, purchased lists, scraped contacts — and this runs on your account under your agreement.
Nothing is sent that a person has not selected. Creating a batch only starts drafting; sending is a separate call that creates a send you can schedule, pace, pause and cancel.
For a task batch, every row runs the task’s CURRENT published version, re-read every pass, so publishing a better prompt mid-batch changes every row drafted after it.
field_map points to, subject and body at a column of your list or at
a field the task produces. A row where a mapped column the task does not
write is blank is skipped at once (unfillable) and never drafted. window
is when email may LEAVE, inherited by every send; drafting is not restricted
by hours. An invalid batch is a 400 listing every problem.
There is no spend cap: every row runs the task and is billed, so a 5 000-row batch doing research costs 5 000 task runs whether or not anything is sent.
curl --request POST \
--url https://api.talqing.com/v1/email/batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_email": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"recipients": [
{
"input": {}
}
],
"timezone": "<string>",
"body_format": "text",
"draft_attempts": 1,
"draft_concurrency": 5,
"draft_gap_seconds": 0,
"draft_retry_after_minutes": 30,
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_name": "<string>",
"reply_to": "<string>",
"send_attempts": 3,
"send_daily_cap": {
"kind": "fixed",
"limit": 200
},
"send_gap_seconds": 1,
"send_retry_after_minutes": 30,
"start_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}
'import requests
url = "https://api.talqing.com/v1/email/batches"
payload = {
"from_email": "<string>",
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"recipients": [{ "input": {} }],
"timezone": "<string>",
"body_format": "text",
"draft_attempts": 1,
"draft_concurrency": 5,
"draft_gap_seconds": 0,
"draft_retry_after_minutes": 30,
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_name": "<string>",
"reply_to": "<string>",
"send_attempts": 3,
"send_daily_cap": {
"kind": "fixed",
"limit": 200
},
"send_gap_seconds": 1,
"send_retry_after_minutes": 30,
"start_at": "2023-11-07T05:31:56Z",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"window": {
"end": "<string>",
"start": "<string>",
"days": [1, 2, 3, 4, 5, 6, 7]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from_email: '<string>',
integration_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
recipients: [{input: {}}],
timezone: '<string>',
body_format: 'text',
draft_attempts: 1,
draft_concurrency: 5,
draft_gap_seconds: 0,
draft_retry_after_minutes: 30,
field_map: {body: JSON.stringify('<string>'), subject: '<string>', to: '<string>'},
from_name: '<string>',
reply_to: '<string>',
send_attempts: 3,
send_daily_cap: {kind: 'fixed', limit: 200},
send_gap_seconds: 1,
send_retry_after_minutes: 30,
start_at: '2023-11-07T05:31:56Z',
task_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template: {body: JSON.stringify('<string>'), subject: '<string>', to: '<string>'},
window: {end: '<string>', start: '<string>', days: [1, 2, 3, 4, 5, 6, 7]}
})
};
fetch('https://api.talqing.com/v1/email/batches', 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.talqing.com/v1/email/batches",
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([
'from_email' => '<string>',
'integration_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'recipients' => [
[
'input' => [
]
]
],
'timezone' => '<string>',
'body_format' => 'text',
'draft_attempts' => 1,
'draft_concurrency' => 5,
'draft_gap_seconds' => 0,
'draft_retry_after_minutes' => 30,
'field_map' => [
'body' => '<string>',
'subject' => '<string>',
'to' => '<string>'
],
'from_name' => '<string>',
'reply_to' => '<string>',
'send_attempts' => 3,
'send_daily_cap' => [
'kind' => 'fixed',
'limit' => 200
],
'send_gap_seconds' => 1,
'send_retry_after_minutes' => 30,
'start_at' => '2023-11-07T05:31:56Z',
'task_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'template' => [
'body' => '<string>',
'subject' => '<string>',
'to' => '<string>'
],
'window' => [
'end' => '<string>',
'start' => '<string>',
'days' => [
1,
2,
3,
4,
5,
6,
7
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.talqing.com/v1/email/batches"
payload := strings.NewReader("{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.talqing.com/v1/email/batches")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.talqing.com/v1/email/batches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_email\": \"<string>\",\n \"integration_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"recipients\": [\n {\n \"input\": {}\n }\n ],\n \"timezone\": \"<string>\",\n \"body_format\": \"text\",\n \"draft_attempts\": 1,\n \"draft_concurrency\": 5,\n \"draft_gap_seconds\": 0,\n \"draft_retry_after_minutes\": 30,\n \"field_map\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"from_name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 3,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 200\n },\n \"send_gap_seconds\": 1,\n \"send_retry_after_minutes\": 30,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"task_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": {\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"to\": \"<string>\"\n },\n \"window\": {\n \"end\": \"<string>\",\n \"start\": \"<string>\",\n \"days\": [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"body_format": "text",
"counts": {
"canceled": 123,
"draft": 123,
"draft_failed": 123,
"drafting": 123,
"pending": 123,
"queued": 123,
"send_failed": 123,
"sending": 123,
"sent": 123,
"skipped": 123,
"total": 123
},
"created_at": "2023-11-07T05:31:56Z",
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_failures": [
{
"count": 123,
"reason": "<string>"
}
],
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"drafted_at": "2023-11-07T05:31:56Z",
"drafted_versions": [
{
"count": 123,
"version": 123
}
],
"failure_reason": "<string>",
"field_map": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"from_email": "<string>",
"from_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_columns": [
"<string>"
],
"integration_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"integration_name": "<string>",
"name": "<string>",
"next_draft_at": "2023-11-07T05:31:56Z",
"next_draft_reason": "start",
"output_columns": [
"<string>"
],
"provider_cost": 123,
"published_task_version": 123,
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_daily_cap_today": 123,
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"sent_today": 123,
"skips": {
"duplicate_recipient": 123,
"operator": 123,
"unfillable": 123
},
"stale_redraftable": 123,
"stale_sent": 123,
"start_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"status": "scheduled",
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"template": {
"body": "<string>",
"subject": "<string>",
"to": "<string>"
},
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Each email is written either by an agent task (task_id + field_map) or by
a fixed template filled from the row's columns.
The default sending address. Its domain must be verified on that Resend account; a send may override this for its own rows alone.
A connected Resend account.
1 - 2001 - 10000 elementsShow child attributes
Show child attributes
text, html 1 <= x <= 51 <= x <= 10Minimum seconds between STARTING two rows. 0 starts each as a slot frees; raise it when the task calls something that rate-limits.
0 <= x <= 36005 <= x <= 1440With task_id only.
Show child attributes
Show child attributes
2001 <= x <= 5The same limit every day.
- FixedDailyCap
- RampDailyCap
Show child attributes
Show child attributes
Minimum seconds between STARTING two emails. 60 means one a minute.
1 <= x <= 36005 <= x <= 1440The agent task that drafts each row.
Instead of a task: no drafting, every row is ready at once.
Show child attributes
Show child attributes
When email may LEAVE. Inherited by every send this batch creates.
Show child attributes
Show child attributes
Response
Successful Response
text, html Rows by the status a reader sees. draft is drafts no live send covers
yet; queued is drafts one does.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Which column in the merged space carries each of the three sent fields.
A value may name a CSV header or an output field of the task — that is the whole point of the merged space, and it is what makes "the CSV has emails" and "feed it a phone number and let the task find the email" the same feature.
Show child attributes
Show child attributes
start, retry The same limit every day.
- FixedDailyCap
- RampDailyCap
Show child attributes
Show child attributes
counts.skipped, by who decided it.
Show child attributes
Show child attributes
scheduled, drafting, paused, drafted, canceled, failed A fixed email, filled per row: {{column}} in subject or body takes that row's cell.
Show child attributes
Show child attributes
The hours a list may run in, on the list's own clock.
Shared rather than duplicated, for the same reason window_state is: a
call batch and an email send run store the same three values under the same
names and must not each get their own copy of the rules. The field that
carries one is named for what it gates — calling_window on a campaign,
window on an email batch and its runs.
A window that crosses midnight (21:00-06:00) is valid and means
exactly what an evening consumer-calling window means: the day check applies
to the start side, so 21:00-06:00 on days: [5] runs Friday
21:00 through Saturday 06:00.
Show child attributes
Show child attributes