curl --request POST \
--url https://api.reply.io/v3/ai-prompts/preview/linkedin-post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promptText": "Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.",
"linkedInProfileUrl": "https://www.linkedin.com/in/alex-johnson",
"linkedInAccountId": 456,
"skipTopics": [
"politics",
"religion"
],
"skipIfNoPostsInDays": 30,
"sequenceId": 4521
}
'import requests
url = "https://api.reply.io/v3/ai-prompts/preview/linkedin-post"
payload = {
"promptText": "Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.",
"linkedInProfileUrl": "https://www.linkedin.com/in/alex-johnson",
"linkedInAccountId": 456,
"skipTopics": ["politics", "religion"],
"skipIfNoPostsInDays": 30,
"sequenceId": 4521
}
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({
promptText: 'Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.',
linkedInProfileUrl: 'https://www.linkedin.com/in/alex-johnson',
linkedInAccountId: 456,
skipTopics: ['politics', 'religion'],
skipIfNoPostsInDays: 30,
sequenceId: 4521
})
};
fetch('https://api.reply.io/v3/ai-prompts/preview/linkedin-post', 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.reply.io/v3/ai-prompts/preview/linkedin-post",
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([
'promptText' => 'Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.',
'linkedInProfileUrl' => 'https://www.linkedin.com/in/alex-johnson',
'linkedInAccountId' => 456,
'skipTopics' => [
'politics',
'religion'
],
'skipIfNoPostsInDays' => 30,
'sequenceId' => 4521
]),
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.reply.io/v3/ai-prompts/preview/linkedin-post"
payload := strings.NewReader("{\n \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\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.reply.io/v3/ai-prompts/preview/linkedin-post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reply.io/v3/ai-prompts/preview/linkedin-post")
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 \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\n}"
response = http.request(request)
puts response.read_body{
"outcome": "generated",
"commentText": "The point about onboarding friction really lands — we saw the same drop-off until we cut the setup steps in half.",
"postText": "After six months of user interviews, the biggest blocker we found wasn't pricing. It was onboarding friction.",
"detectedTopic": "product onboarding",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7100000000000000000"
}Preview a comment prompt against a LinkedIn post
New. This endpoint shipped recently. If anything about it is unclear or could work better for you, tell us in the developer Slack.
sequences:operate scope (or a broader one that includes it).
Test a comment prompt against a real person’s latest LinkedIn post. The response shows which post the comment was written for.
curl --request POST \
--url https://api.reply.io/v3/ai-prompts/preview/linkedin-post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promptText": "Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.",
"linkedInProfileUrl": "https://www.linkedin.com/in/alex-johnson",
"linkedInAccountId": 456,
"skipTopics": [
"politics",
"religion"
],
"skipIfNoPostsInDays": 30,
"sequenceId": 4521
}
'import requests
url = "https://api.reply.io/v3/ai-prompts/preview/linkedin-post"
payload = {
"promptText": "Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.",
"linkedInProfileUrl": "https://www.linkedin.com/in/alex-johnson",
"linkedInAccountId": 456,
"skipTopics": ["politics", "religion"],
"skipIfNoPostsInDays": 30,
"sequenceId": 4521
}
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({
promptText: 'Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.',
linkedInProfileUrl: 'https://www.linkedin.com/in/alex-johnson',
linkedInAccountId: 456,
skipTopics: ['politics', 'religion'],
skipIfNoPostsInDays: 30,
sequenceId: 4521
})
};
fetch('https://api.reply.io/v3/ai-prompts/preview/linkedin-post', 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.reply.io/v3/ai-prompts/preview/linkedin-post",
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([
'promptText' => 'Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.',
'linkedInProfileUrl' => 'https://www.linkedin.com/in/alex-johnson',
'linkedInAccountId' => 456,
'skipTopics' => [
'politics',
'religion'
],
'skipIfNoPostsInDays' => 30,
'sequenceId' => 4521
]),
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.reply.io/v3/ai-prompts/preview/linkedin-post"
payload := strings.NewReader("{\n \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\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.reply.io/v3/ai-prompts/preview/linkedin-post")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reply.io/v3/ai-prompts/preview/linkedin-post")
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 \"promptText\": \"Write a short, genuine comment that reacts to one concrete point in the post. Avoid flattery and never pitch.\",\n \"linkedInProfileUrl\": \"https://www.linkedin.com/in/alex-johnson\",\n \"linkedInAccountId\": 456,\n \"skipTopics\": [\n \"politics\",\n \"religion\"\n ],\n \"skipIfNoPostsInDays\": 30,\n \"sequenceId\": 4521\n}"
response = http.request(request)
puts response.read_body{
"outcome": "generated",
"commentText": "The point about onboarding friction really lands — we saw the same drop-off until we cut the setup steps in half.",
"postText": "After six months of user interviews, the biggest blocker we found wasn't pricing. It was onboarding friction.",
"detectedTopic": "product onboarding",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7100000000000000000"
}Authorizations
Authenticate every request with a Bearer token. Pass your Reply API key in the
Authorization header:
Authorization: Bearer <your-api-key>
Get your API key from the Reply dashboard: Settings → API Key.
Body
Request body for previewing a comment prompt against a real person's latest LinkedIn post. One Reply credit is spent per call, whatever the outcome.
The prompt instructions to test
2000URL of the LinkedIn profile whose latest post the comment is written for
ID of the connected LinkedIn account used to look up the post
x >= 1Topics the AI should refuse to comment on. A post matching one of these returns the aiSkip outcome.
Treat the profile as having nothing to comment on when its latest post is older than this many days, returning
the noRecentPosts outcome.
1 <= x <= 90Sequence to resolve variables against when promptText contains sequence variables. Omit if the prompt has
no variables.
x >= 1Response
The preview result
The result of a comment preview. Read outcome first — it tells you whether a comment was produced and, if not,
why.
Whether a comment was generated, and why not if it was skipped
generated, noRecentPosts, postsUnavailable, commentingRestricted, reshareNoText, noPostContent, aiSkip The generated comment. Populated only when outcome is generated.
The text of the post the comment was written for
The topic the AI detected in the post. Useful for checking why a post was skipped.
Link to the post the comment was written for