API ReferenceCore API
Requests API
Query request history and monitor API usage for specific proxies
Requests API
Query request history and monitor API usage for individual proxies. Request logs are stored regionally based on the proxy's region.
Requests are stored in the same region as the proxy that processed them, ensuring data sovereignty and compliance.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/clients/{clientId}/proxies/{proxyId}/requests | List all requests for a proxy |
| GET | /api/clients/{clientId}/proxies/{proxyId}/requests/{requestId} | Get specific request details |
Only GET requests are supported. Request logs are read-only.
List Requests
Get request history for a specific proxy with optional date filtering.
Request
GET /api/clients/{clientId}/proxies/{proxyId}/requests?limit=100&processedAfter=2024-01-01T00:00:00Z HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | No | Maximum number of requests to return (default: 1000) |
processedAfter | string | No | Filter requests processed after this timestamp (ISO 8601) |
processedBefore | string | No | Filter requests processed before this timestamp (ISO 8601) |
Response
{
"message": "Success",
"totalRequests": 8,
"requests": [
{
"pKey": "6f404b9e-669f-4b6f-98af-0c8a9b02c594",
"sKey": "cbe4b932-262b-4b05-8fee-2a8809709a7f",
"userId": "c95e5458-10a1-7024-e88f-32a6548152f5",
"clientId": "c320b7e5-cf17-4e95-8cd7-eb5cee65d6b9",
"parentId": "c320b7e5-cf17-4e95-8cd7-eb5cee65d6b9",
"processed": false,
"processedAt": 1765517217621,
"TTL": 1773293219,
"proxyData": {
"stage": "qas",
"method": "GET",
"apiPath": "/cat",
"receivedAt": 1765517217621,
"sentAt": 1765517219616,
"duration": 1.995,
"status": 200,
"message": "Request logged",
"arnBase": "",
"apiHeaders": {
"user-agent": "PostmanRuntime/7.49.1",
"accept": "image/*",
"cache-control": "no-cache"
},
"apiParams": {
"position": "center"
}
},
"targetData": {
"sentAt": 1765517217764,
"receivedAt": 1765517219616,
"duration": 1.852,
"status": 200,
"location": null
},
"validationData": {
"proxyExists": true,
"proxyActive": true,
"proxyAuthenticated": true,
"proxyCredentialExists": true,
"proxyCredentialActive": true,
"proxyCredentialRelationship": true,
"proxyCredentialScopeValid": true,
"proxyScopeValid": true,
"targetExists": true,
"targetRelationship": true,
"targetScopeValid": true,
"targetCredentialExists": true,
"targetCredentialActive": true,
"targetCredentialRelationship": true,
"targetCredentialScopeValid": true,
"requestValid": true,
"requestSent": true,
"responseReceived": true,
"systemError": false,
"requestConfigError": false
}
}
]
}Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Response message |
totalRequests | number | Number of requests returned |
requests | array | Array of request objects |
requests[].pKey | string | Proxy ID |
requests[].sKey | string | Request ID (unique identifier for this request) |
requests[].userId | string | User who made the request |
requests[].clientId | string | Client (organisation) ID |
requests[].parentId | string | Parent resource ID (typically the proxy ID) |
requests[].processed | boolean | Whether the request has been fully processed |
requests[].processedAt | number | Unix timestamp (milliseconds) when request was received by proxy |
requests[].TTL | number | Time-to-live (Unix timestamp) for when this log entry expires |
proxyData | object | Data about the proxy stage of the request |
proxyData.stage | string | Deployment stage (e.g., "qas", "prod") |
proxyData.method | string | HTTP method (GET, POST, etc.) |
proxyData.apiPath | string | Request path |
proxyData.receivedAt | number | Timestamp when proxy received the request |
proxyData.sentAt | number | Timestamp when proxy sent response |
proxyData.duration | number | Proxy processing duration (seconds) |
proxyData.status | number | HTTP status code returned by proxy |
proxyData.message | string | Proxy message (e.g., "Request logged", error messages) |
proxyData.apiHeaders | object | Request headers received by proxy |
proxyData.apiParams | object | Query parameters received by proxy |
targetData | object | Data about the target API request |
targetData.sentAt | number | Timestamp when request was sent to target |
targetData.receivedAt | number | Timestamp when response received from target |
targetData.duration | number | Target API response time (seconds) |
targetData.status | number | HTTP status code from target API |
targetData.location | string | Target API location/region |
validationData | object | Validation checks performed on the request |
validationData.proxyExists | boolean | Proxy configuration exists |
validationData.proxyActive | boolean | Proxy is active |
validationData.proxyAuthenticated | boolean | Proxy authentication succeeded |
validationData.proxyScopeValid | boolean | Request passed proxy rule checks |
validationData.targetExists | boolean | Target configuration exists |
validationData.targetScopeValid | boolean | Request passed target rule checks |
validationData.requestValid | boolean | Overall request validation passed |
validationData.requestSent | boolean | Request was sent to target |
validationData.responseReceived | boolean | Response received from target |
Understanding Request Flow:
proxyDatashows how the proxy handled the requesttargetDatashows the target API's response (null if request didn't reach target)validationDataprovides detailed validation checks that can help diagnose failures
Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}/requests?limit=100&processedAfter=2024-01-15T00:00:00Z`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
console.log(`Found ${data.totalRequests} requests`);
if (data.limitReached) {
console.log('Warning: More requests available, results were truncated');
}import requests
from datetime import datetime, timedelta
import os
# Get requests from last week
one_week_ago = (datetime.now() - timedelta(days=7)).isoformat()
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}/requests',
params={
'limit': 100,
'processedAfter': one_week_ago
},
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
print(f"Found {data['totalRequests']} requests")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"time"
)
type Response struct {
Requests []map[string]interface{} `json:"requests"`
TotalRequests int `json:"totalRequests"`
LimitReached bool `json:"limitReached"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
proxyId := "your-proxy-id"
// Get requests from last week
oneWeekAgo := time.Now().AddDate(0, 0, -7).Format(time.RFC3339)
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s/requests?limit=100&processedAfter=%s",
clientId, proxyId, oneWeekAgo)
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 requests\n", result.TotalRequests)
if result.LimitReached {
fmt.Println("Warning: More requests available, results were truncated")
}
}import java.net.http.*;
import java.net.URI;
import java.time.*;
import java.time.format.DateTimeFormatter;
import com.google.gson.*;
public class ListRequests {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String proxyId = "your-proxy-id";
// Get requests from last week
LocalDateTime oneWeekAgo = LocalDateTime.now().minusWeeks(1);
String formattedDate = oneWeekAgo.format(DateTimeFormatter.ISO_DATE_TIME);
String url = String.format(
"https://api.requestrocket.com/api/clients/%s/proxies/%s/requests?limit=100&processedAfter=%s",
clientId, proxyId, formattedDate
);
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", System.getenv("USER_TOKEN"))
.GET()
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();
int totalRequests = json.get("totalRequests").getAsInt();
boolean limitReached = json.get("limitReached").getAsBoolean();
System.out.println("Found " + totalRequests + " requests");
if (limitReached) {
System.out.println("Warning: More requests available, results were truncated");
}
}
}# Get last 100 requests from the past week
curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}/requests?limit=100&processedAfter=2024-01-15T00:00:00Z" \
-H "Authorization: ${USER_TOKEN}"Get Request Details
Get detailed information about a specific request.
Request
GET /api/clients/{clientId}/proxies/{proxyId}/requests/{requestId} HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}Response
{
"message": "Success",
"requests": [
{
"pKey": "550e8400-e29b-41d4-a716-446655440000",
"sKey": "req_123e4567",
"method": "POST",
"path": "/api/users",
"statusCode": 201,
"duration": 245,
"processedAt": 1706025600000,
"requestHeaders": {
"Content-Type": "application/json",
"Authorization": "[REDACTED]"
},
"requestBody": {
"name": "John Doe",
"email": "john@example.com"
},
"responseHeaders": {
"requestrocket-proxy-code": "proxy-access-granted",
"Content-Type": "application/json"
},
"responseBody": {
"id": "usr_789",
"name": "John Doe",
"created": "2024-01-23T10:00:00Z"
}
}
]
}Sensitive headers like Authorization are redacted in request logs for security.
Example
const response = await fetch(
`https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}/requests/${requestId}`,
{
headers: {
'Authorization': process.env.USER_TOKEN
}
}
);
const data = await response.json();
const request = data.requests[0];
console.log(`Request: ${request.method} ${request.path}`);
console.log(`Status: ${request.statusCode}, Duration: ${request.duration}ms`);import requests
import os
client_id = "your-client-id"
proxy_id = "your-proxy-id"
request_id = "your-request-id"
response = requests.get(
f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}/requests/{request_id}',
headers={'Authorization': os.getenv('USER_TOKEN')}
)
data = response.json()
req = data['requests'][0]
print(f"Request: {req['method']} {req['path']}")
print(f"Status: {req['statusCode']}, Duration: {req['duration']}ms")package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
type Response struct {
Requests []map[string]interface{} `json:"requests"`
Message string `json:"message"`
}
func main() {
clientId := "your-client-id"
proxyId := "your-proxy-id"
requestId := "your-request-id"
url := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s/requests/%s",
clientId, proxyId, requestId)
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)
request := result.Requests[0]
fmt.Printf("Request: %v %v\n", request["method"], request["path"])
fmt.Printf("Status: %v, Duration: %vms\n", request["statusCode"], request["duration"])
}import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
public class GetRequestDetails {
public static void main(String[] args) throws Exception {
String clientId = "your-client-id";
String proxyId = "your-proxy-id";
String requestId = "your-request-id";
String url = String.format(
"https://api.requestrocket.com/api/clients/%s/proxies/%s/requests/%s",
clientId, proxyId, requestId
);
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.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 requests = json.getAsJsonArray("requests");
JsonObject req = requests.get(0).getAsJsonObject();
System.out.println("Request: " + req.get("method").getAsString() + " " + req.get("path").getAsString());
System.out.println("Status: " + req.get("statusCode").getAsInt() + ", Duration: " + req.get("duration").getAsInt() + "ms");
}
}curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}/requests/${REQUEST_ID}" \
-H "Authorization: ${USER_TOKEN}"