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"
    }
  ]
}

List Redactions

Retrieve all redaction rules configured for an account.

Path Parameters

accountSid
string
required
Account identifier (format: acc_ followed by 27 alphanumeric characters)

Headers

Authorization
string
required
Bearer token for authentication

Response

hasMore
boolean
Indicates if there are more records to paginate through
records
array
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

accountSid
string
required
Account identifier
redactionSid
string
required
Redaction rule identifier

Headers

Authorization
string
required
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

accountSid
string
required
Account identifier

Headers

Authorization
string
required
Bearer token for authentication

Request Body

name
string
required
Name of the redaction rule
description
string
Description of what this rule redacts
fieldPath
string
required
JSON path to the field to be redacted (e.g., $.password, $.user.email)
redactionType
string
required
Type of redaction: mask, remove, hash, or replace
replacementValue
string
Value to use when redactionType is replace
isActive
boolean
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

accountSid
string
required
Account identifier
redactionSid
string
required
Redaction rule identifier

Headers

Authorization
string
required
Bearer token for authentication

Request Body

name
string
required
Name of the redaction rule
description
string
Description of what this rule redacts
fieldPath
string
required
JSON path to the field to be redacted
redactionType
string
required
Type of redaction: mask, remove, hash, or replace
replacementValue
string
Value to use when redactionType is replace
isActive
boolean
required
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

accountSid
string
required
Account identifier
redactionSid
string
required
Redaction rule identifier

Headers

Authorization
string
required
Bearer token for authentication

Response

sid
string
ID of the deleted redaction rule
deleted
boolean
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.comj***@*******.com
  • 41111111111111114***********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