API Reference

Policies

Policies define which entity types to detect and how to handle them. Each organization starts with a default policy, and you can create custom policies for different use cases.

The Policy Object

json
{
  "id": "pol_abc123xyz",
  "name": "Customer Support Policy",
  "description": "Redact customer PII in support conversations",
  "entity_types": ["PERSON", "EMAIL", "PHONE", "SSN", "CREDIT_CARD"],
  "redaction_format": "token",
  "detection_mode": "balanced",
  "custom_patterns": [
    {
      "name": "CUSTOMER_ID",
      "pattern": "CUS-[A-Z]{2}[0-9]{6}",
      "description": "Internal customer identifier"
    }
  ],
  "is_default": false,
  "created_at": "2024-12-15T10:00:00Z",
  "updated_at": "2024-12-16T14:30:00Z"
}

List Policies

GET/api/policies

Returns a list of all policies for your organization.

Response

json
{
  "policies": [
    {
      "id": "pol_abc123",
      "name": "Default Policy",
      "is_default": true,
      "entity_types": ["PERSON", "EMAIL", "PHONE", "SSN"],
      "redaction_format": "token",
      "created_at": "2024-12-01T00:00:00Z"
    },
    {
      "id": "pol_xyz789",
      "name": "HIPAA Compliance",
      "is_default": false,
      "entity_types": ["PERSON", "MEDICAL_RECORD", "HEALTH_PLAN", "SSN"],
      "redaction_format": "hash",
      "created_at": "2024-12-10T00:00:00Z"
    }
  ]
}

Create Policy

POST/api/policies

Creates a new PII detection policy.

Request Body

json
{
  "name": "Financial Services Policy",
  "description": "Protect financial data in banking applications",
  "entity_types": [
    "PERSON",
    "SSN",
    "CREDIT_CARD",
    "BANK_ACCOUNT",
    "ROUTING_NUMBER",
    "IBAN"
  ],
  "redaction_format": "hash",
  "detection_mode": "thorough"
}

Response

json
{
  "id": "pol_new123",
  "name": "Financial Services Policy",
  "description": "Protect financial data in banking applications",
  "entity_types": ["PERSON", "SSN", "CREDIT_CARD", "BANK_ACCOUNT", "ROUTING_NUMBER", "IBAN"],
  "redaction_format": "hash",
  "detection_mode": "thorough",
  "is_default": false,
  "created_at": "2024-12-16T15:00:00Z",
  "updated_at": "2024-12-16T15:00:00Z"
}

Update Policy

PATCH/api/policies/{policy_id}

Updates an existing policy. Only specified fields are updated.

Parameters

ParameterTypeDescription
policy_idstringrequiredThe policy ID to update

Request Body

json
{
  "name": "Updated Policy Name",
  "entity_types": ["PERSON", "EMAIL", "PHONE"]
}

Response

json
{
  "id": "pol_abc123",
  "name": "Updated Policy Name",
  "entity_types": ["PERSON", "EMAIL", "PHONE"],
  "redaction_format": "token",
  "updated_at": "2024-12-16T16:00:00Z"
}

Delete Policy

DELETE/api/policies/{policy_id}

Deletes a policy. The default policy cannot be deleted.

Parameters

ParameterTypeDescription
policy_idstringrequiredThe policy ID to delete

Response

json
{
  "success": true,
  "message": "Policy deleted successfully"
}

Policy Templates

Get pre-configured policy templates for common use cases:

GET/api/policies/templates

Returns 5 pre-configured policy templates.

Response

json
{
  "templates": [
    {
      "id": "general",
      "name": "General Purpose",
      "description": "Broad PII protection for general applications",
      "entity_types": ["PERSON", "EMAIL", "PHONE", "SSN", "ADDRESS"]
    },
    {
      "id": "healthcare",
      "name": "Healthcare / HIPAA",
      "description": "HIPAA-compliant medical data protection",
      "entity_types": ["PERSON", "MEDICAL_RECORD", "HEALTH_PLAN", "SSN", "DOB"]
    },
    {
      "id": "financial",
      "name": "Financial Services",
      "description": "Financial data and PCI-DSS compliance",
      "entity_types": ["PERSON", "SSN", "CREDIT_CARD", "BANK_ACCOUNT", "IBAN"]
    },
    {
      "id": "minimal",
      "name": "Minimal",
      "description": "Core identifiers only",
      "entity_types": ["SSN", "CREDIT_CARD"]
    },
    {
      "id": "comprehensive",
      "name": "Comprehensive",
      "description": "Maximum protection with all entity types",
      "entity_types": ["ALL"]
    }
  ]
}

Available Entity Types

Get the complete list of 105+ supported entity types:

GET/api/policies/entity-types

Returns all available entity types organized by category.

Response

json
{
  "categories": {
    "identity": ["PERSON", "SSN", "PASSPORT", "DRIVERS_LICENSE", "DOB"],
    "contact": ["EMAIL", "PHONE", "ADDRESS", "ZIP_CODE"],
    "financial": ["CREDIT_CARD", "BANK_ACCOUNT", "IBAN", "ROUTING_NUMBER"],
    "medical": ["MEDICAL_RECORD", "HEALTH_PLAN", "NPI", "DEA_NUMBER"],
    "location": ["ADDRESS", "COORDINATES", "IP_ADDRESS"],
    "technical": ["API_KEY", "PASSWORD", "AWS_KEY", "GITHUB_TOKEN"],
    "organization": ["ORG", "GPE", "COMPANY_ID"],
    "compliance": ["GDPR_ID", "CCPA_ID", "HIPAA_ID"]
  },
  "total_count": 105
}

Using Policies in Requests

Specify a policy for each request using the X-NeuronEdge-Policy header:

bash
curl -X POST https://api.neuronedge.ai/v1/openai/chat/completions \
  -H "Authorization: Bearer ne_live_your_api_key" \
  -H "X-Provider-API-Key: sk-your-openai-key" \
  -H "X-NeuronEdge-Policy: pol_xyz789" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.2", "messages": [...]}'

If no policy is specified, your organization's default policy is used.