curl --request PATCH \
--url https://api.talqing.com/v1/email/batches/{batch_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"from_email": "<string>",
"from_name": "<string>",
"name": "<string>",
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"start_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}
'import requests
url = "https://api.talqing.com/v1/email/batches/{batch_id}"
payload = {
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"from_email": "<string>",
"from_name": "<string>",
"name": "<string>",
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"start_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [1, 2, 3, 4, 5, 6, 7]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
draft_attempts: 123,
draft_concurrency: 123,
draft_gap_seconds: 123,
draft_retry_after_minutes: 123,
from_email: '<string>',
from_name: '<string>',
name: '<string>',
reply_to: '<string>',
send_attempts: 123,
send_daily_cap: {kind: 'fixed', limit: 2},
send_gap_seconds: 123,
send_retry_after_minutes: 123,
start_at: '2023-11-07T05:31:56Z',
timezone: '<string>',
window: {end: '<string>', start: '<string>', days: [1, 2, 3, 4, 5, 6, 7]}
})
};
fetch('https://api.talqing.com/v1/email/batches/{batch_id}', 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/{batch_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'draft_attempts' => 123,
'draft_concurrency' => 123,
'draft_gap_seconds' => 123,
'draft_retry_after_minutes' => 123,
'from_email' => '<string>',
'from_name' => '<string>',
'name' => '<string>',
'reply_to' => '<string>',
'send_attempts' => 123,
'send_daily_cap' => [
'kind' => 'fixed',
'limit' => 2
],
'send_gap_seconds' => 123,
'send_retry_after_minutes' => 123,
'start_at' => '2023-11-07T05:31:56Z',
'timezone' => '<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/{batch_id}"
payload := strings.NewReader("{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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("PATCH", 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.patch("https://api.talqing.com/v1/email/batches/{batch_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Patch Email Batch
Edit a batch’s policy. The next drafting pass reads the new row.
Pacing, the window and the daily cap are editable at any time; the sending
half is the DEFAULT for the next send, and a send already created carries its
own copy. The sender, the body format, the field map and the template freeze
once the batch has sent anything — changing them then would make the rows
already delivered no longer describe what they were sent as. start_at moves
only while the batch is still scheduled. A template batch takes template, a
task batch field_map.
curl --request PATCH \
--url https://api.talqing.com/v1/email/batches/{batch_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"from_email": "<string>",
"from_name": "<string>",
"name": "<string>",
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"start_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [
1,
2,
3,
4,
5,
6,
7
]
}
}
'import requests
url = "https://api.talqing.com/v1/email/batches/{batch_id}"
payload = {
"draft_attempts": 123,
"draft_concurrency": 123,
"draft_gap_seconds": 123,
"draft_retry_after_minutes": 123,
"from_email": "<string>",
"from_name": "<string>",
"name": "<string>",
"reply_to": "<string>",
"send_attempts": 123,
"send_daily_cap": {
"kind": "fixed",
"limit": 2
},
"send_gap_seconds": 123,
"send_retry_after_minutes": 123,
"start_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"window": {
"end": "<string>",
"start": "<string>",
"days": [1, 2, 3, 4, 5, 6, 7]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
draft_attempts: 123,
draft_concurrency: 123,
draft_gap_seconds: 123,
draft_retry_after_minutes: 123,
from_email: '<string>',
from_name: '<string>',
name: '<string>',
reply_to: '<string>',
send_attempts: 123,
send_daily_cap: {kind: 'fixed', limit: 2},
send_gap_seconds: 123,
send_retry_after_minutes: 123,
start_at: '2023-11-07T05:31:56Z',
timezone: '<string>',
window: {end: '<string>', start: '<string>', days: [1, 2, 3, 4, 5, 6, 7]}
})
};
fetch('https://api.talqing.com/v1/email/batches/{batch_id}', 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/{batch_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'draft_attempts' => 123,
'draft_concurrency' => 123,
'draft_gap_seconds' => 123,
'draft_retry_after_minutes' => 123,
'from_email' => '<string>',
'from_name' => '<string>',
'name' => '<string>',
'reply_to' => '<string>',
'send_attempts' => 123,
'send_daily_cap' => [
'kind' => 'fixed',
'limit' => 2
],
'send_gap_seconds' => 123,
'send_retry_after_minutes' => 123,
'start_at' => '2023-11-07T05:31:56Z',
'timezone' => '<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/{batch_id}"
payload := strings.NewReader("{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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("PATCH", 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.patch("https://api.talqing.com/v1/email/batches/{batch_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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/{batch_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"draft_attempts\": 123,\n \"draft_concurrency\": 123,\n \"draft_gap_seconds\": 123,\n \"draft_retry_after_minutes\": 123,\n \"from_email\": \"<string>\",\n \"from_name\": \"<string>\",\n \"name\": \"<string>\",\n \"reply_to\": \"<string>\",\n \"send_attempts\": 123,\n \"send_daily_cap\": {\n \"kind\": \"fixed\",\n \"limit\": 2\n },\n \"send_gap_seconds\": 123,\n \"send_retry_after_minutes\": 123,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"timezone\": \"<string>\",\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>"
}
}{
"detail": {
"errors": [
"<string>"
],
"message": "<string>",
"code": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Policy edits.
window, start_at and send_daily_cap accept an explicit null
to clear them — "send at any hour", "start on the next pass", "no daily
ceiling" — which is why the service reads model_fields_set rather than
treating absent and null the same way. Every other field keeps the usual
PATCH rule: absent means unchanged.
Pacing stays editable at any time; identity does not once anything has been
sent (see service.patch_batch). The sending group here is the DEFAULT for
the next send — a run already created carries its own copy.
text, html Task batches only.
Show child attributes
Show child attributes
2001 - 200The same limit every day.
- FixedDailyCap
- RampDailyCap
Show child attributes
Show child attributes
Template batches only.
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
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