Delete Masking Report

DELETEhttps://api.captain.dev/v2/jobs/:job_id/pii

Permanently delete a job's PII masking report before its automatic 90-day expiry. Later GET calls return 410 with deleted_at; the report is never regenerated. Refused while the job is still running. Requires a key with the index permission.

Path parameters

job_idstringRequired

ID of the job whose masking report to act on, as returned by the indexing endpoint that started it.

Response

Successful Response

job_idstring
deletedboolean
deleted_atstring

When the report was destroyed (RFC3339).

objects_deletedinteger

Errors

DELETE/v2/jobs/:job_id/pii
import requests
import json

BASE_URL = "https://api.captain.dev"
API_KEY = "your_api_key"
JOB_ID = "job_01HZP5G8N3"

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

response = requests.delete(
    f"{BASE_URL}/v2/jobs/{JOB_ID}/pii",
    headers=headers,
    timeout=30.0
)

if response.status_code == 200:
    data = response.json()
    print(f"Deleted {data['objects_deleted']} object(s) at {data['deleted_at']}")
else:
    print(f"Error: {response.status_code} {response.json().get('code')}")
200
{
  "job_id": "job_01HZP5G8N3",
  "deleted": true,
  "deleted_at": "2025-01-21T14:02:11Z",
  "objects_deleted": 1
}
Was this page helpful?