Key Concepts
Request ID
Every proof generation requires a unique Request ID (UUID) to track and retrieve the proof. You can generate one using:Proof Subscription
Proofs are delivered asynchronously via Server-Sent Events (SSE). You’ll need to establish a connection to receive proofs as they’re generated.Core Endpoints
Proxy Endpoint (/proxy)
This endpoint forwards your requests to target APIs while generating proofs.
You can use any HTTP method to call this endpoint, such as GET, POST, PUT, DELETE, etc.
Required Headers:
T-PROXY-URL: The target API URL you want to callT-REQUEST-ID: Your generated UUID for tracking the proofT-REDACTED(optional): Comma-separated list of fields to redactT-PROVE-FAILED-REQ(optional): If set to true, the proof will be generated even if the request fails
Redaction Syntax:
TheT-REDACTED header allows you to specify which parts of the request and response should be redacted from the generated proofs. Understanding the syntax is crucial for effectively protecting sensitive information while maintaining the integrity of your proofs. Below is a detailed explanation of each redaction pattern you can use:
-
req:body:fieldName
Redact a specific field in the request body.
ReplacefieldNamewith the exact name of the field you want to redact.
Example:
req:body:password
This will redact thepasswordfield from the request body. -
req:header:headerName
Redact a specific header in the request.
ReplaceheaderNamewith the name of the header you wish to redact.
Example:
req:header:Authorization
This will redact theAuthorizationheader from the request. -
res:body:fieldName
Redact a specific field in the response body.
ReplacefieldNamewith the name of the field you want to redact.
Example:
res:body:creditCardNumber
This will redact thecreditCardNumberfield from the response body. -
res:header:headerName
Redact a specific header in the response.
ReplaceheaderNamewith the name of the header you wish to redact.
Example:
res:header:Set-Cookie
This will redact theSet-Cookieheader from the response. -
res:query:queryName
Redact a specific query parameter in the response URL.
ReplacequeryNamewith the name of the query parameter you want to redact.
Example:
res:query:userId
This will redact theuserIdquery parameter from the response URL. -
res:path:PathIndex
Redact a specific segment of the response URL path based on its position.
ReplacePathIndexwith the numerical position of the path segment you wish to redact, starting from 1.
Example:
res:path:2
If the response URL ishttps://api.example.com/users/12345/profile,
res:path:2will redact12345from the path. -
search:substring
Redact all occurrences of a specific substring within the response.
Replacesubstringwith the exact phrase or word you want to redact.
Example:
search:secret
This will redact every instance of the word “secret” in the response content.
-
Combining Multiple Redactions: You can specify multiple redaction patterns by separating them with commas.
Example:
res:body:id,req:header:Authorization,search:password -
Order Matters: The redactions are applied in the order they are specified. Ensure that more general redactions (like
search) do not inadvertently redact intended data. - Testing Redactions: Before deploying, test your redaction patterns to ensure they effectively hide the desired information without affecting other parts of the data.
Proof Subscription (/proof/{requestId})
Subscribe to receive proofs for a specific request ID via SSE.
Basic POST Request
Simple GET Request
Subscribing to Proofs
Best Practices
- Always Generate Fresh UUIDs: Use a new UUID for each proof request to avoid collisions.
- Subscribe First: Set up your SSE connection before making the proxy request.
- Handle Timeouts: Implement appropriate timeout handling for both proxy requests and SSE connections.
- Redact Sensitive Data: Use the
T-REDACTEDheader to protect sensitive information from TLS proofs while maintaining proof validity. - Error Handling: The API uses standard HTTP status codes:
- 200: Successful request
- 400: Bad request (invalid headers or body)
- 404: Target API not found
- 500: Server error

