Proxies API
Create and manage proxy configurations programmatically
Proxies API
Create and manage proxy configurations that connect your applications to target APIs.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/clients/{clientId}/proxies | List all proxies |
| POST | /api/clients/{clientId}/proxies | Create a proxy |
| GET | /api/clients/{clientId}/proxies/{proxyId} | Get proxy details |
| PUT | /api/clients/{clientId}/proxies/{proxyId} | Update proxy |
| DELETE | /api/clients/{clientId}/proxies/{proxyId} | Delete proxy |
| GET | /api/clients/{clientId}/proxies/{proxyId}/telemetry | Get proxy telemetry |
List Proxies
Get all proxies for a client.
Request
GET /api/clients/{clientId}/proxies HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"proxies": [
{
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "proxy_789e4567",
"userId": "user_123",
"clientId": "client_456",
"parentId": "client_456",
"proxyName": "Production Payment Gateway",
"proxyRegion": "us-east-1",
"proxyProxyCredentialId": "cred_123",
"proxyTargetId": "tgt_456",
"proxyTargetCredentialId": "cred_789",
"proxyActive": true,
"proxyCreatedAt": "2024-01-22T13:00:00.000Z",
"proxyUpdatedAt": "2024-01-22T13:00:00.000Z",
"proxyDefaultRuleEffect": "allow",
"proxyAlias": "payment-gateway"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Proxies:', data.proxies);import requests
import os
client_id = "your-client-id"
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Found {len(data['proxies'])} proxies")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Proxies []map[string]interface{} `json:"proxies"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies", clientId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Found %d proxies\n", len(result.Proxies))
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class ListProxies {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/proxies"))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray proxies = json.getAsJsonArray("proxies");
System.out.println("Found " + proxies.size() + " proxies");
}
}curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies" \
-H "Authorization: ${USER_TOKEN}"Create Proxy
Create a new proxy configuration.
Request
POST /api/clients/{clientId}/proxies HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/json
{
"proxyName": "Production Payment Gateway",
"proxyRegion": "us-east-1",
"proxyProxyCredentialId": "cred_123",
"proxyTargetId": "tgt_456",
"proxyTargetCredentialId": "cred_789",
"proxyActive": true,
"proxyDefaultRuleEffect": "allow",
"proxyAlias": "payment-gateway",
"proxyAdditionalHeaders": {},
"proxyAdditionalQueryParams": {},
"proxyAdditionalData": {}
}Request Body
| Field | Type | Required | Description |
|---|---|---|---|
proxyName | string | Yes | Descriptive name for the proxy |
proxyRegion | string | Yes | AWS region (must match all components) - cannot be changed after creation |
proxyProxyCredentialId | string | Yes | ID of proxy credential (authenticates your app to RequestRocket) |
proxyTargetId | string | Yes | ID of target API |
proxyTargetCredentialId | string | Yes | ID of target credential (authenticates RequestRocket to target API) |
proxyActive | boolean | No | Whether proxy is active (default: true) |
proxyDefaultRuleEffect | string | No | Default access policy: allow or deny |
proxyAlias | string | No | Human-readable alias for the proxy (lowercase, unique within client) |
proxyAdditionalHeaders | object | No | Additional headers to append to all target requests |
proxyAdditionalQueryParams | object | No | Additional query parameters to append to all target requests |
proxyAdditionalData | object | No | Additional body data to append to all target requests (POST/PUT/PATCH only) |
Response
{
"proxies": [
{
"userId": "user_123",
"clientId": "client_456",
"parentId": "client_456",
"proxyName": "Production Payment Gateway",
"proxyRegion": "us-east-1",
"proxyProxyCredentialId": "cred_123",
"proxyTargetId": "tgt_456",
"proxyTargetCredentialId": "cred_789",
"proxyActive": true,
"proxyCreatedAt": "2024-01-22T13:00:00.000Z",
"proxyUpdatedAt": "2024-01-22T13:00:00.000Z",
"proxyDefaultRuleEffect": "allow",
"proxyAlias": "payment-gateway",
"proxyAdditionalHeaders": {},
"proxyAdditionalQueryParams": {},
"proxyAdditionalData": {}
}
],
"message": "Success"
}Use the proxy ID (sKey) to construct your request URLs: https://{region}.requestrocket.com/api/{proxyId}/{path}
The proxyRegion field cannot be changed after creation. All components (proxy credential, target credential, target, and proxy) must be in the same region.
Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies`,
{
method: 'POST',
headers: {
'Authorization': process.env.USER_TOKEN,
'Content-Type': 'application/json'
},
body: JSON.stringify({
proxyName: 'Production Payment Gateway',
proxyRegion: 'us-east-1',
proxyProxyCredentialId: 'cred_123',
proxyTargetId: 'tgt_456',
proxyTargetCredentialId: 'cred_789',
proxyActive: true,
proxyDefaultRuleEffect: 'allow',
proxyAlias: 'payment-gateway'
})
}
);
const data = await response.json();
console.log('Created proxy:', data.proxies[0]);import requests
import os
client_id = "your-client-id"
response = requests.post(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies',
headers={'Authorization': os.getenv('USER_TOKEN')},
json={
'proxyName': 'Production Payment Gateway',
'proxyRegion': 'us-east-1',
'proxyProxyCredentialId': 'cred_123',
'proxyTargetId': 'tgt_456',
'proxyTargetCredentialId': 'cred_789',
'proxyActive': True,
'proxyDefaultRuleEffect': 'allow',
'proxyAlias': 'payment-gateway'
}
)
data = response.json()
print(f"Created proxy: {data['proxies'][0]['proxyName']}")package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type ProxyRequest struct {
ProxyName string `json:"proxyName"`
ProxyRegion string `json:"proxyRegion"`
ProxyProxyCredentialId string `json:"proxyProxyCredentialId"`
ProxyTargetId string `json:"proxyTargetId"`
ProxyTargetCredentialId string `json:"proxyTargetCredentialId"`
ProxyActive bool `json:"proxyActive"`
ProxyDefaultRuleEffect string `json:"proxyDefaultRuleEffect"`
ProxyAlias string `json:"proxyAlias"`
}
func main() {
clientId := "your-client-id"
requestBody, _ := json.Marshal(ProxyRequest{
ProxyName: "Production Payment Gateway",
ProxyRegion: "us-east-1",
ProxyProxyCredentialId: "cred_123",
ProxyTargetId: "tgt_456",
ProxyTargetCredentialId: "cred_789",
ProxyActive: true,
ProxyDefaultRuleEffect: "allow",
ProxyAlias: "payment-gateway",
})
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies", clientId)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class CreateProxy {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String json = "{"
+ "\"proxyName\": \"Production Payment Gateway\","
+ "\"proxyRegion\": \"us-east-1\","
+ "\"proxyProxyCredentialId\": \"cred_123\","
+ "\"proxyTargetId\": \"tgt_456\","
+ "\"proxyTargetCredentialId\": \"cred_789\","
+ "\"proxyActive\": true,"
+ "\"proxyDefaultRuleEffect\": \"allow\","
+ "\"proxyAlias\": \"payment-gateway\""
+ "}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/proxies"))
.header("Authorization", System.getenv("USER_TOKEN"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}curl -X POST "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies" \
-H "Authorization: ${USER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"proxyName": "Production Payment Gateway",
"proxyRegion": "us-east-1",
"proxyProxyCredentialId": "cred_123",
"proxyTargetId": "tgt_456",
"proxyTargetCredentialId": "cred_789",
"proxyActive": true,
"proxyDefaultRuleEffect": "allow",
"proxyAlias": "payment-gateway"
}'Get Proxy
Get details of a specific proxy.
Request
GET /api/clients/{clientId}/proxies/{proxyId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"proxies": [
{
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "proxy_789e4567",
"userId": "user_123",
"clientId": "client_456",
"parentId": "client_456",
"proxyName": "Production Payment Gateway",
"proxyRegion": "us-east-1",
"proxyProxyCredentialId": "cred_123",
"proxyTargetId": "tgt_456",
"proxyTargetCredentialId": "cred_789",
"proxyActive": true,
"proxyCreatedAt": "2024-01-22T13:00:00.000Z",
"proxyUpdatedAt": "2024-01-22T13:00:00.000Z",
"proxyDefaultRuleEffect": "allow",
"proxyAlias": "payment-gateway",
"proxyAdditionalHeaders": {},
"proxyAdditionalQueryParams": {},
"proxyAdditionalData": {}
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log('Proxy:', data.proxies[0]);import requests
import os
client_id = "your-client-id"
proxy_id = "your-proxy-id"
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Proxy: {data['proxies'][0]['proxyName']}")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Proxies []map[string]interface{} `json:"proxies"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
proxyId := "your-proxy-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s", clientId, proxyId)
req, _ := http.NewRequest("GET", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Printf("Proxy: %v\n", result.Proxies[0])
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class GetProxy {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String proxyId = "your-proxy-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/proxies/" + proxyId))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
JsonArray proxies = json.getAsJsonArray("proxies");
System.out.println("Proxy: " + proxies.get(0));
}
}curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}" \
-H "Authorization: ${USER_TOKEN}"Update Proxy
Update a proxy configuration.
Request
PUT /api/clients/{clientId}/proxies/{proxyId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/json
{
"proxyName": "Updated Proxy Name",
"proxyActive": false
}Response
{
"proxies": [
{
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "proxy_789e4567",
"proxyName": "Updated Proxy Name",
"proxyActive": false,
"proxyUpdatedAt": "2024-01-22T14:00:00.000Z"
}
],
"message": "Success"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}`,
{
method: 'PUT',
headers: {
'Authorization': process.env.USER_TOKEN,
'Content-Type': 'application/json'
},
body: JSON.stringify({
proxyName: 'Updated Proxy Name',
proxyActive: false
})
}
);
const data = await response.json();
console.log('Updated proxy:', data.proxies[0]);import requests
import os
client_id = "your-client-id"
proxy_id = "your-proxy-id"
response = requests.put(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}',
headers={'Authorization': os.getenv('USER_TOKEN')},
json={
'proxyName': 'Updated Proxy Name',
'proxyActive': False
}
)
data = response.json()
print(f"Updated: {data['message']}")package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type UpdateProxyRequest struct {
ProxyName string `json:"proxyName"`
ProxyActive bool `json:"proxyActive"`
}
func main() {
clientId := "your-client-id"
proxyId := "your-proxy-id"
requestBody, _ := json.Marshal(UpdateProxyRequest{
ProxyName: "Updated Proxy Name",
ProxyActive: false,
})
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s", clientId, proxyId)
req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(requestBody))
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class UpdateProxy {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String proxyId = "your-proxy-id";
String json = "{"
+ "\"proxyName\": \"Updated Proxy Name\","
+ "\"proxyActive\": false"
+ "}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/proxies/" + proxyId))
.header("Authorization", System.getenv("USER_TOKEN"))
.header("Content-Type", "application/json")
.PUT(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}curl -X PUT "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}" \
-H "Authorization: ${USER_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"proxyName": "Updated Proxy Name",
"proxyActive": false
}'Delete Proxy
Delete a proxy configuration.
Request
DELETE /api/clients/{clientId}/proxies/{proxyId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"message": "Proxy deleted successfully"
}Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}`,
{
method: 'DELETE',
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log(data.message);import requests
import os
client_id = "your-client-id"
proxy_id = "your-proxy-id"
response = requests.delete(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(data['message'])package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
proxyId := "your-proxy-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s", clientId, proxyId)
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result Response
json.Unmarshal(body, &result)
fmt.Println(result.Message)
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class DeleteProxy {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String proxyId = "your-proxy-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.requestrocket.com/api/clients/" + clientId + "/proxies/" + proxyId))
.header("Authorization", System.getenv("USER_TOKEN"))
.DELETE()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
System.out.println(json.get("message").getAsString());
}
}curl -X DELETE "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}" \
-H "Authorization: ${USER_TOKEN}"Complete Setup Example
async function setupCompleteProxy(clientId, userToken) {
// 1. Create proxy credential
const proxyCred = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/credentials`,
{
method: 'POST',
headers: {
'Authorization': userToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
credentialName: 'App API Key',
credentialType: 'proxy',
credentialAuthType: 'key',
credentialRegion: 'us-east-1',
credentialSecret: { key: 'X-API-Key', value: 'app-key', addToHeader: true }
})
}
).then(r => r.json());
// 2. Create target credential
const targetCred = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/credentials`,
{
method: 'POST',
headers: {
'Authorization': userToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
credentialName: 'Stripe Token',
credentialType: 'target',
credentialAuthType: 'bearer',
credentialRegion: 'us-east-1',
credentialSecret: { token: process.env.STRIPE_KEY, addToHeader: true }
})
}
).then(r => r.json());
// 3. Create target
const target = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/targets`,
{
method: 'POST',
headers: {
'Authorization': userToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
targetName: 'Stripe API',
targetRegion: 'us-east-1',
targetBaseURL: 'https://api.stripe.com',
targetTestPath: '/v1/customers'
})
}
).then(r => r.json());
// 4. Create proxy
const proxy = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies`,
{
method: 'POST',
headers: {
'Authorization': userToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
proxyName: 'Stripe Proxy',
proxyRegion: 'us-east-1',
proxyProxyCredentialId: proxyCred.credentials[0].sKey,
proxyTargetId: target.targets[0].sKey,
proxyTargetCredentialId: targetCred.credentials[0].sKey,
proxyActive: true,
proxyDefaultRuleEffect: 'allow'
})
}
).then(r => r.json());
const proxyId = proxy.proxies[0].sKey;
const region = proxy.proxies[0].proxyRegion;
return {
proxy: proxy.proxies[0],
proxyURL: `https://${region}.requestrocket.com/api/${proxyId}`
};
}Proxy Telemetry
Retrieve time-series telemetry for a specific proxy, broken down by the proxy leg (RequestRocket receiving the inbound call) and the target leg (RequestRocket forwarding to the upstream API). Results can be grouped by minute, hour, day, or month and filtered by date range.
Request
GET /api/clients/{clientId}/proxies/{proxyId}/telemetry?interval=hour&startDate=2025-09-01T00:00:00Z&endDate=2025-09-30T23:59:59Z&limit=100 HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
interval | string | No | Aggregation interval: minute, hour, day, or month (default: hour) |
startDate | string (date-time) | No | Include telemetry data starting from this time (inclusive) |
endDate | string (date-time) | No | Include telemetry data ending at this time (inclusive) |
limit | integer | No | Maximum number of telemetry records to return (default: 100, max: 1000) |
Response Fields
All counter and timing fields are source-keyed maps with "proxy" and "target" keys. Derived maps are computed on read and are not stored in the database.
| Field | Type | Description |
|---|---|---|
pKey | string | Proxy ID |
sKey | string | Timestamp key (YYYY-MM-DD-HH-MM / YYYY-MM-DD-HH / YYYY-MM-DD / YYYY-MM) |
proxyId | string | Proxy ID (same as pKey for proxy records) |
countMap | Record<source, integer> | Total request count per source |
successCountMap | Record<source, integer> | Successful requests (2xx / 3xx) per source |
errorCountMap | Record<source, integer> | Error requests (4xx / 5xx) per source |
totalResponseTimeMap | Record<source, float> | Cumulative response time in ms per source |
codeCountMap | Record<"statusCode:source", integer> | Request count per HTTP status code and source |
codeTotalRTMap | Record<"statusCode:source", float> | Cumulative response time per status code and source |
countryCountMap | Record<"countryCode:source", integer> | Request count per country (ISO 3166-1 alpha-2) and source |
countryTotalRTMap | Record<"countryCode:source", float> | Cumulative response time per country and source |
averageResponseTimeMap | Record<source, float> | Average response time per source (derived) |
successRateMap | Record<source, float> | Success rate per source (derived) |
errorRateMap | Record<source, float> | Error rate per source (derived) |
countryAverageRTMap | Record<"countryCode:source", float> | Average response time per country and source (derived) |
ewmaResponseTime | float | Exponentially weighted moving average of response time |
Response
{
"message": "Success",
"interval": "hour",
"telemetry": [
{
"pKey": "a1b2c3d4-1234-5678-abcd-ef0123456789",
"sKey": "2025-09-10-02",
"proxyId": "a1b2c3d4-1234-5678-abcd-ef0123456789",
"countMap": { "proxy": 150, "target": 142 },
"successCountMap": { "proxy": 148, "target": 140 },
"errorCountMap": { "proxy": 2, "target": 2 },
"totalResponseTimeMap":{ "proxy": 116.145, "target": 110.036 },
"codeCountMap": {
"200:proxy": 148, "200:target": 140,
"429:proxy": 2, "429:target": 2
},
"codeTotalRTMap": {
"200:proxy": 113.822, "200:target": 107.713,
"429:proxy": 2.323, "429:target": 2.323
},
"countryCountMap": {
"US:proxy": 90, "US:target": 85,
"AU:proxy": 60, "AU:target": 57
},
"countryTotalRTMap": {
"US:proxy": 69.687, "US:target": 65.834,
"AU:proxy": 46.458, "AU:target": 44.202
},
"averageResponseTimeMap": { "proxy": 0.7743, "target": 0.7749 },
"successRateMap": { "proxy": 0.9867, "target": 0.9859 },
"errorRateMap": { "proxy": 0.0133, "target": 0.0141 },
"countryAverageRTMap": {
"US:proxy": 0.7743, "US:target": 0.7745,
"AU:proxy": 0.7743, "AU:target": 0.7754
},
"ewmaResponseTime": 0.7681
}
]
}Request Overrides
Request overrides let you inject or replace headers, query parameters, and body data on outbound requests to a proxy's target. Each override can apply to every request or be conditionally matched using the same predicate system used by rules and meters.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/clients/{clientId}/proxies/{proxyId}/overrides | List all overrides for a proxy |
| POST | /api/clients/{clientId}/proxies/{proxyId}/overrides | Create an override |
| GET | /api/clients/{clientId}/proxies/{proxyId}/overrides/{overrideId} | Get a single override |
| PUT | /api/clients/{clientId}/proxies/{proxyId}/overrides/{overrideId} | Update an override |
| DELETE | /api/clients/{clientId}/proxies/{proxyId}/overrides/{overrideId} | Delete an override |
How Overrides Work
When a request arrives at a proxy, all active overrides are loaded and evaluated in priority order (lowest priority number first, so higher numbers win on key collision). Override values are accumulated — multiple matching overrides all contribute, with later ones winning on duplicate keys.
overrideMode | effect | Behaviour |
|---|---|---|
"all" | — | Always applied to every request |
"conditional" | "include" (default) | Applied only when predicates match |
"conditional" | "exclude" | Applied unless predicates match |
Create Override
POST /api/clients/{clientId}/proxies/{proxyId}/overrides HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/jsonBody:
{
"overrideHeaders": {
"x-api-key": "secret-key",
"x-tenant-id": "acme"
},
"overrideQueryParams": {
"version": "2"
},
"overrideData": null,
"overrideMode": "conditional",
"effect": "include",
"overrideActive": true,
"methods": ["POST", "PUT"],
"path": {
"path": { "pattern": "^/api/payments/.*", "flags": "i" },
"presence": "must_exist"
},
"priority": 10,
"notes": "Inject API key for payment endpoints"
}Response:
{
"override": {
"pKey": "proxy_uuid",
"sKey": "override_uuid",
"clientId": "client_uuid",
"userId": "user_uuid",
"parentId": "proxy_uuid",
"overrideRegion": "us-east-1",
"overrideHeaders": { "x-api-key": "secret-key", "x-tenant-id": "acme" },
"overrideQueryParams": { "version": "2" },
"overrideData": null,
"overrideMode": "conditional",
"effect": "include",
"overrideActive": true,
"methods": ["POST", "PUT"],
"path": {
"path": { "pattern": "^/api/payments/.*", "flags": "i" },
"presence": "must_exist"
},
"priority": 10,
"notes": "Inject API key for payment endpoints",
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z"
},
"message": "Created"
}Override Object Fields
| Field | Type | Required | Description |
|---|---|---|---|
overrideHeaders | Record<string, string> | No | Headers to merge onto the outbound request |
overrideQueryParams | Record<string, string> | No | Query parameters to merge onto the outbound request |
overrideData | Record<string, string> | No | Body key-value pairs to merge onto the outbound request |
overrideMode | "all" | "conditional" | Yes | Whether this override applies to all requests or uses predicate matching |
effect | "include" | "exclude" | No | For conditional mode: include (whitelist) or exclude (blacklist). Defaults to "include" |
overrideActive | boolean | Yes | Whether this override is active |
methods | string[] | No | HTTP methods to match (e.g. ["GET", "POST"]). Empty or absent = all methods |
path | PathCheck | No | Request path predicate using regex pattern matching |
headers | HeaderCheck[] | No | Request header predicates |
query | QueryCheck[] | No | Request query parameter predicates |
body | BodyCheck[] | No | Request body predicates (JSON path matching) |
token | TokenCheck[] | No | JWT claim predicates |
priority | number | No | Override application order; higher values win on key collision. Defaults to 0 |
notes | string | No | Human-readable description |
Predicate Matching
Predicates follow the same shape as authorization rules and usage meters. When overrideMode is "conditional", the override is only applied if all supplied predicates match the request (for effect: "include") or none match (for effect: "exclude").
Path predicate example — match any request to /api/v2/ or deeper:
{
"path": {
"path": { "pattern": "^/api/v2/", "flags": "" },
"presence": "must_exist"
}
}Header predicate example — only apply when x-beta-user: true:
{
"headers": [
{
"name": { "pattern": "x-beta-user", "flags": "i" },
"value": { "pattern": "^true$", "flags": "i" },
"presence": "must_exist"
}
]
}Updating an Override
PUT /api/clients/{clientId}/proxies/{proxyId}/overrides/{overrideId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}
Content-Type: application/jsonAll fields are optional in a PUT request — only supplied fields are updated.
{
"overrideActive": false,
"priority": 20
}Deleting an Override
DELETE /api/clients/{clientId}/proxies/{proxyId}/overrides/{overrideId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Migration from Legacy Override Fields
Prior to the overrides table, proxies accepted three flat fields: proxyAdditionalHeaders, proxyAdditionalQueryParams, and proxyAdditionalData. These were applied unconditionally to every request.
If you are upgrading from a version that used the legacy flat fields, run the migrate-proxy-overrides script before deploying the updated global stack. The script reads each proxy's existing proxyAdditional* values, creates a single all-mode override record per proxy in the new overrides table, and removes the old fields from both the control-plane and regional proxy records.
During the migration window, the runtime includes a backward-compatibility fallback: if a proxy has no override records in the new table, the runtime checks the proxy record for the old proxyAdditional* fields and applies them directly. This ensures zero downtime between stack deployment and migration script execution.