curl --request POST \
--url https://api.reply.io/v3/contacts/run-prompt-action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promptActionId": 2,
"contactIds": [
123
],
"conflictResolution": "override"
}
'import requests
url = "https://api.reply.io/v3/contacts/run-prompt-action"
payload = {
"promptActionId": 2,
"contactIds": [123],
"conflictResolution": "override"
}
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({promptActionId: 2, contactIds: [123], conflictResolution: 'override'})
};
fetch('https://api.reply.io/v3/contacts/run-prompt-action', 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/contacts/run-prompt-action",
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([
'promptActionId' => 2,
'contactIds' => [
123
],
'conflictResolution' => 'override'
]),
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/contacts/run-prompt-action"
payload := strings.NewReader("{\n \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\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/contacts/run-prompt-action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reply.io/v3/contacts/run-prompt-action")
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 \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\n}"
response = http.request(request)
puts response.read_body{
"jobId": "0f8a1c52-4e3d-4a7b-9c11-2b6f8d1e4a90",
"contactsAccepted": 248,
"creditsReserved": 248
}Run a Prompt Action on contacts
New. This endpoint shipped recently. If anything about it is unclear or could work better for you, tell us in the developer Slack.
contacts:operate scope (or a broader one that includes it).
Run one of your saved Prompt Actions over a batch of contacts and write its outputs into their custom fields. Up to 1000 contacts per call.
The run is asynchronous: the response returns straight away with a jobId, and Reply credits are reserved up front for the contacts it accepted. Poll GET /v3/background-jobs/{jobId} with that id to follow progress. Manage the Prompt Actions themselves under /v3/prompt-actions.
curl --request POST \
--url https://api.reply.io/v3/contacts/run-prompt-action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"promptActionId": 2,
"contactIds": [
123
],
"conflictResolution": "override"
}
'import requests
url = "https://api.reply.io/v3/contacts/run-prompt-action"
payload = {
"promptActionId": 2,
"contactIds": [123],
"conflictResolution": "override"
}
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({promptActionId: 2, contactIds: [123], conflictResolution: 'override'})
};
fetch('https://api.reply.io/v3/contacts/run-prompt-action', 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/contacts/run-prompt-action",
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([
'promptActionId' => 2,
'contactIds' => [
123
],
'conflictResolution' => 'override'
]),
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/contacts/run-prompt-action"
payload := strings.NewReader("{\n \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\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/contacts/run-prompt-action")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reply.io/v3/contacts/run-prompt-action")
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 \"promptActionId\": 2,\n \"contactIds\": [\n 123\n ],\n \"conflictResolution\": \"override\"\n}"
response = http.request(request)
puts response.read_body{
"jobId": "0f8a1c52-4e3d-4a7b-9c11-2b6f8d1e4a90",
"contactsAccepted": 248,
"creditsReserved": 248
}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
Prompt Action to run
x >= 1Contact IDs to run the Prompt Action on. At least one, at most 1000. Each ID must be positive.
1 - 1000 elementsWhat to do when a target custom field already holds a value. override replaces it; keepExisting leaves it untouched.
override, keepExisting Response
The run was accepted and started. contactsAccepted is the number of contacts the run will process, which can be fewer than you sent when some IDs are not accessible to your team.