Skip to main content
GET
/
v1
/
tunnels
/
:tunnelId
/
requests
Get Request Logs
curl --request GET \
  --url https://api.example.com/v1/tunnels/:tunnelId/requests
{
  "ingestedAt": "<string>",
  "startedAt": "<string>",
  "method": "<string>",
  "path": "<string>",
  "statusCode": 123,
  "durationMs": 123,
  "responseBytes": {},
  "error": true,
  "protocol": "<string>",
  "code": "<string>",
  "message": "<string>",
  "details": {}
}

Authentication

Requires a valid access token in the Authorization header.

Path Parameters

tunnelId
string
required
The UUID of the tunnel to retrieve request logs for. Must belong to the authenticated user.

Query Parameters

after
string
ISO 8601 timestamp to retrieve logs after this time (exclusive). Defaults to returning the most recent logs if not specified.
limit
integer
Maximum number of logs to return. Must be between 1 and 500. Defaults to 200.

Response

Returns an array of request log entries ordered by ingestion time (most recent first).
ingestedAt
string
ISO 8601 timestamp when the log entry was ingested by the API.
startedAt
string
ISO 8601 timestamp when the request started.
method
string
HTTP method (e.g., “GET”, “POST”, “PUT”).
path
string
Request path (e.g., “/api/users”).
statusCode
integer
HTTP status code (e.g., 200, 404, 500).
durationMs
number
Request duration in milliseconds.
responseBytes
integer | null
Number of bytes in the response body, or null if unavailable.
error
boolean
Whether the request resulted in an error.
protocol
string
Protocol used: either "http" or "ws" (WebSocket).
Request logs are retained for 24 hours. Logs older than 24 hours are automatically pruned.
Use the after parameter to paginate through logs by passing the ingestedAt timestamp of the last log from the previous response.

Example Request

curl -X GET "https://api.rs-tunnel.example.com/v1/tunnels/550e8400-e29b-41d4-a716-446655440000/requests?limit=100" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Example Response

[
  {
    "ingestedAt": "2024-03-15T10:32:45.123Z",
    "startedAt": "2024-03-15T10:32:44.890Z",
    "method": "GET",
    "path": "/api/users",
    "statusCode": 200,
    "durationMs": 42.5,
    "responseBytes": 1024,
    "error": false,
    "protocol": "http"
  },
  {
    "ingestedAt": "2024-03-15T10:32:45.100Z",
    "startedAt": "2024-03-15T10:32:44.850Z",
    "method": "POST",
    "path": "/api/orders",
    "statusCode": 500,
    "durationMs": 150.2,
    "responseBytes": null,
    "error": true,
    "protocol": "http"
  },
  {
    "ingestedAt": "2024-03-15T10:32:44.980Z",
    "startedAt": "2024-03-15T10:32:44.700Z",
    "method": "GET",
    "path": "/ws",
    "statusCode": 101,
    "durationMs": 1250.8,
    "responseBytes": 8192,
    "error": false,
    "protocol": "ws"
  }
]

Error Responses

code
string
Error code identifier.
message
string
Human-readable error message.
details
unknown
Additional error details, if available.

Common Errors

  • 400 INVALID_TUNNEL_ID: Tunnel identifier is missing or malformed
  • 400 INVALID_INPUT: Invalid after timestamp format
  • 404 TUNNEL_NOT_FOUND: The tunnel does not exist or does not belong to the authenticated user
  • 401 UNAUTHORIZED: Missing or invalid access token

Build docs developers (and LLMs) love