Queue a bounded pilot or production run
curl --request POST \
--url https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 2,
"max_charge_credits": "<string>",
"idempotency_key": "<string>",
"input": "<unknown>",
"input_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_rows": 5000
}
'import requests
url = "https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs"
payload = {
"version": 2,
"max_charge_credits": "<string>",
"idempotency_key": "<string>",
"input": "<unknown>",
"input_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_rows": 5000
}
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({
version: 2,
max_charge_credits: '<string>',
idempotency_key: '<string>',
input: '<unknown>',
input_artifact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
max_rows: 5000
})
};
fetch('https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs', 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.paywithlocus.com/api/credits/workflows/{workflowId}/runs",
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([
'version' => 2,
'max_charge_credits' => '<string>',
'idempotency_key' => '<string>',
'input' => '<unknown>',
'input_artifact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'max_rows' => 5000
]),
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.paywithlocus.com/api/credits/workflows/{workflowId}/runs"
payload := strings.NewReader("{\n \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\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.paywithlocus.com/api/credits/workflows/{workflowId}/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs")
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 \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"run": {},
"replay": true
}Hosted Workflows
Queue a bounded pilot or production run
Complete successful fixture tests for the exact source before starting a live pilot. A production run also requires a successful pilot of the same saved version. The run inherits and is bounded by the current connection.
POST
/
credits
/
workflows
/
{workflowId}
/
runs
Queue a bounded pilot or production run
curl --request POST \
--url https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 2,
"max_charge_credits": "<string>",
"idempotency_key": "<string>",
"input": "<unknown>",
"input_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_rows": 5000
}
'import requests
url = "https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs"
payload = {
"version": 2,
"max_charge_credits": "<string>",
"idempotency_key": "<string>",
"input": "<unknown>",
"input_artifact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_rows": 5000
}
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({
version: 2,
max_charge_credits: '<string>',
idempotency_key: '<string>',
input: '<unknown>',
input_artifact_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
max_rows: 5000
})
};
fetch('https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs', 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.paywithlocus.com/api/credits/workflows/{workflowId}/runs",
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([
'version' => 2,
'max_charge_credits' => '<string>',
'idempotency_key' => '<string>',
'input' => '<unknown>',
'input_artifact_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'max_rows' => 5000
]),
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.paywithlocus.com/api/credits/workflows/{workflowId}/runs"
payload := strings.NewReader("{\n \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\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.paywithlocus.com/api/credits/workflows/{workflowId}/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paywithlocus.com/api/credits/workflows/{workflowId}/runs")
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 \"version\": 2,\n \"max_charge_credits\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"input\": \"<unknown>\",\n \"input_artifact_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"max_rows\": 5000\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"run": {},
"replay": true
}Authorizations
secretKeyagentConnection
Tenant secret key (lcr_…). Server-side only.
Path Parameters
Body
application/json
Required range:
x >= 1Available options:
pilot, run Positive total credit ceiling for the run.
Pattern:
^\d+(?:\.\d{1,6})?$Required string length:
1 - 200Inline JSON input, up to 256 KiB. Omitted or null input becomes an empty object. Cannot be combined with input_artifact_id.
Defaults to 10 for a pilot or 10,000 for a production run. Pilots accept at most 10 rows.
Required range:
1 <= x <= 10000Response
Idempotent replay of the original run