curl --request POST \
--url https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fresh": false,
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/"
payload = {
"fresh": False,
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fresh: false, mailbox_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/', 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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/",
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([
'fresh' => false,
'mailbox_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/"
payload := strings.NewReader("{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"in_thread": true,
"missing_columns": [
"<string>"
],
"subject": "<string>",
"agent_written": false,
"approved": false,
"closing": {
"opt_out_footer": "<string>",
"signature": "<string>"
},
"is_sample": false,
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinned": false,
"preview_units": 123,
"sample_created_at": "2023-11-07T05:31:56Z",
"sample_version": 123,
"sent": {
"body": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"subject": "<string>",
"email_html": "<string>"
},
"spam_findings": [
{
"code": "<string>",
"detail": "<string>",
"message": "<string>",
"severity": "<string>",
"title": "<string>",
"excerpt": "<string>",
"excerpts": [
"<string>"
]
}
],
"waiting_for_approval": false,
"written": true
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Write one contact's samples
Have the agent write this contact’s emails as samples, the way the real first send writes them, and answer this step as they would receive it. For a contact not written to yet the agent writes their whole sequence in one call and saves each step’s words as a sample, kept in the sequence’s Preview; nobody receives a sample, and the real send is written fresh unless the thread is marked Looks good. A sample already saved for this step is answered as it is, unless fresh asks for the contact’s emails to be written again; words marked Looks good, or a person’s own words for the contact, stand and are answered as they are. Each step written counts against the workspace’s daily preview allowance; it costs no credits. GET /sequences/{sequence_id}/steps/{step_id}/preview/ shows what is saved without writing.
curl --request POST \
--url https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fresh": false,
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/"
payload = {
"fresh": False,
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fresh: false, mailbox_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/', 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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/",
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([
'fresh' => false,
'mailbox_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/"
payload := strings.NewReader("{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/samples/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fresh\": false,\n \"mailbox_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"body": "<string>",
"in_thread": true,
"missing_columns": [
"<string>"
],
"subject": "<string>",
"agent_written": false,
"approved": false,
"closing": {
"opt_out_footer": "<string>",
"signature": "<string>"
},
"is_sample": false,
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinned": false,
"preview_units": 123,
"sample_created_at": "2023-11-07T05:31:56Z",
"sample_version": 123,
"sent": {
"body": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"subject": "<string>",
"email_html": "<string>"
},
"spam_findings": [
{
"code": "<string>",
"detail": "<string>",
"message": "<string>",
"severity": "<string>",
"title": "<string>",
"excerpt": "<string>",
"excerpts": [
"<string>"
]
}
],
"waiting_for_approval": false,
"written": true
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Path Parameters
Body
What writing one contact's samples takes: whether to write them again, and as whom.
Response
Successful Response
The words were marked Looks good, with the contact's thread in the sequence's Preview or as this one email from the Builder, and still stand, so they are what sends. They stop standing, and the agent writes the step fresh, once the agent's writing or the contact's row changes.
The agent's message these words are, on an agent-written step: the sample on screen, or the one marked Looks good. Marking it Looks good (PUT /sequences/{sequence_id}/steps/{step_id}/rows/{record_id}/feedback/) takes it back as message_id, so a mark lands only on the words that were read.
With written false: how much of today's preview allowance writing it would use, one for each message the agent writes in the call (the contact's whole sequence for a contact not written to yet). Writing is refused when GET /outbound-agents/preview-allowance/ has fewer remaining. Null otherwise, or when it cannot be worked out.
Was this page helpful?