List Redactions
Retrieve all redaction rules configured for an account.
Path Parameters
Account identifier (format: acc_
followed by 27 alphanumeric characters)
Bearer token for authentication
Response
Indicates if there are more records to paginate through
Unique redaction rule identifier
Account identifier this redaction belongs to
Name of the redaction rule
Description of what this rule redacts
JSON path to the field to be redacted
Type of redaction: mask
, remove
, hash
, replace
Value to use when redactionType is replace
(nullable)
Whether this redaction rule is currently active
ISO 8601 timestamp of rule creation
curl -X GET "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/redactions" \
-H "Authorization: Bearer your-jwt-token"
{
"hasMore": false,
"records": [
{
"sid": "red_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"name": "Password Redaction",
"description": "Redacts password fields from request bodies",
"fieldPath": "$.password",
"redactionType": "mask",
"replacementValue": null,
"isActive": true,
"createdAt": "2023-12-01T10:30:00.000Z"
},
{
"sid": "red_xyz789uvw012rst345abc",
"accountSid": "acc_abc123def456ghi789jkl012",
"name": "Credit Card Masking",
"description": "Masks credit card numbers",
"fieldPath": "$.payment.cardNumber",
"redactionType": "mask",
"replacementValue": null,
"isActive": true,
"createdAt": "2023-12-01T11:15:00.000Z"
}
]
}
Get Redaction
Retrieve details of a specific redaction rule.
Path Parameters
Redaction rule identifier
Bearer token for authentication
Response
Returns a single redaction object with the same structure as described in the List Redactions response.
curl -X GET "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/redactions/red_abc123def456ghi789jkl012" \
-H "Authorization: Bearer your-jwt-token"
{
"sid": "red_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"name": "Password Redaction",
"description": "Redacts password fields from request bodies",
"fieldPath": "$.password",
"redactionType": "mask",
"replacementValue": null,
"isActive": true,
"createdAt": "2023-12-01T10:30:00.000Z"
}
Create Redaction
Create a new redaction rule to protect sensitive data.
Path Parameters
Bearer token for authentication
Request Body
Name of the redaction rule
Description of what this rule redacts
JSON path to the field to be redacted (e.g., $.password
, $.user.email
)
Type of redaction: mask
, remove
, hash
, or replace
Value to use when redactionType is replace
Whether this redaction rule should be active (default: true)
Response
Returns the created redaction object.
curl -X POST "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/redactions" \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Email Redaction",
"description": "Masks email addresses in user data",
"fieldPath": "$.user.email",
"redactionType": "mask",
"isActive": true
}'
{
"sid": "red_new789uvw012rst345def",
"accountSid": "acc_abc123def456ghi789jkl012",
"name": "Email Redaction",
"description": "Masks email addresses in user data",
"fieldPath": "$.user.email",
"redactionType": "mask",
"replacementValue": null,
"isActive": true,
"createdAt": "2023-12-01T15:45:00.000Z"
}
Update Redaction
Update an existing redaction rule.
Path Parameters
Redaction rule identifier
Bearer token for authentication
Request Body
Name of the redaction rule
Description of what this rule redacts
JSON path to the field to be redacted
Type of redaction: mask
, remove
, hash
, or replace
Value to use when redactionType is replace
Whether this redaction rule should be active
Response
Returns the updated redaction object.
curl -X PUT "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/redactions/red_abc123def456ghi789jkl012" \
-H "Authorization: Bearer your-jwt-token" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Password Redaction",
"description": "Redacts all password fields from requests and responses",
"fieldPath": "$.password",
"redactionType": "remove",
"isActive": true
}'
{
"sid": "red_abc123def456ghi789jkl012",
"accountSid": "acc_abc123def456ghi789jkl012",
"name": "Updated Password Redaction",
"description": "Redacts all password fields from requests and responses",
"fieldPath": "$.password",
"redactionType": "remove",
"replacementValue": null,
"isActive": true,
"createdAt": "2023-12-01T10:30:00.000Z"
}
Delete Redaction
Delete a redaction rule.
Deleting a redaction rule will not affect previously redacted data, but new requests will no longer have this redaction applied.
Path Parameters
Redaction rule identifier
Bearer token for authentication
Response
ID of the deleted redaction rule
Flag indicating the redaction rule was successfully deleted
curl -X DELETE "https://api.apitraffic.io/v1/accounts/acc_abc123def456ghi789jkl012/redactions/red_abc123def456ghi789jkl012" \
-H "Authorization: Bearer your-jwt-token"
{
"sid": "red_abc123def456ghi789jkl012",
"deleted": true
}
Redaction Types
Mask
Replaces characters with asterisks while preserving format:
john@example.com
→ j***@*******.com
4111111111111111
→ 4***********1111
Remove
Completely removes the field from the data:
{"password": "secret123"}
→ {}
Hash
Replaces the value with a SHA-256 hash:
"secret123"
→ "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"
Replace
Replaces the value with a specified replacement:
"secret123"
→ "[REDACTED]"
(when replacementValue is "[REDACTED]"
)
JSON Path Examples
{
"password": "secret123"
}
// JSON Path: $.password