curl --request POST \
--url https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "<string>",
"emails": [
{
"step": 6,
"subject": "<string>",
"body": "<string>"
}
]
}
'import requests
url = "https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach"
payload = {
"contact_id": "<string>",
"emails": [
{
"step": 6,
"subject": "<string>",
"body": "<string>"
}
]
}
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({
contact_id: '<string>',
emails: [{step: 6, subject: '<string>', body: JSON.stringify('<string>')}]
})
};
fetch('https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach', 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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach",
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([
'contact_id' => '<string>',
'emails' => [
[
'step' => 6,
'subject' => '<string>',
'body' => '<string>'
]
]
]),
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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach"
payload := strings.NewReader("{\n \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach")
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 \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Attach Result Outreach Drafts
Give an existing CRM contact a sequence on this result.
The edit endpoint can only rewrite drafts the run wrote, so a buyer who reached the CRM some other way — imported, found by hand, or found by a provider the run’s people search could not reach — can never get drafts on the result, and the run page lists them nowhere. This creates the slot:
- on the contact, a by-run entry for this run (and
latest, unless a later run owns it) — the copy a campaign sends from; - on the result, a line in the run copy of the sequences, and the person in
stakeholders_json, so the run page shows them as a decision-maker.
Guarded to the company: the contact must be linked to the account this result belongs to, so a sequence cannot be filed under the wrong company. A person who already has drafts here is refused — edit those instead.
Contact first, then result, for the same reason as the edit endpoint.
curl --request POST \
--url https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact_id": "<string>",
"emails": [
{
"step": 6,
"subject": "<string>",
"body": "<string>"
}
]
}
'import requests
url = "https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach"
payload = {
"contact_id": "<string>",
"emails": [
{
"step": 6,
"subject": "<string>",
"body": "<string>"
}
]
}
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({
contact_id: '<string>',
emails: [{step: 6, subject: '<string>', body: JSON.stringify('<string>')}]
})
};
fetch('https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach', 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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach",
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([
'contact_id' => '<string>',
'emails' => [
[
'step' => 6,
'subject' => '<string>',
'body' => '<string>'
]
]
]),
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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach"
payload := strings.NewReader("{\n \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\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.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/customer-intelligence/runs/{run_id}/results/{result_id}/outreach-drafts/attach")
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 \"contact_id\": \"<string>\",\n \"emails\": [\n {\n \"step\": 6,\n \"subject\": \"<string>\",\n \"body\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Give an existing CRM contact a sequence on a run result.
The run only drafts for the people its own search found. A buyer who was added to the CRM another way (imported, found by hand, created before the run) has no slot to edit, so the edit endpoint can only answer 404. This creates that slot, with the authored sequence in it, in the same two places a generated one lives.
Response
Successful Response
The response is of type Response Attach Result Outreach Drafts Customer Intelligence Runs Run Id Results Result Id Outreach Drafts Attach Post · object.