API Reference

Log Redaction

Redact sensitive data (PII, secrets, credentials) from log entries and text

Automatically detect and mask sensitive data in log entries, error messages, and text content. Log redaction identifies email addresses, credit card numbers, IP addresses, API keys, and other PII patterns, replacing them with safe placeholders. Essential for GDPR compliance, SOC 2 audits, and secure logging practices.

PII detectioncredit card maskingIP address redactioncustom patterns

Endpoint

POST /v1/text/redact
Authentication: Include your API key in the X-API-Key header with every request. All requests go through the API gateway which handles authentication, rate limiting, and usage tracking.
Open Swagger UI (interactive docs)

Request

{
  "text": "User john@example.com logged in from 192.168.1.100 with card 4111-1111-1111-1111"
}

Request Fields

FieldTypeDescription
text string Text content to analyze

Response

{
  "redacted": "User [EMAIL] logged in from [IP_ADDRESS] with card [CREDIT_CARD]",
  "detections": [
    {
      "type": "EMAIL",
      "count": 1
    },
    {
      "type": "IP_ADDRESS",
      "count": 1
    },
    {
      "type": "CREDIT_CARD",
      "count": 1
    }
  ],
  "totalRedactions": 3
}

Response Fields

FieldTypeDescription
redacted string Field value
detections array Array of items
totalRedactions integer Field value

Error Codes

StatusMeaning
200Request completed successfully
400Bad request — invalid or missing parameters
401Missing or invalid X-API-Key header
429Rate limit exceeded — check Retry-After header
500Internal server error

Common Error Scenarios

400 Empty log content

Request that triggers this:

{"log": ""}

Error response:

{"type": "/problems/validation-error", "title": "Empty Log", "status": 400, "detail": "Log content cannot be empty"}

How to fix: Provide non-empty log content to redact.

413 Log too large

Request that triggers this:

{"log": "[very large log > 100MB]"}

Error response:

{"type": "/problems/payload-too-large", "title": "Payload Too Large", "status": 413, "detail": "Log exceeds maximum size of 100MB"}

How to fix: Split large logs into multiple requests or increase batch size limits.

Code Examples

curl -X POST /v1/text/redact \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "text": "User john@example.com logged in from 192.168.1.100 with card 4111-1111-1111-1111"
}' 
// Node.js (18+) or modern browser
const response = await fetch("/v1/text/redact", {
  method: "POST",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "text": "User john@example.com logged in from 192.168.1.100 with card 4111-1111-1111-1111"
}),
});

const data = await response.json();
console.log(response.status, data);
import requests

response = requests.post(
    "/v1/text/redact",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
    "text": "User john@example.com logged in from 192.168.1.100 with card 4111-1111-1111-1111"
},
)

print(response.status_code)
print(response.json())
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "text": "User john@example.com logged in from 192.168.1.100 with card 4111-1111-1111-1111"
}`)
	req, _ := http.NewRequest("POST", "/v1/text/redact", body)
	req.Header.Set("X-API-Key", "YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	data, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.StatusCode)
	fmt.Println(string(data))
}
{
  "name": "log_redaction",
  "description": "Redact sensitive data (PII, secrets, credentials) from log entries and text",
  "inputSchema": {
    "type": "object",
    "properties": {
      "api_key": {"type": "string", "description": "Your Orovai API key"},
      "request": {"type": "object", "description": "Request body"}
    },
    "required": ["api_key", "request"]
  },
  "endpoint": "/v1/text/redact",
  "method": "POST",
  "headers": {
    "X-API-Key": "{{api_key}}",
    "Content-Type": "application/json"
  }
}

API Reference