RequestRocketRequestRocketDocs
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

MethodEndpointDescription
GET/api/clients/{clientId}/proxies/{proxyId}/requestsList 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, status/method/path filtering, and cursor-based pagination. Results are returned newest-first.

Request

GET /api/clients/{clientId}/proxies/{proxyId}/requests?pageSize=100&processedAfter=2024-01-01T00:00:00Z HTTP/1.1
Host: api.requestrocket.com
Authorization: {user_token}

Query Parameters

ParameterTypeRequiredDefaultDescription
processedAfterstringNoFilter to requests processed after this time (ISO 8601 or Unix timestamp)
processedBeforestringNoFilter to requests processed before this time (ISO 8601 or Unix timestamp)
anyStatusnumberNoReturn requests where proxyData.status or targetData.status equals this HTTP status code
proxyStatusnumberNoReturn requests where proxyData.status equals this HTTP status code
targetStatusnumberNoReturn requests where targetData.status equals this HTTP status code
methodstringNoFilter by HTTP method (case-insensitive). One of GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD, TRACE
pathPrefixstringNoFilter to requests where proxyData.apiPath begins with this value (e.g. /api/v1)
pageSizenumberNo100Number of results per page. Maximum 1000
nextTokenstringNoPagination cursor returned by a previous response. Pass this to fetch the next page

Filtering tips:

  • Use anyStatus=429 to find all rate-limited requests regardless of which layer returned the status.
  • Use proxyStatus=200 combined with targetStatus=500 in separate requests to distinguish gateway successes from upstream failures.
  • pathPrefix is a prefix match — /api/v1 matches /api/v1/users and /api/v1/orders.
  • processedAfter and processedBefore accept ISO 8601 strings (2026-06-01T00:00:00Z) or Unix timestamps in seconds or milliseconds.

Response

{
  "message": "Success",
  "totalRequests": 100,
  "nextToken": "eyJwS2V5IjoiNmY0MDRiOWUtNjY5Zi00YjZmLTk4YWYtMGM4YTliMDJjNTk0IiwiaW5kZXgiOnsicEtleSI6IjZmNDA0YjllLTY2OWYtNGI2Zi05OGFmLTBjOGE5YjAyYzU5NCIsInByb2Nlc3NlZEF0IjoxNzY1NTE3MjE3NjIxfX0=",
  "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

FieldTypeDescription
messagestringResponse message
totalRequestsnumberNumber of requests returned in this page
nextTokenstring | absentPagination cursor. Present when more results exist; pass as nextToken query param to fetch the next page
requestsarrayArray of request objects, newest first
requests[].pKeystringProxy ID
requests[].sKeystringRequest ID (unique identifier for this request)
requests[].userIdstringUser who made the request
requests[].clientIdstringClient (organisation) ID
requests[].parentIdstringParent resource ID (typically the proxy ID)
requests[].processedbooleanWhether the request has been fully processed
requests[].processedAtnumberUnix timestamp (milliseconds) when request was received by proxy
requests[].TTLnumberTime-to-live (Unix timestamp) for when this log entry expires
proxyDataobjectData about the proxy stage of the request
proxyData.stagestringDeployment stage (e.g., "qas", "prod")
proxyData.methodstringHTTP method (GET, POST, etc.)
proxyData.apiPathstringRequest path
proxyData.receivedAtnumberTimestamp when proxy received the request
proxyData.sentAtnumberTimestamp when proxy sent response
proxyData.durationnumberProxy processing duration (seconds)
proxyData.statusnumberHTTP status code returned by proxy
proxyData.messagestringProxy message (e.g., "Request logged", error messages)
proxyData.apiHeadersobjectRequest headers received by proxy
proxyData.apiParamsobjectQuery parameters received by proxy
targetDataobjectData about the target API request
targetData.sentAtnumberTimestamp when request was sent to target
targetData.receivedAtnumberTimestamp when response received from target
targetData.durationnumberTarget API response time (seconds)
targetData.statusnumberHTTP status code from target API
targetData.locationstringTarget API location/region
validationDataobjectValidation checks performed on the request
validationData.proxyExistsbooleanProxy configuration exists
validationData.proxyActivebooleanProxy is active
validationData.proxyAuthenticatedbooleanProxy authentication succeeded
validationData.proxyScopeValidbooleanRequest passed proxy rule checks
validationData.targetExistsbooleanTarget configuration exists
validationData.targetScopeValidbooleanRequest passed target rule checks
validationData.requestValidbooleanOverall request validation passed
validationData.requestSentbooleanRequest was sent to target
validationData.responseReceivedbooleanResponse received from target

Understanding Request Flow:

  • proxyData shows how the proxy handled the request
  • targetData shows the target API's response (null if request didn't reach target)
  • validationData provides detailed validation checks that can help diagnose failures

Example

// Fetch the first page of 500 error requests from the past week
let url = `https://api.requestrocket.com/api/clients/${clientId}/proxies/${proxyId}/requests`;
const params = new URLSearchParams({
  processedAfter: new Date(Date.now() - 7 * 86400_000).toISOString(),
  anyStatus: '500',
  pageSize: '100',
});

const allRequests = [];

while (url) {
  const response = await fetch(`${url}?${params}`, {
    headers: { 'Authorization': process.env.USER_TOKEN }
  });
  const data = await response.json();
  allRequests.push(...data.requests);

  if (data.nextToken) {
    params.set('nextToken', data.nextToken);
  } else {
    break;
  }
}

console.log(`Total 500 errors fetched: ${allRequests.length}`);
import requests
from datetime import datetime, timedelta
import os

client_id = "your-client-id"
proxy_id = "your-proxy-id"
base_url = f'https://api.requestrocket.com/api/clients/{client_id}/proxies/{proxy_id}/requests'
headers = {'Authorization': os.getenv('USER_TOKEN')}

params = {
    'processedAfter': (datetime.now() - timedelta(days=7)).isoformat(),
    'anyStatus': 500,
    'pageSize': 100,
}

all_requests = []
while True:
    response = requests.get(base_url, params=params, headers=headers)
    data = response.json()
    all_requests.extend(data.get('requests', []))

    next_token = data.get('nextToken')
    if not next_token:
        break
    params['nextToken'] = next_token

print(f"Total 500 errors fetched: {len(all_requests)}")
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "net/url"
    "os"
    "time"
)

type Response struct {
    Requests      []map[string]interface{} `json:"requests"`
    TotalRequests int                      `json:"totalRequests"`
    NextToken     string                   `json:"nextToken"`
    Message       string                   `json:"message"`
}

func main() {
    clientId := "your-client-id"
    proxyId := "your-proxy-id"
    baseURL := fmt.Sprintf("https://api.requestrocket.com/api/clients/%s/proxies/%s/requests", clientId, proxyId)

    oneWeekAgo := time.Now().AddDate(0, 0, -7).Format(time.RFC3339)
    params := url.Values{
        "processedAfter": {oneWeekAgo},
        "anyStatus":      {"500"},
        "pageSize":       {"100"},
    }

    var allRequests []map[string]interface{}
    httpClient := &http.Client{}

    for {
        req, _ := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
        req.Header.Set("Authorization", os.Getenv("USER_TOKEN"))

        resp, _ := httpClient.Do(req)
        body, _ := io.ReadAll(resp.Body)
        resp.Body.Close()

        var result Response
        json.Unmarshal(body, &result)
        allRequests = append(allRequests, result.Requests...)

        if result.NextToken == "" {
            break
        }
        params.Set("nextToken", result.NextToken)
    }

    fmt.Printf("Total 500 errors fetched: %d\n", len(allRequests))
}
import java.net.http.*;
import java.net.URI;
import java.time.*;
import java.time.format.DateTimeFormatter;
import com.google.gson.*;
import java.util.*;

public class ListRequests {
    public static void main(String[] args) throws Exception {
        String clientId = "your-client-id";
        String proxyId = "your-proxy-id";
        String baseUrl = "https://api.requestrocket.com/api/clients/" + clientId + "/proxies/" + proxyId + "/requests";

        String oneWeekAgo = LocalDateTime.now().minusWeeks(1).format(DateTimeFormatter.ISO_DATE_TIME);

        HttpClient client = HttpClient.newHttpClient();
        List<JsonObject> allRequests = new ArrayList<>();
        String nextToken = null;

        do {
            String queryString = "?processedAfter=" + oneWeekAgo + "&anyStatus=500&pageSize=100";
            if (nextToken != null) queryString += "&nextToken=" + nextToken;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create(baseUrl + queryString))
                .header("Authorization", System.getenv("USER_TOKEN"))
                .GET()
                .build();

            HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
            JsonObject json = JsonParser.parseString(response.body()).getAsJsonObject();

            json.getAsJsonArray("requests").forEach(r -> allRequests.add(r.getAsJsonObject()));
            nextToken = json.has("nextToken") ? json.get("nextToken").getAsString() : null;
        } while (nextToken != null);

        System.out.println("Total 500 errors fetched: " + allRequests.size());
    }
}
# First page — 500 errors from the past week
curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}/requests?processedAfter=2026-06-01T00:00:00Z&anyStatus=500&pageSize=100" \
  -H "Authorization: ${USER_TOKEN}"

# Next page — pass the nextToken from the previous response
curl -X GET "https://api.requestrocket.com/api/clients/${CLIENT_ID}/proxies/${PROXY_ID}/requests?processedAfter=2026-06-01T00:00:00Z&anyStatus=500&pageSize=100&nextToken=eyJwS2V5Ijoi..." \
  -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}"

Next Steps

On this page