curl --request GET \
--url https://api.getoneprofile.ai/inbox/drafts/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/inbox/drafts/"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/inbox/drafts/', 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/inbox/drafts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.getoneprofile.ai/inbox/drafts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getoneprofile.ai/inbox/drafts/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/inbox/drafts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"body_text": "<string>",
"confidence": "high",
"confidence_reason": "<string>",
"generated_body_text": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "auto_drafted",
"status": "pending_approval",
"steer_text": "<string>",
"subject": "<string>",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ask_reason": "low_confidence",
"channel": "email",
"confidence_score": 123,
"learning_subject_key": "<string>",
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": "good",
"send_after": "2023-11-07T05:31:56Z",
"send_outcome": "as_written",
"sent_by_kind": "person"
}
],
"next_page_cursor": "<string>",
"previous_page_cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}List reply drafts
AI replies, newest first. Narrow to one conversation with thread_id, and to the ones that still wait for a person with status=pending_approval: that is the draft a conversation shows for approval. Without status every draft comes back, the rejected, stale and sent ones too.
curl --request GET \
--url https://api.getoneprofile.ai/inbox/drafts/ \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.getoneprofile.ai/inbox/drafts/"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.getoneprofile.ai/inbox/drafts/', 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/inbox/drafts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.getoneprofile.ai/inbox/drafts/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.getoneprofile.ai/inbox/drafts/")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getoneprofile.ai/inbox/drafts/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"body_text": "<string>",
"confidence": "high",
"confidence_reason": "<string>",
"generated_body_text": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "auto_drafted",
"status": "pending_approval",
"steer_text": "<string>",
"subject": "<string>",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ask_reason": "low_confidence",
"channel": "email",
"confidence_score": 123,
"learning_subject_key": "<string>",
"mailbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": "good",
"send_after": "2023-11-07T05:31:56Z",
"send_outcome": "as_written",
"sent_by_kind": "person"
}
],
"next_page_cursor": "<string>",
"previous_page_cursor": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"issues": [
{
"input": "<string>",
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Query Parameters
Only drafts in any of these states, repeated for several. pending_approval is a reply waiting for a person.
8Where one drafted reply stands.
STALE is its own terminal state rather than a flavour of DISCARDED: "the prospect wrote again before anyone answered" and "a human said no" are different facts, and only the second one says anything about draft quality.
The send states past SCHEDULED exist for the same reason SEND_UNKNOWN does: once a draft can leave without a person watching, "we do not know" has to be a state of its own. Collapsing it into SEND_FAILED would have a retry send the same reply twice; collapsing it into SENT would lose a reply silently.
pending_approval, sent, discarded, stale, scheduled, sending, send_unknown, send_failed Only the drafts of this conversation
The number of items to return.
1 <= x <= 100id asc, desc Set the cursor to the next or previous page. You can get the cursor from the previous page's response.
Response
Successful Response
Was this page helpful?