Refresh Custom Fields
curl --request POST \
--url https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields', 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.tracklysms.com/api/v2/journeys/refresh-custom-fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.tracklysms.com/api/v2/journeys/refresh-custom-fields"
req, _ := http.NewRequest("POST", 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.post("https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Found 2 custom fields",
"fields": [
"region",
"tier"
],
"status": "idle"
}
Journeys (v2)
Refresh Custom Fields
Refresh the cached contact custom fields used by SMS journeys.
POST
/
v2
/
journeys
/
refresh-custom-fields
Refresh Custom Fields
curl --request POST \
--url https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields"
headers = {"X-Api-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields', 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.tracklysms.com/api/v2/journeys/refresh-custom-fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.tracklysms.com/api/v2/journeys/refresh-custom-fields"
req, _ := http.NewRequest("POST", 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.post("https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tracklysms.com/api/v2/journeys/refresh-custom-fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Found 2 custom fields",
"fields": [
"region",
"tier"
],
"status": "idle"
}
Scans contacts in your account’s sending lists, stores unique field names in sorted order, and returns the result. No request body is required. Restricted keys may refresh the cache when their scopes permit the operation.
Declares the
If no sending lists exist, the response has
A failed scan, including one that cannot finish within its time budget, resets the scan state to idle and returns HTTP 500 with an
journeys.write scope. Authenticate with X-Api-Key; see Authentication.
Requests are limited to 5 per minute per API key unless that key has a custom rate-limit override. A request over the limit returns HTTP 429 with code: "rate_limit_exceeded" and a Retry-After header giving the number of seconds to wait.
Response
boolean
True when the scan completes. False when a refresh is already running; that response still uses HTTP 200.
string
Summary of the scan result or running state.
array of strings
Sorted field names after completion; omitted when a refresh is already running.
string
idle after completion, or running when a refresh is already in progress.
{
"success": true,
"message": "Found 2 custom fields",
"fields": [
"region",
"tier"
],
"status": "idle"
}
success: true, message: "No sending lists found", fields: [], and status: "idle".
An in-progress response is:
{"success": false, "message": "Refresh already in progress", "status": "running"}
error string and code: "custom_fields_refresh_failed".