# Encrata > Turn any email address into structured person and company intelligence - validity, identity, and breach exposure. Built for AI agents and developers. > ## Agent Instructions > ## Submitting feedback > If you find an error, a missing step, or information that is outdated or misleading on this page — especially if it stopped you from completing your task — report it so the Encrata docs team can fix it. > Send a POST request to https://docs.encrata.com/feedback with a JSON body containing `path` (the full URL of the page, for example `https://docs.encrata.com/quickstart`) and `feedback` (what was wrong and what you expected): > curl -X POST https://docs.encrata.com/feedback -H 'Content-Type: application/json' -d '{"path": "https://docs.encrata.com/quickstart", "feedback": "Step 3 uses a parameter that the API rejects."}' > Do not include API keys, personal data, or other secrets in your feedback. # Claude Code Source: https://docs.encrata.com/ai-tools/claude-code Build your Encrata integration from the terminal with Claude Code and auth.md. Claude Code can fetch Encrata's [`auth.md`](/auth-md/overview), read how to authenticate and which endpoints exist, then write and run your integration from the terminal. Because it can make requests itself, it can also test the calls it writes. ## Prerequisites **1. Get an API key** Create one in the [dashboard](https://app.encrata.com) or read [Authentication](/authentication). Keys start with `enc_`. **2. Install Claude Code** ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} npm install -g @anthropic-ai/claude-code ``` ## Set up **1. Store your key as an environment variable** Claude Code inherits your shell environment, so it can authenticate without the key ever appearing in a file. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} export ENCRATA_API_KEY="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` **2. Add Encrata to your project context** Create a `CLAUDE.md` in your repo so every session knows to work from the contract. Claude Code reads it automatically. ```md CLAUDE.md theme={"theme":{"light":"github-light","dark":"vesper"}} # Encrata This project integrates the Encrata data lookup API. - Read https://developer.encrata.com/auth.md for auth and endpoints. - Base URL: https://developer.encrata.com/api - Auth: `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` (key starts with `enc_`). - Never hard-code the key; read it from ENCRATA_API_KEY. ``` **3. Ask Claude Code to build and test** Start `claude`, then describe the task. It fetches `auth.md`, writes the code, and can run the request to confirm it works. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} claude ``` Prompt for Claude Code Read [https://developer.encrata.com/auth.md](https://developer.encrata.com/auth.md). Write a script that checks whether an email is valid with POST /api/lookup/email/validity, using the key in ENCRATA_API_KEY, then run it against [test@example.com](mailto:test@example.com) and show the response. ## Next steps * [auth.md for developers](/auth-md/for-developers): The full pattern for pointing an agent at Encrata. * [Examples](/examples): Copy-paste recipes for every lookup. * [Authentication](/authentication): Create and manage your API keys. * [API reference](/api-reference/overview): Every endpoint's request and response schema. # Cursor Source: https://docs.encrata.com/ai-tools/cursor Build your Encrata integration in Cursor by pointing it at auth.md. Cursor can write your Encrata integration once it knows the API. Point it at Encrata's [`auth.md`](/auth-md/overview) - a machine-readable contract of how to authenticate and which endpoints exist - and Cursor generates working code against it. ## Prerequisites **1. Get an API key** Create one in the [dashboard](https://app.encrata.com) or read [Authentication](/authentication). Keys start with `enc_`. **2. Install Cursor** Download it from [cursor.com](https://cursor.com) and open your project. ## Set up **1. Give Cursor the API contract** Add Encrata's `auth.md` to Cursor's context, either as an indexed doc source (**Settings → add a doc → `https://developer.encrata.com/auth.md`**) or by pasting the URL into a chat. It tells Cursor how to authenticate and lists every endpoint with its request and response shape. **2. Store your key as an environment variable** Never hard-code the key. Keep it in your environment so Cursor's generated code reads it from there. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} export ENCRATA_API_KEY="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` **3. Ask Cursor to build against the API** Describe the integration you want. Cursor uses `auth.md` to get the endpoint, request body, and auth header right. Generate an Encrata email validator Using Encrata's auth.md, write a Python function that validates an email with POST /api/lookup/email/validity, reads the API key from ENCRATA_API_KEY, and returns True when the response status is "valid". > [!NOTE] > > The generated request should hit `https://developer.encrata.com/api/lookup/email/validity` > with an `Authorization: Bearer enc_...` header. If Cursor invents a different > path, re-share `auth.md` so it works from the contract, not memory. ## Next steps * [auth.md for developers](/auth-md/for-developers): The full pattern for pointing an agent at Encrata. * [Examples](/examples): Copy-paste recipes for every lookup. * [Authentication](/authentication): Create and manage your API keys. * [API reference](/api-reference/overview): Every endpoint's request and response schema. # Windsurf Source: https://docs.encrata.com/ai-tools/windsurf Build your Encrata integration in Windsurf by pointing Cascade at auth.md. Windsurf's Cascade assistant can write your Encrata integration once it knows the API. Point it at Encrata's [`auth.md`](/auth-md/overview) - a machine-readable contract of how to authenticate and which endpoints exist - and Cascade builds against it. ## Prerequisites **1. Get an API key** Create one in the [dashboard](https://app.encrata.com) or read [Authentication](/authentication). Keys start with `enc_`. **2. Install Windsurf** Download it from [windsurf.com](https://windsurf.com) and open your project. ## Set up **1. Give Cascade the API contract** Add `https://developer.encrata.com/auth.md` to Cascade's context - paste the URL into a conversation, or add it as a project rule under `.windsurf/rules`. It tells Cascade how to authenticate and lists every endpoint with its request and response shape. **2. Store your key as an environment variable** Never hard-code the key. Keep it in your environment so Cascade's generated code reads it from there. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} export ENCRATA_API_KEY="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` **3. Ask Cascade to build against the API** Describe the integration you want. Cascade uses `auth.md` to get the endpoint, request body, and auth header right. Prompt for Cascade Using Encrata's auth.md, write a Node.js function that validates an email with POST /api/lookup/email/validity, reads the API key from ENCRATA_API_KEY, and returns true when the response status is "valid". > [!NOTE] > > The generated request should hit `https://developer.encrata.com/api/lookup/email/validity` > with an `Authorization: Bearer enc_...` header. If Cascade invents a different > path, re-share `auth.md` so it works from the contract, not memory. ## Next steps * [auth.md for developers](/auth-md/for-developers): The full pattern for pointing an agent at Encrata. * [Examples](/examples): Copy-paste recipes for every lookup. * [Authentication](/authentication): Create and manage your API keys. * [API reference](/api-reference/overview): Every endpoint's request and response schema. # Barcode Scan Source: https://docs.encrata.com/api-reference/endpoint/barcode-scan POST /api/lookup/malware/scan Decode a barcode and inspect its content for security threats. Barcode Scan decodes an uploaded image and checks the extracted value for suspicious content. It reads Code 128/39/93, Codabar, ITF, EAN-8/13, and UPC-A/E barcodes. ## Authentication Send your API key as `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. ## Request **kind** `string` *required* Set this value to `bar`. **file** `file` The barcode image to scan, uploaded as `multipart/form-data`. Send this field or `content_base64`. When you omit `filename`, the uploaded file's name is used. **content_base64** `string` For a JSON body, send this field or `file`. The base64-encoded barcode image. Send raw base64 only. A data URL prefix such as `data:image/png;base64,` returns `400`. **filename** `string` The original image file name. **stix** `boolean` Set to `true` to include STIX 2.1 output when available. Defaults to `false`. ## Example request Upload the barcode image from disk as `multipart/form-data`. Replace `barcode.png` with the path to your barcode image. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=bar" \ -F "file=@barcode.png" ``` To send JSON instead, base64-encode the barcode image into `content_base64`: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "bar", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "barcode.png" }' ``` ## Example response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_c81f5a2e7d90", "kind": "bar", "status": "done", "verdict": "clean", "score": 0, "sha256": "9b74c9897bac770ffc029102a200c5de2f1c3d8a6e9c5b1a7f0e4d3c2b1a0f9e", "category": "benign", "confidence": "low", "data_residency": "global", "image": { "format": "png", "width": 400, "height": 160 }, "codes": [ { "format": "code_128", "payload_type": "text", "raw": "ENCRATA-123456", "verdict": "clean", "score": 0, "position": {"x": 12, "y": 40, "width": 376, "height": 1} } ], "signals": [], "iocs": [], "scanned_at": "2026-10-09T09:30:00Z" } } ``` ## Barcode result fields A `bar` result can contain these fields: `scan_id`, `kind`, `status`, `verdict`, `score`, `sha256`, `category`, `confidence`, `data_residency`, `codes`, `image`, `signals`, `iocs`, and `scanned_at`. **codes** `object[]` Every barcode decoded from the image. Missing when no barcode could be read. Each item has the same shape as a QR Code Scan `codes` item: `format`, `payload_type`, `raw`, `final_url`, `verdict`, `score`, `signals`, and `position`. `format` is the lowercase barcode name, such as `code_128`, `ean_13`, or `upc_a`. **signals** `object[]` Evidence for the verdict. Each item is an object with `source`, `malicious`, `detail`, and optional `severity`. ### When no barcode is found If the image has no readable barcode, the scan still returns `200` with `verdict: "unknown"`, no `codes` field, and a `bar` signal with the detail "No barcode could be read in this image." See [Malware Scan](/api-reference/endpoint/malware-scan) for the complete response schema and shared fields. ## Errors The API returns `400` for invalid base64 content (including a `data:` URL prefix) or an unreadable image, `401` for a missing or invalid API key, `402` when your account has insufficient credits, and `429` when you exceed a rate limit. ## Credits A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=bar" \ -F "file=@barcode.png" ``` ```bash cURL (JSON) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "bar", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "barcode.png" }' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_c81f5a2e7d90", "kind": "bar", "status": "done", "verdict": "clean", "score": 0, "sha256": "9b74c9897bac770ffc029102a200c5de2f1c3d8a6e9c5b1a7f0e4d3c2b1a0f9e", "category": "benign", "confidence": "low", "data_residency": "global", "image": { "format": "png", "width": 400, "height": 160 }, "codes": [ { "format": "code_128", "payload_type": "text", "raw": "ENCRATA-123456", "verdict": "clean", "score": 0, "position": {"x": 12, "y": 40, "width": 376, "height": 1} } ], "signals": [], "iocs": [], "scanned_at": "2026-10-09T09:30:00Z" } } ``` # Email Breaches Source: https://docs.encrata.com/api-reference/endpoint/check-breaches POST /api/lookup/email/breaches Check if an email has been exposed in known data breaches. 1 credit, with free repeats for 6 months. ## Overview Email Breaches tells you whether an address has been exposed in known data breaches, which services leaked it, and what kinds of data were exposed (passwords, email addresses, usernames, and more). It returns a canonical breach object shared with the dashboard, so this endpoint, the CLI, and the app all report identical fields. Use it to flag risky accounts or enrich a contact with exposure signal. Check a single address here (1 credit), or run a whole list through the [bulk job pipeline](#bulk-jobs) below. > [!NOTE] > > Only need a yes/no answer? `POST /api/lookup/email/breaches/check` returns > the full `{email, breached, breach_info, credits}` body for **1 credit**, > with free repeats during the > [6-month free-repeat window](/credits#free-repeat-window). > `breach_info` contains `breach_count`, `services`, `exposed_data`, and > `interests`, matching the paid route. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **email** `string` *required* The email address to check for data breaches. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/breaches" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/breaches", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/breaches", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ## Response Returns the canonical breach shape shared with the dashboard, so the CLI and this endpoint all return identical fields. **email** `string` The email address that was checked. **breached** `boolean` Whether the email appears in one or more known breaches. **breach_info** `object` The canonical breach detail object. Can serialize as `null` when no breach record was produced. **breach_info** **breach_count** `number` Number of known data breaches the email appears in. **services** `object[]` Breached services. Each entry has `name`, plus `domain`, `breach_date`, and `data_types` when known - those three are omitted when empty. **exposed_data** `string[]` Aggregated data types exposed across all breaches (e.g. `["Passwords", "Email addresses"]`). Omitted when empty. **interests** `object[]` Inferred interest categories, each `{ category, signal }`, derived from which services the email was breached on. **credits** `number` Credits charged for this request. `1` on a fresh charge, or `0` when you were already charged for this address during the [6-month free-repeat window](/credits#free-repeat-window). ## Errors Errors return a JSON body of the form `{"error": "", "code": ""}` with the matching HTTP status code. | Status | Message | Cause | | - | - | - | | `400` | `Invalid request body` | Malformed JSON | | `400` | `Invalid email address` | Address fails syntax parsing | | `401` | `API key required` / `bad key` | Missing or invalid API key | | `401` | `Unauthorized` | The key's account could not be resolved | | `402` | `You don't have enough credits for this lookup. Top up to continue.` | Not enough credits and not a free repeat | | `405` | `Only POST method is allowed` | Wrong HTTP method | | `413` | `body too large` | Request body exceeds 1 MiB | | `500` | `internal error` | Unexpected server failure | | `502` | `Breach lookup failed. Please try again.` | Transient provider error, retry shortly | | `503` | `Breach lookup is temporarily unavailable` | Breach provider not configured | ## Credits Each check costs **1 credit**. Billing is per-customer: 1 on the first check of an address, `0` for repeats during the [6-month free-repeat window](/credits#free-repeat-window). ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/breaches" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/breaches", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/breaches", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ```json 200 No breaches theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "safe@example.com", "breached": false, "breach_info": { "breach_count": 0, "services": [], "interests": [] }, "credits": 1 } ``` ```json 200 Breaches found theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "user@example.com", "breached": true, "breach_info": { "breach_count": 3, "services": [ { "name": "LinkedIn", "domain": "linkedin.com", "breach_date": "2012-05-05", "data_types": ["Email addresses", "Passwords"] }, { "name": "Adobe", "domain": "adobe.com", "breach_date": "2013-10-04", "data_types": ["Email addresses", "Usernames"] }, { "name": "Dropbox", "domain": "dropbox.com", "breach_date": "2012-07-01", "data_types": ["Email addresses", "Passwords"] } ], "exposed_data": ["Email addresses", "Passwords", "Usernames"], "interests": [{ "category": "Professional", "signal": 1 }] }, "credits": 1 } ``` ```json 402 theme={"theme":{"light":"github-light","dark":"vesper"}} { "code": "insufficient_credits", "error": "You don't have enough credits for this lookup. Top up to continue." } ``` ## Bulk jobs To check a whole list, submit it as a bulk job instead of looping this endpoint. One entrypoint handles every lookup - set `type=email-breaches` - and a webhook delivers the finished file when it's done. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=email-breaches" \ -F "download_link=true" \ -F "file=@list.csv" ``` * Up to **1,000,000 emails per job**, charged **1 credit per email** (with free repeats). * `download_link=true` returns a `download_url` in the `bulk.completed` webhook; fetch it with your API key. * Export filters: `all`, `breached`. See the [Bulk Operations guide](/guides/bulk-operations) for the webhook payload and download options. # Create API Key Source: https://docs.encrata.com/api-reference/endpoint/create-key POST /api/account/keys Create a new API key for the authenticated user. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **name** `string` *required* A display name for the key (e.g. `Production`, `Development`). Trimmed, non-blank, and at most **100 bytes**. > [!NOTE] > > A workspace can create **50 keys per day**. Past that, the request returns > `429`. ### Example request ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"name": "Production"}' ``` ## Response **id** `string` Unique key identifier. Use this id - never `key_prefix` - with [rename](/api-reference/endpoint/rename-key), [toggle](/api-reference/endpoint/toggle-key), [set limit](/api-reference/endpoint/set-key-limit), and [revoke](/api-reference/endpoint/revoke-key). **name** `string` Display name for the key. **key** `string` The full API key. **key_prefix** `string` The key's non-secret prefix (safe to store or display). **is_active** `boolean` Whether the new key is active. Newly created keys are active. > [!WARNING] > > **Treat the key as a secret from the moment it is created.** A non-readonly > member of the workspace can read a revealable key again with > [`GET /api/account/keys/reveal?id={id}`](/api-reference/endpoint/reveal-key). ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. | Status | `result.code` | Cause | | - | - | - | | `400` | `bad_request` | `name` is missing, blank, or longer than 100 bytes | | `405` | `method_not_allowed` | The request did not use `POST` | | `409` | `conflict` | The request conflicts with the current key state | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"name": "Production"}' ``` ```json 201 theme={"theme":{"light":"github-light","dark":"vesper"}} { "id": "a1b2c3d4-0000-4000-8000-000000000000", "name": "Production", "key": "enc_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "key_prefix": "enc_1a2b3c4d", "is_active": true } ``` ```json 409 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "conflict" }, "message": "An API key with that name already exists.", "request_id": "req_7f3a9c21", "error": "An API key with that name already exists." } ``` # Create webhook Source: https://docs.encrata.com/api-reference/endpoint/create-webhook POST /api/webhooks Register an endpoint to receive workspace events. Registers a destination for one or more [workspace events](/webhooks#supported-events). Encrata starts delivering as soon as the webhook is created. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!WARNING] > > Creating a webhook requires the workspace `admin` or `tech` role. `readonly` keys get `403`. ## Request **kind** `string` (default: generic) Destination type. One of `generic`, `slack`, `discord`, or `telegram`. The kind is fixed at creation and cannot be changed later. **events** `string[]` *required* Event types to subscribe to. Must contain at least one event, every value must be a known event, and duplicates are rejected. Valid values: `lookup.completed`, `bulk.completed`, `apikey.created`, `apikey.revoked`, `credits.low`, `credits.exhausted`, `monitor.run.completed`, `monitor.alert.high_value`. **url** `string` *required* The HTTPS URL that receives deliveries. Required for `generic`, `slack`, and `discord`. Omit it for `telegram`. The URL must use `https://` and must resolve to a public address. Private, loopback, and link-local addresses are rejected. **description** `string` A label for the webhook. Trimmed, and limited to 255 characters. **bot_token** `string` Telegram bot token. Required when `kind` is `telegram`, ignored otherwise. **chat_id** `string` Telegram chat ID to post into. Required when `kind` is `telegram`, ignored otherwise. ### Destination rules > [accordion] generic - a signed HTTP endpoint > > The default. Your server receives the raw `{event, data, created_at}` JSON envelope with an `X-Encrata-Signature` header. This is the only kind that returns a signing `secret` and the only kind you can verify. > > Requires `url`. > [accordion] slack - an incoming webhook > > Encrata posts `{"text": "..."}` to your Slack incoming webhook. The host must be `hooks.slack.com`. > > Requires `url`. > [accordion] discord - a channel webhook > > Encrata posts `{"content": "..."}` to your Discord webhook URL. > > Requires `url`. > [accordion] telegram - a bot message > > Encrata calls the Telegram Bot API directly. There is no URL to supply: the target is derived from your bot token and chat ID. > > Requires `bot_token` and `chat_id`. > [!NOTE] > > Chat destinations receive a short human-readable message, not the JSON envelope, and they are not signed. Use `generic` when your application needs to process event data. ### Examples ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/encrata", "events": ["lookup.completed", "credits.low"], "description": "Production webhook" }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "url": "https://example.com/webhooks/encrata", "events": ["lookup.completed", "credits.low"], "description": "Production webhook", }, ) webhook = response.json()["result"] print(webhook["id"], webhook["secret"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://example.com/webhooks/encrata", events: ["lookup.completed", "credits.low"], description: "Production webhook", }), }); const { result } = await response.json(); console.log(result.id, result.secret); ``` ```bash Slack theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "slack", "url": "https://hooks.slack.com/services/T000/B000/XXXXXXXX", "events": ["credits.low", "credits.exhausted"], "description": "#alerts channel" }' ``` ```bash Telegram theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "telegram", "bot_token": "123456789:AAFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "chat_id": "-1001234567890", "events": ["monitor.alert.high_value"] }' ``` ## Response Returns `201 Created`. **success** `boolean` `true` when the webhook was created. **result** `object` The created webhook. **webhook** **id** `string` Webhook identifier (UUID). **workspace_id** `string` The workspace this webhook belongs to. **kind** `string` The destination type you created. **url** `string` The registered URL. Empty for `telegram`. **secret** `string` The HMAC-SHA256 signing secret. It uses `whsec_` followed by 64 hexadecimal characters. Returned for `generic` webhooks only. Use the whole string, including `whsec_`, as the HMAC key. **events** `string[]` The subscribed event types. **is_active** `boolean` `true` for a new webhook. Deliveries begin immediately. **description** `string` Your label, trimmed. Empty string when unset. **config** `object` Destination-specific settings. Present only for `telegram`, carrying `chat_id`. **created_by** `string | null` User ID of the creator, or `null` when unknown. **created_at** `string` ISO 8601 creation timestamp. **updated_at** `string` ISO 8601 last-updated timestamp. **message** `string` A human-readable summary. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "id": "360cb300-d885-4c18-af2c-d259f936bb38", "workspace_id": "51cdc9d9-203c-4345-b06d-222b560460aa", "kind": "generic", "url": "https://example.com/webhooks/encrata", "secret": "whsec_6cce5d5445b12e649ce9e715a2ef4addc9117d6bf3013a0f388997ed20711b1c", "events": ["lookup.completed", "credits.low"], "is_active": true, "description": "Production webhook", "created_by": "e861d7cb-1d7f-48d9-ab13-9af06a4055cf", "created_at": "2026-05-02T12:00:00Z", "updated_at": "2026-05-02T12:00:00Z" }, "message": "Webhook created." } ``` > [!TIP] > > Store the `secret` when you create the webhook. A workspace admin can read it again with [`GET /api/webhooks/{id}`](/api-reference/endpoint/get-webhook), but it is never returned by [list webhooks](/api-reference/endpoint/webhook). ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | The JSON body could not be parsed. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your role is `readonly`. | | `422` | `validation_failed` | A field failed validation. See the table below. | | `500` | `internal` | Encrata could not create the webhook. Retry. | ### Validation messages | `message` | Cause | | - | - | | `That is not a supported destination type.` | `kind` is not one of the four allowed values. | | `A webhook URL is required.` | `url` was empty for a `generic` destination. | | `The webhook URL must use HTTPS.` | `url` did not start with `https://`. | | `The webhook URL is not allowed: ...` | The URL resolved to a private, loopback, or otherwise blocked address. | | `That does not look like a Slack webhook URL.` | `kind` was `slack` but the host was not `hooks.slack.com`. | | `A Telegram bot token is required.` | `kind` was `telegram` without `bot_token`. | | `A Telegram chat ID is required.` | `kind` was `telegram` without `chat_id`. | | `Select at least one event to subscribe to.` | `events` was empty or missing. | | `That is not a valid event type: X.` | `events` contained an unknown event. | | `That event is listed twice: X.` | `events` contained a duplicate. | | `The description must be 255 characters or fewer.` | `description` was too long. | ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "validation_failed" }, "message": "The webhook URL must use HTTPS." } ``` ## Next steps * [Send a test event](/api-reference/endpoint/test-webhook): Confirm your endpoint is reachable before you rely on it. * [Verify signatures](/webhooks): Validate `X-Encrata-Signature` on every delivery. * [Update a webhook](/api-reference/endpoint/update-webhook): Change events, URL, or pause deliveries. * [Inspect deliveries](/api-reference/endpoint/webhook-deliveries): Debug failures with recent attempts. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/encrata", "events": ["lookup.completed", "credits.low"], "description": "Production webhook" }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "url": "https://example.com/webhooks/encrata", "events": ["lookup.completed", "credits.low"], "description": "Production webhook", }, ) webhook = response.json()["result"] print(webhook["id"], webhook["secret"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ url: "https://example.com/webhooks/encrata", events: ["lookup.completed", "credits.low"], description: "Production webhook", }), }); const { result } = await response.json(); console.log(result.id, result.secret); ``` # Credits Source: https://docs.encrata.com/api-reference/endpoint/credits GET /api/account/credits Check the remaining credit balance and usage for your account. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request No parameters required. The balance is scoped to the API key's active workspace when one is selected, otherwise to the key owner's account. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/credits" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Response **credits_remaining** `number` Credits currently available to spend. **credits_used** `number` Total credits consumed to date. **total_lookups** `number` Total number of lookups performed to date. **stats_degraded** `boolean` `true` only when the lifetime counters (`credits_used`, `total_lookups`) timed out and read `0`. `credits_remaining` is always accurate; this flag distinguishes a degraded read from a brand-new account. ## Errors Errors return a JSON body of the form `{"error": ""}` with the matching HTTP status code. | Status | Message | Cause | | - | - | - | | `401` | `unauthorized` / `invalid API key` | Missing or invalid API key | | `402` | `api key credit limit exceeded` | The key has hit its own `credit_limit`. See [Set key credit limit](/api-reference/endpoint/set-key-limit) | | `405` | `Only GET method is allowed` | Wrong HTTP method | | `500` | `failed to fetch credits` | The balance could not be read | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/credits" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "credits_remaining": 4794, "credits_used": 206, "total_lookups": 206, "stats_degraded": false } ``` ```json 401 theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "invalid API key" } ``` # Delete webhook Source: https://docs.encrata.com/api-reference/endpoint/delete-webhook DELETE /api/webhooks/{id} Remove a webhook endpoint and stop its deliveries. Deletes a webhook. Encrata stops delivering to it immediately. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!WARNING] > > Deleting a webhook requires the workspace `admin` or `tech` role. `readonly` keys get `403`. ## Request Pass the webhook ID in the path. **id** `string` *required* The webhook ID to delete. The ID is also accepted in a JSON body sent to `DELETE /api/webhooks` for backwards compatibility: **id** `string` The webhook ID to delete. Used only when the path contains no ID. > [!NOTE] > > Deleting a webhook removes the endpoint. Its delivery history is retained, but you can no longer read it: [list deliveries](/api-reference/endpoint/webhook-deliveries) returns `404` once the webhook is gone. Export anything you need first. ### Examples ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/webhooks/360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests webhook_id = "360cb300-d885-4c18-af2c-d259f936bb38" requests.delete( f"https://developer.encrata.com/api/webhooks/{webhook_id}", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const webhookId = "360cb300-d885-4c18-af2c-d259f936bb38"; await fetch(`https://developer.encrata.com/api/webhooks/${webhookId}`, { method: "DELETE", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); ``` ```bash Body form theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "360cb300-d885-4c18-af2c-d259f936bb38"}' ``` ## Response Returns `200 OK`. **success** `boolean` `true` when the webhook was deleted. **result** `object` **result** **status** `string` Always `deleted`. **message** `string` A human-readable summary. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "status": "deleted" }, "message": "Webhook deleted." } ``` ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | No ID was supplied, or the JSON body could not be parsed. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your role is `readonly`. | | `404` | `not_found` | No webhook with that ID exists in your workspace. Deleting twice returns `404` the second time. | | `500` | `internal` | Encrata could not delete the webhook. Retry. | ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "That webhook no longer exists. It may have been deleted." } ``` ## Next steps * [Pause instead of delete](/api-reference/endpoint/update-webhook): Set `is_active: false` to stop deliveries reversibly. * [Create a webhook](/api-reference/endpoint/create-webhook): Register a replacement endpoint. * [List webhooks](/api-reference/endpoint/webhook): Confirm what is left in the workspace. * [Error reference](/errors): Every status code the API returns. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/webhooks/360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests webhook_id = "360cb300-d885-4c18-af2c-d259f936bb38" requests.delete( f"https://developer.encrata.com/api/webhooks/{webhook_id}", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const webhookId = "360cb300-d885-4c18-af2c-d259f936bb38"; await fetch(`https://developer.encrata.com/api/webhooks/${webhookId}`, { method: "DELETE", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); ``` # Email Compliance Source: https://docs.encrata.com/api-reference/endpoint/email-compliance POST /api/lookup/email/compliance Resolve which country's cold-email law applies to an address, and get that jurisdiction's recommendation. 1 credit, with free repeats. ## Overview Email Compliance answers one question: **may I cold-email this address, and under whose law?** It resolves an email to the most likely jurisdiction, returns that jurisdiction's rule and recommendation, and tells you how much to trust the attribution. The verdict can arrive in **two phases**. Most checks resolve inside the request; a deeper attribution check may still be running when the first response returns. In that case the response carries `checking: true` and a provisional verdict. To get the settled verdict, send the same request again. The repeat returns the finalised result and is not charged again during the [6-month free-repeat window](/credits#free-repeat-window), so polling costs nothing. `result_id` stays the same across both responses, so you can correlate them. > [!NOTE] > > `email.compliance_completed` is an internal realtime event for the dashboard. > It is not one of the [subscribable webhook events](/webhooks#supported-events), > so you cannot register a webhook to be told when a verdict settles. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **email** `string` *required* The email address to place under a jurisdiction. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/compliance" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "priya.sharma@example.in"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/compliance", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "priya.sharma@example.in"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/compliance", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "priya.sharma@example.in" }), }); const data = await resp.json(); ``` ## Response Unlike the older email endpoints, this route always returns the `{success, result, message}` envelope - including on validation and method errors. The HTTP status is real; a `200` never carries `success: false`. **success** `boolean` Whether the lookup succeeded. **message** `string` A sentence written for your end user. It already reflects whether the verdict is provisional, confident, or unknown - render it as-is rather than composing your own from the fields. **result** `object` The applicable jurisdiction and its cold-email rule. **result** **email** `string` The address that was placed. **country** `string` Resolved country name. Empty when `confidence` is `unknown`. **country_code** `string` ISO alpha-2 code. An empty string when `confidence` is `unknown` - the key is always present. When `confidence` is `medium`, this is the **strictest** of `jurisdictions_applicable`, not simply the most likely. **email_type** `string` `consumer` or `business`. **recommendation_code** `string` The machine-readable verdict, ordered here from strictest to most permissive: `prohibited`, `consent_required`, `exception_required`, `case_by_case`, `allowed_with_conditions`, `allowed`, `allowed_by_policy`, `safe_to_send`. Branch on this rather than on `recommendation`, whose wording varies by jurisdiction. Treat an unrecognised code conservatively: the backend ranks unknown codes alongside `case_by_case`. **recommendation** `string` The plain-language recommendation for this jurisdiction. **main_laws** `string[]` The governing laws (e.g. `["Digital Personal Data Protection Act 2023"]`). **law_reference_urls** `string[]` Reference URLs for the cited laws. **main_restrictions** `string[]` The key restrictions that apply. **applicability** `string` Scope note (e.g. national scope, sector rules may add requirements). **confidence** `string` `confident`, `medium`, or `unknown`. Drives the whole presentation - see the table below. **jurisdictions_applicable** `string[]` Every country still in contention. More than one entry means the strictest was applied. Omitted when empty. **possible_travel** `string[]` Countries whose only evidence was a lone one-off signup - reported as travel, never counted as applicable law. Omitted when empty. **signals** `object` Consolidated, provider-anonymized summary of the checks behind the verdict. Always present. **signals** **points** `number` Points earned from the checks that produced a usable signal. **max_points** `number` The maximum `points` available. Use `points / max_points` as an evidence-strength ratio. **checks** `number` How many checks have reported, whether or not they contributed. A pending check is not counted until it reports. **latency_ms** `number` Combined time across the checks that have reported, in milliseconds. **checking** `boolean` `true` while the deeper attribution check is still running. When `true` the verdict is provisional and is finalised shortly after. Omitted when `false`, so read it as "provisional if present and true". **result_id** `number` Row id for this result. The settled `email.compliance_completed` event correlates on this id. Omitted when zero. **credits** `number` Credits billed: `1` on a fresh charge, or `0` during the [6-month free-repeat window](/credits#free-repeat-window). ### `confidence` drives the presentation | `confidence` | Means | Suggested handling | | - | - | - | | `confident` | A clear jurisdiction with corroborating evidence | Show the country and its rule plainly | | `medium` | A likely jurisdiction, thinner corroboration. `country_code` is the strictest of `jurisdictions_applicable` | Show the rule; say it is the strictest of several candidates | | `unknown` | Nothing established. `country`/`country_code` are empty and the restrictive default is returned | Do **not** print a country; show `recommendation`/`main_restrictions` as generic guidance | `unknown` is a deliberate answer, not a failure - the response is still `200` with a usable restrictive recommendation. Treating it as an error is the most common way to get this integration wrong. ## Errors Every response - including errors - uses the envelope, with a stable code in `result.code`. | Status | `result.code` | Cause | | - | - | - | | `400` | `bad_request` | Unreadable body, or `email` is not a valid address | | `401` | `unauthorized` | Missing or unusable credentials | | `402` | `insufficient_credits` | Not enough credits and not a free repeat | | `405` | `method_not_allowed` | `This endpoint only accepts POST requests.` | | `413` | `payload_too_large` | Body exceeded the size limit | | `500` | `internal_error` | Unexpected server error | | `503` | `upstream_unavailable` | Temporarily unavailable; retry later | ## Credits Each lookup costs **1 credit**, with free repeats during the [6-month free-repeat window](/credits#free-repeat-window). A repeat that finalises a previously provisional verdict is not charged again. See [Credits](/credits). ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/compliance" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "priya.sharma@example.in"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/compliance", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "priya.sharma@example.in"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/compliance", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "priya.sharma@example.in" }), }); const data = await resp.json(); ``` ```json 200 Confident theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "email": "priya.sharma@example.in", "country": "India", "country_code": "IN", "email_type": "business", "recommendation_code": "allowed_by_policy", "recommendation": "Cold emailing is allowed.", "main_laws": ["Digital Personal Data Protection Act 2023"], "law_reference_urls": ["https://www.meity.gov.in/"], "main_restrictions": ["Provide an opt-out in every message"], "applicability": "National scope. Sector rules may add requirements.", "confidence": "confident", "jurisdictions_applicable": ["IN"], "signals": { "points": 7, "max_points": 8, "checks": 4, "latency_ms": 412 }, "result_id": 918273, "credits": 1 }, "message": "Cold emailing this address is allowed under India's rules." } ``` ```json 200 Unknown theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "email": "anon@protonmail.com", "country": "", "country_code": "", "email_type": "consumer", "recommendation_code": "consent_required", "recommendation": "Treat consent as required before emailing.", "main_laws": [], "law_reference_urls": [], "main_restrictions": [ "We could not establish which country's rules apply to this address.", "Obtain explicit consent before sending, and include a clear unsubscribe option." ], "applicability": "No jurisdiction could be identified from this address. The strictest common requirements are shown; confirm the recipient's country before sending.", "confidence": "unknown", "signals": { "points": 0, "max_points": 8, "checks": 3, "latency_ms": 286 }, "result_id": 918274, "credits": 1 }, "message": "We couldn't establish a jurisdiction for this address. Treat it as consent-required." } ``` ```json 200 Provisional theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "email": "sam@example.de", "country": "Germany", "country_code": "DE", "email_type": "business", "recommendation_code": "consent_required", "recommendation": "Obtain consent before emailing.", "main_laws": ["GDPR", "UWG"], "law_reference_urls": ["https://gdpr-info.eu/"], "main_restrictions": ["Prior opt-in required"], "applicability": "National scope. Sector rules may add requirements.", "confidence": "medium", "jurisdictions_applicable": ["DE", "AT"], "signals": { "points": 3, "max_points": 8, "checks": 2, "latency_ms": 190 }, "checking": true, "result_id": 918275, "credits": 1 }, "message": "Compliance resolved from the available signals. An additional check is still running and you'll be notified if it adds anything." } ``` ```json 402 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "insufficient_credits" }, "message": "You don't have enough credits for this lookup. Top up to continue." } ``` > [!WARNING] > > **Known issue:** A provisional response says, "Compliance resolved from the > available signals. An additional check is still running and you'll be > notified if it adds anything." No subscribable notification exists. Re-send > the request to get the settled verdict. # Email Gender Source: https://docs.encrata.com/api-reference/endpoint/email-gender POST /api/lookup/email/gender Predict the likely gender and country behind an email address. 1 credit, with free repeats for 6 months. ## Overview Email Gender infers the **likely gender** and **country** of the person behind an address from the name embedded in the local part (for example `jane.doe@` or `j.smith@`). It returns a single verdict with a confidence score, backed by genderapi.io. Use it to personalise outreach, segment a list, or fill a missing `gender` field before a campaign. Predict for a single address here (1 credit), or label a whole list with the [bulk job pipeline](#bulk-jobs) below. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **email** `string` *required* The email address to predict gender for. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/gender" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "jane.doe@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/gender", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "jane.doe@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/gender", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "jane.doe@example.com" }), }); const data = await resp.json(); ``` ## Response **email** `string` The email address that was analysed. **gender** `string` The predicted gender: `male`, `female`, or `unknown` when the name cannot be resolved with confidence. **country** `string | null` The most likely country for the name as an ISO alpha-2 code (for example `US`, `GB`). When no country signal is available, the live API can return the string `"NULL"` or JSON `null`. **name** `string` The name extracted from the local part that the prediction was made from. This field is present even when `gender` is `unknown`. **probability** `number` Confidence in the `gender` verdict, from `0` to `100`. A low value on an `unknown` verdict means the name was ambiguous or not recognised. **credits** `number` Credits charged for this request. `1` on a fresh charge, or `0` when you were already charged for this address during the [6-month free-repeat window](/credits#free-repeat-window). **cached** `boolean` Present and `true` only when the verdict was served from cache. The key is **omitted entirely** when the result was not cached - it is never `false`. This is independent of billing: a cached result is still charged `1` on your first request for that address in the window. ## Errors Errors return a JSON body of the form `{"error": "", "code": ""}` with the matching HTTP status code. | Status | Message | Cause | | - | - | - | | `400` | `Invalid request body` | Malformed JSON | | `400` | `Invalid email address` | Address fails syntax parsing | | `401` | `API key required` / `bad key` | Missing or invalid API key | | `401` | `Unauthorized` | The key's account could not be resolved | | `402` | `You don't have enough credits for this lookup. Top up to continue.` | Not enough credits and not a free repeat | | `405` | `Only POST method is allowed` | Wrong HTTP method | | `413` | `body too large` | Request body exceeds 1 MiB | | `502` | `Gender lookup failed. Please try again.` | Transient provider error, retry shortly | | `503` | `Gender lookup is temporarily unavailable` | Gender provider not configured | > [!NOTE] > > A transient provider error (`502`) is never billed. An `unknown` verdict from a > successful lookup **is** billed like any other result. ## Credits Each lookup costs **1 credit**. Billing is per-customer: 1 on the first lookup of an address, `0` for repeats during the [6-month free-repeat window](/credits#free-repeat-window). See [Credits](/credits) for details. > [!WARNING] > > **Known issue:** `country` is the string `"NULL"`, not JSON `null`, when no > country is found. Check for both values. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/gender" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "jane.doe@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/gender", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "jane.doe@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/gender", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "jane.doe@example.com" }), }); const data = await resp.json(); ``` ```json 200 Resolved theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "jane.doe@example.com", "name": "jane", "gender": "female", "country": "US", "probability": 98, "credits": 1 } ``` ```json 200 Unknown theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "info@example.com", "name": "info", "gender": "unknown", "country": "NULL", "probability": 50, "credits": 1 } ``` ```json 402 theme={"theme":{"light":"github-light","dark":"vesper"}} { "code": "insufficient_credits", "error": "You don't have enough credits for this lookup. Top up to continue." } ``` ## Bulk jobs To label a whole list, submit it as a bulk job instead of looping this endpoint. One entrypoint handles every lookup - set `type=gender` - and a webhook delivers the finished file when it's done. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=gender" \ -F "download_link=true" \ -F "file=@list.csv" ``` * Up to **1,000,000 emails per job**, charged **1 credit per email**. * `download_link=true` returns a `download_url` in the `bulk.completed` webhook; fetch it with your API key. * Export filters: `all`, `found`. See the [Bulk Operations guide](/guides/bulk-operations) for the webhook payload and download options. # Email Identity Source: https://docs.encrata.com/api-reference/endpoint/email-identity POST /api/lookup/email/identity Resolve the person behind an email address: name, job role, company, industry, location, and social profiles. ## Overview Email Identity resolves the real person behind an email address into a structured profile: name, job role, company, industry, location, education, professional history, social profiles, and (when a phone number is discovered) reverse-phone owner intel. This is a premium lookup. It uses the dedicated identity resolver (not the general web-search lookup) and costs 1,000 credits per address. There are two ways to run it: * **Single lookup** (`POST /api/lookup/email/identity`): the endpoint documented on this page. * **Bulk jobs** (`POST /api/jobs/bulk` with `type=identity`): resolve a whole uploaded list in the background. See [Bulk jobs](#bulk-jobs) below. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **email** `string` *required* The email address to resolve. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/identity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/identity", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/identity", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ## Response Returns the resolved profile wrapped in a `person` object, plus billing fields. > [!WARNING] > > Most `person` fields are **always serialized**, even when empty. Expect `""` > for unresolved strings and `null` for unresolved lists. Check for a truthy > value before you use a field; do not check for the key's presence. **email** `string` The email address that was resolved. **person** `object` The resolved profile. **person** **first_name, middle_name, last_name** `string` The person's name. **company, job_role, industry** `string` Current employment. **city, country, current_location** `string` Location. **bio, education, education_level, university, field_of_study** `string` Background and education. **photo_url** `string` Profile photo. **socials** `object` `linkedin`, `twitter`, `instagram`, `facebook`, `github`. These are **nested here only** - there are no top-level social fields. **company_info** `object` Place data for the employer: `name`, `address`, `phone`, `website`, `category`, `rating`, `rating_count`, `price_level`, `latitude`, `longitude`, `attributes`. **company_profile** `object` Firmographics for the employer (size, industry, funding). **pdl** `object` Professional profile: work history, skills, certifications. **breach_info** `object` Breach exposure, including `exposed_data` (`string[]`). Can serialize as `null`. **phone_owner** `object` Reverse-phone owner intel when a number is discovered: owner name, locations, addresses, relatives, extra emails, social profiles. **ip_intel** `object` Network intelligence associated with the person, when available. **news, scholar, videos, patents** `object[]` Public mentions discovered for the person. **credits** `number` Credits charged for this request. `1000` on a fresh charge, or `0` when you were already charged for this address during the [6-month free-repeat window](/credits#free-repeat-window). **cached** `boolean` Present and `true` only when the profile was served from cache. This is independent of billing: a cached result is still charged `1000` on your first request for that address in the window. **files** `object` Present but unused for this endpoint (`json` and `csv` are empty strings). ## Errors Errors return a JSON body of the form `{"error": "", "code": ""}` with the matching HTTP status code. | Status | Message | Cause | | - | - | - | | `400` | `Invalid request body` | Malformed JSON | | `400` | `Invalid email address` | Address fails syntax parsing | | `400` | `The email domain does not exist or can't receive email` | Domain has no valid mail records | | `401` | `API key required` / `bad key` | Missing or invalid API key | | `401` | `Unauthorized` | The key's account could not be resolved | | `402` | `You don't have enough credits for this lookup. Top up to continue.` | Not enough credits and not a free repeat | | `405` | `Only POST method is allowed` | Wrong HTTP method | | `413` | `body too large` | Request body exceeds 1 MiB | | `500` | `internal error` | Unexpected server failure | | `502` | `Identity lookup is temporarily unavailable. Please try again.` | Transient provider error, retry shortly | ## Credits Each lookup costs **1,000 credits**. Billing is per-customer: 1,000 on the first lookup of an address, `0` for repeats during the [6-month free-repeat window](/credits#free-repeat-window). A cached result is still charged on your first lookup. See [Credits](/credits) for details. > [!NOTE] > > Identity resolution may expand a discovered phone number into its owner via > reverse-phone lookup, adding a `phone_owner` block inside `person` (owner > name, locations, addresses, relatives, extra emails, and social profiles). ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/identity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/identity", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/identity", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "jane@example.com", "person": { "first_name": "Jane", "last_name": "Doe", "company": "Acme Inc", "job_role": "Head of Product", "industry": "Software", "city": "San Francisco", "country": "United States", "bio": "Product leader focused on developer tools.", "photo_url": "https://.../jane.jpg", "socials": { "linkedin": "https://www.linkedin.com/in/janedoe", "twitter": "https://x.com/janedoe", "github": "https://github.com/janedoe" } }, "files": { "json": "", "csv": "" }, "credits": 1000 } ``` ```json 402 theme={"theme":{"light":"github-light","dark":"vesper"}} { "code": "insufficient_credits", "error": "You don't have enough credits for this lookup. Top up to continue." } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "Invalid email address", "code": "bad_email" } ``` ## Bulk jobs To resolve a whole list, submit it as a bulk job instead of looping this endpoint. One entrypoint handles every lookup - set `type=identity` - and a webhook delivers the finished file when it's done. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=identity" \ -F "download_link=true" \ -F "file=@list.csv" ``` * Up to **1,000,000 emails per job**, charged **1,000 credits per email** - size your list against your balance first. * `download_link=true` returns a `download_url` in the `bulk.completed` webhook; fetch it with your API key. * Export filters: `all`, `found`. See the [Bulk Operations guide](/guides/bulk-operations) for the webhook payload and download options. # Exposed API Keys Source: https://docs.encrata.com/api-reference/endpoint/exposed-api-keys POST /api/lookup/breaches/exposed-keys Scan collected text for exposed credentials and check whether supported credentials are still live. Exposed API Keys scans text you already collected for API keys, tokens, and other credentials. `POST /api/lookup/breaches/exposed-keys` Requires an [Encrata API key](/authentication) in the `Authorization` header. ## Request **content** `string` *required* The text to scan. Send a crawled page, paste, message, or dump. The maximum size is 256 KB per request. **type** `integer` (default: 0) Detection profile: `0` uses the standard engine, `1` uses the alternate engine, and `2` runs both and merges duplicate findings. **source** `string` A label for the source, such as `crawler`, `paste`, or `telegram`. It appears in activity history and does not affect detection. **config** `object` Optional detection and validation settings. **config** **rules** `string[]` Run only the specified detection rule IDs. Omit this field to run every available rule. **min_severity** `string` Return findings at or above `critical`, `high`, `medium`, or `low`. **baseline_fingerprints** `string[]` Suppress findings you have already reviewed. **include_likely_false_positives** `boolean` Include findings flagged as likely false positives. **max_findings** `integer` Limit the number of findings returned. **validate** `boolean` Check whether supported credentials still work. Omit this field to use the deployment default. Set it to `false` for detection only. > [!WARNING] > > This endpoint scans only the supplied `content`. It does not fetch a URL. > Use [GitHub Leaks](/api-reference/endpoint/github-leaks) to scan a public > repository and its history. ## Example ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/breaches/exposed-keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "content": "AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE", "source": "crawler", "config": { "validate": true, "min_severity": "medium" } }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/lookup/breaches/exposed-keys", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "content": "AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE", "source": "crawler", "config": {"validate": True, "min_severity": "medium"}, }, ) response.raise_for_status() print(response.json()) ``` ## Response The endpoint always runs synchronously. A `200 OK` response uses the `{success, result, message}` envelope. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "scan_id": "8f4ae53c-8b72-4d63-93ef-5bb369a8e351", "repository_id": "3edce238-986c-4897-b088-826791967f52", "kind": "keys", "target": "sha256:8a2ff5c3...", "type": 0, "commit_sha": "8a2ff5c3...", "depth": 0, "config": { "min_severity": "medium", "validate": true }, "summary": { "total": 1, "by_severity": {"high": 1}, "by_engine": {"encrata intelligence": 1}, "engines_run": ["encrata intelligence"], "rules_requested": 0, "duration_ms": 84, "suppressed": 0, "validated": 1, "live": 0, "truncated": false }, "findings": [ { "fingerprint": "b9d1...e2", "rule_id": "aws-access-key-id", "description": "AWS access key ID", "severity": "high", "severity_source": "engine", "engines": ["encrata intelligence"], "start_line": 1, "end_line": 1, "column": 19, "preview": "AKIA****************", "entropy": 3.8, "likely_false_positive": false, "validation": { "status": "invalid", "confidence": 1, "checked_at": "2026-10-07T09:30:00Z" } } ], "reused": false, "charged": true, "credits": 1 }, "message": "Scan complete. 1 exposed credential found." } ``` **success** `boolean` Whether the scan completed. **message** `string` A human-readable summary of the result. **result** `object` The scan result. **result** **scan_id** `string` The stored scan ID. **repository_id** `string` The internal target ID used to store and authorize the result. **kind** `string` Always `keys` for this endpoint. **target** `string` A SHA-256 identifier for the submitted content. The raw content is not stored in this field. **type** `integer` The detection profile that ran: `0`, `1`, or `2`. **commit_sha** `string` The SHA-256 digest of the submitted content. **depth** `integer` Always `0`. Text scans have no repository history. **config** `object` The effective configuration used for the scan. **summary** `object` Counts and timing for the scan. **summary** **total** `integer` Number of findings returned. **by_severity** `object` Finding counts grouped by severity. **by_engine** `object` Finding counts grouped under `encrata intelligence`. **engines_run** `string[]` Detection sources that ran. **rules_requested** `integer` Number of requested rules. `0` means every available rule. **deep_scan** `boolean` Omitted for this endpoint because text has no repository history. **duration_ms** `integer` Scan duration in milliseconds. **suppressed** `integer` Findings removed by rules, severity filters, or baseline fingerprints. **validated** `integer` Findings that received a validation verdict. **live** `integer` Validated credentials that still work. **truncated** `boolean` Whether `max_findings` truncated the result. **findings** `object[]` Detected credentials. Raw credentials are never returned. **finding** **fingerprint** `string` Stable hash-derived ID for deduplication and baselines. **rule_id** `string` Detection rule that matched. **description** `string` Human-readable finding type. **severity** `string` `critical`, `high`, `medium`, `low`, or `unknown`. **severity_source** `string` `engine` or `unreported`. **engines** `string[]` Detection sources that reported the location. **file** `string` Source file name when the submitted text includes file context. **start_line** `integer` 1-based first line of the match. **end_line** `integer` 1-based last line of the match. **column** `integer` 1-based starting column. **preview** `string` Masked preview of the credential. **entropy** `number` Shannon entropy of the match. **commit** `string` Commit SHA when source context contains one. **author** `string` Commit author when source context contains one. **email** `string` Commit author email when source context contains one. **date** `string` Commit timestamp when source context contains one. **likely_false_positive** `boolean` Whether the finding is flagged as a likely false positive. **validation** `object` Live-credential check. Present only when validation ran, and only on the response from the scan that ran it. A reused scan (`reused: true`) and `GET /api/lookup/breaches/exposed-keys/{id}` return findings without `validation`. **validation** **status** `string` `valid`, `invalid`, or `undetermined`. **confidence** `number` Confidence in the validation result. **checked_at** `string` ISO 8601 timestamp for the validation check. **reused** `boolean` Whether an existing scan of identical content and configuration answered the request. **charged** `boolean` Whether the request deducted credits. **credits** `integer` Credits deducted. The cost is one credit per finding. **status** `string` Omitted from the `POST` response. `GET /api/lookup/breaches/exposed-keys/{id}` returns it. ## Read a stored scan Read a previous result without rescanning or charging again: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/lookup/breaches/exposed-keys/{scan_id}?min_severity=high" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` The optional `min_severity` query filters stored findings. It does not run the scanner again. > [!NOTE] > > Stored scans don't keep `validation`. Findings from this endpoint, and from a > reused `POST` scan, have no `validation` object. Keep the first `POST` > response if you need the live-credential verdict. ## Errors | Status | Cause | | - | - | | `400` | The JSON body cannot be read. | | `401` | The API key is missing or invalid. | | `402` | The account has no available credits. | | `413` | `content` exceeds 256 KB. | | `422` | `content` is empty, `type` is outside `0-2`, or a repository-only option was sent. | | `502` | The scanner could not complete the request. | | `503` | Secret scanning or the selected detection profile is unavailable. | | `504` | The scan exceeded its time limit. | ## Credits You pay **1 credit per exposed credential found**. A clean scan is free. Submitting identical content with the same configuration reuses the stored scan, so your account is not charged twice. See [Credits](/credits). ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/breaches/exposed-keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "content": "AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE", "source": "crawler", "config": { "validate": true, "min_severity": "medium" } }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/lookup/breaches/exposed-keys", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "content": "AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE", "source": "crawler", "config": {"validate": True, "min_severity": "medium"}, }, ) response.raise_for_status() print(response.json()) ``` # File Scan Source: https://docs.encrata.com/api-reference/endpoint/file-scan POST /api/lookup/malware/scan Inspect a file for malware and suspicious indicators. File Scan analyzes a file for malware and returns a verdict, file hash, and supporting indicators. ## Authentication Send your API key as `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. ## Request **kind** `string` *required* Set this value to `file`. **file** `file` The file to scan, uploaded as `multipart/form-data`. Send this field or `content_base64` or `source_url`. When you omit `filename`, the uploaded file's name is used. **content_base64** `string` For a JSON body, the base64-encoded file. Send raw base64 only, without a data URL prefix. Provide this field, `file`, or `source_url`. **source_url** `string` A URL from which Encrata can download the file. Provide this field, `file`, or `content_base64`. **filename** `string` The original file name. **stix** `boolean` Set to `true` to include STIX 2.1 output when available. Defaults to `false`. The maximum file size is 100 MiB. ## Example request Upload the file from disk as `multipart/form-data`. Replace `document.pdf` with the path to your file. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=file" \ -F "file=@document.pdf" ``` To send JSON instead, base64-encode the file into `content_base64`: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "file", "content_base64": "BASE64_ENCODED_FILE", "filename": "document.pdf" }' ``` For files already in storage, send a short-lived download link in `source_url` instead of uploading the file: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=file" \ -F "source_url=https://files.example.com/signed/invoice.pdf" \ -F "filename=invoice.pdf" ``` ## Example response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "Malicious content detected.", "result": { "scan_id": "scn_e05b3c8a91f2", "kind": "file", "status": "done", "verdict": "malicious", "score": 96, "sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f", "file_type": "PDF document", "data_residency": "global", "signals": [ { "source": "antivirus", "malicious": true, "detail": "Eicar-Test-Signature", "severity": "critical" } ], "iocs": [ { "type": "sha256", "value": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f" } ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` ## File result fields **sha256** `string` The SHA-256 hash of the scanned file. **file_type** `string` The file type reported by the file scanner. **signals** `object[]` Malware and rule matches. Each item is an object with `source`, `malicious`, `detail`, and optional `severity`. **iocs** `object[]` Indicators of compromise, including the file's SHA-256. See [Malware Scan](/api-reference/endpoint/malware-scan) for the complete response schema and shared fields. ## Errors The API returns `400` for invalid input, `401` for a missing or invalid API key, `402` when your account has insufficient credits, `413` when the file exceeds 100 MiB, and `429` when you exceed a rate limit. ## Credits A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=file" \ -F "file=@document.pdf" ``` ```bash cURL (JSON) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "file", "content_base64": "BASE64_ENCODED_FILE", "filename": "document.pdf" }' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "Malicious content detected.", "result": { "scan_id": "scn_e05b3c8a91f2", "kind": "file", "status": "done", "verdict": "malicious", "score": 96, "sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f", "file_type": "PDF document", "data_residency": "global", "signals": [ { "source": "antivirus", "malicious": true, "detail": "Eicar-Test-Signature", "severity": "critical" } ], "iocs": [ { "type": "sha256", "value": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f" } ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` # Get webhook Source: https://docs.encrata.com/api-reference/endpoint/get-webhook GET /api/webhooks/{id} Fetch one webhook, including its signing secret. Returns a single webhook. This is the only endpoint that returns a `generic` webhook's signing secret after creation. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` Any workspace role can read a webhook: `admin`, `tech`, or `readonly`. The `secret` field is returned only for `admin`. ## Request **id** `string` *required* The webhook ID to fetch. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks/360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests webhook_id = "360cb300-d885-4c18-af2c-d259f936bb38" response = requests.get( f"https://developer.encrata.com/api/webhooks/{webhook_id}", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) webhook = response.json()["result"] print(webhook["url"], webhook.get("secret")) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const webhookId = "360cb300-d885-4c18-af2c-d259f936bb38"; const response = await fetch( `https://developer.encrata.com/api/webhooks/${webhookId}`, { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }, ); const { result } = await response.json(); console.log(result.url, result.secret); ``` ## Response **success** `boolean` `true` when the request succeeded. **result** `object` The webhook. **webhook** **id** `string` Webhook identifier (UUID). **workspace_id** `string` The workspace this webhook belongs to. **kind** `string` Destination type: `generic`, `slack`, `discord`, or `telegram`. **url** `string` The HTTPS URL that receives deliveries. Empty for `telegram`. **secret** `string` The HMAC-SHA256 signing secret. It uses `whsec_` followed by 64 hexadecimal characters. Use the whole string, including `whsec_`, as the HMAC key when verifying `X-Encrata-Signature`. Returned only when both conditions hold: your role is `admin`, and `kind` is `generic`. A Telegram bot token is never returned. **events** `string[]` The subscribed event types. **is_active** `boolean` Whether Encrata currently delivers to this endpoint. **description** `string` Your label for the webhook. Empty string when unset. **config** `object` Destination-specific settings. Present only for `telegram`, carrying `chat_id`. **created_by** `string | null` User ID of the creator, or `null` when unknown. **created_at** `string` ISO 8601 creation timestamp. **updated_at** `string` ISO 8601 last-updated timestamp. **message** `string` A human-readable summary. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "id": "360cb300-d885-4c18-af2c-d259f936bb38", "workspace_id": "51cdc9d9-203c-4345-b06d-222b560460aa", "kind": "generic", "url": "https://example.com/webhooks/encrata", "secret": "whsec_6cce5d5445b12e649ce9e715a2ef4addc9117d6bf3013a0f388997ed20711b1c", "events": ["lookup.completed", "credits.low"], "is_active": true, "description": "Production webhook", "created_by": "e861d7cb-1d7f-48d9-ab13-9af06a4055cf", "created_at": "2026-05-02T12:00:00Z", "updated_at": "2026-05-02T12:00:00Z" }, "message": "Webhook loaded." } ``` > [!WARNING] > > Treat the `secret` like a password. Anyone holding it can forge a delivery that passes your signature check. If it leaks, delete the webhook and create a new one: secrets cannot be rotated in place. ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | No ID was supplied in the path. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your key resolves to no workspace membership. | | `404` | `not_found` | No webhook with that ID exists in your workspace. | | `500` | `internal` | Encrata could not load the webhook. Retry. | ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "That webhook no longer exists. It may have been deleted." } ``` ## Next steps * [Verify signatures](/webhooks): Use the secret to validate every delivery. * [List webhooks](/api-reference/endpoint/webhook): See every endpoint in the workspace. * [Send a test event](/api-reference/endpoint/test-webhook): Confirm the endpoint is reachable. * [Inspect deliveries](/api-reference/endpoint/webhook-deliveries): Review attempts and retries. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks/360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests webhook_id = "360cb300-d885-4c18-af2c-d259f936bb38" response = requests.get( f"https://developer.encrata.com/api/webhooks/{webhook_id}", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) webhook = response.json()["result"] print(webhook["url"], webhook.get("secret")) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const webhookId = "360cb300-d885-4c18-af2c-d259f936bb38"; const response = await fetch( `https://developer.encrata.com/api/webhooks/${webhookId}`, { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" } }, ); const { result } = await response.json(); console.log(result.url, result.secret); ``` # GitHub Leaks Source: https://docs.encrata.com/api-reference/endpoint/github-leaks POST /api/lookup/breaches/github Scan a public GitHub repository for leaked secrets. 1 credit per leak found - a clean scan is free. ## Overview GitHub Leaks scans a public repository for exposed secrets - API keys, tokens, private keys, and other credentials committed to the code. It returns each finding with its location, a masked preview, a severity, and a stable fingerprint, so you can triage and track leaks over time. Billing is outcome-based: you pay **1 credit per leak found**. A clean scan, a refused scan, and a repeat of a repository state you already paid for are all **free**. > [!WARNING] > > **Scanning is always asynchronous.** A new scan returns `202` with > `status: "processing"`, then you poll `GET /api/lookup/breaches/github/{scan_id}` > for the findings. Only a request that reuses an already-completed scan of the > same repository state returns `200` with findings inline. See > [Run a scan](#run-a-scan). ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **repo** `string` *required* The repository to scan. Must be an `https://github.com/...` repository URL with no embedded credentials. **type** `integer` (default: 0) Detection profile: `0` (default) runs the standard detector, `1` runs the alternate detector, `2` runs both in parallel and merges findings by location. **config** `object` Optional scan tuning. **config** **min_severity** `string` Drop findings below this floor: `critical`, `high`, `medium`, or `low`. **rules** `string[]` Restrict detection to specific rule ids. Empty runs every rule. **max_findings** `integer` (default: 1000) Cap the number of findings returned. **baseline_fingerprints** `string[]` Fingerprints to suppress - known findings you have already triaged. **include_likely_false_positives** `boolean` Include findings flagged as likely false positives. **ref** `string` A specific branch, tag, or commit to scan. **depth** `integer` Bound a history scan to the most recent N commits (1-10). **Mutually exclusive with `deep_scan`.** Because this endpoint always runs a deep scan, sending `depth` fails validation with `422`. **deep_scan** `boolean` (default: true) Scan the full commit history. Always forced to `true` on this endpoint; you cannot turn it off. **run_at_background** `boolean` (default: true) Effectively always on, because `deep_scan` forces it. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/breaches/github" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"repo": "https://github.com/org/repo"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/breaches/github", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"repo": "https://github.com/org/repo"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/breaches/github", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ repo: "https://github.com/org/repo" }), }); const data = await resp.json(); ``` ## Response Returns the `{success, result, message}` envelope. A scan with **zero findings is a success**, not an error. **success** `boolean` Whether the request was accepted. **message** `string` A sentence written for your end user. **result** `object` The scan outcome. **result** **scan_id** `string` The scan's id. Poll `GET /api/lookup/breaches/github/{scan_id}` with it. **repository_id** `string` Encrata's stable id for the scanned repository. **target** `string` The normalised repository URL that was scanned. **kind** `string` The scan family (e.g. `github`). **type** `integer` The detection profile that ran (`0`, `1`, or `2`). **depth** `integer` The history depth that was applied. **config** `object` The effective configuration the scan ran with, after defaults are applied. **commit_sha** `string` The repository state these findings describe. **status** `string` `processing` (the scan is still running - poll for the result), `succeeded` (findings are in this response), or `failed`. **findings** `object[]` The detected secrets. Each finding never contains the raw credential. Empty while `status` is `processing`. **finding** **fingerprint** `string` Stable identifier for this finding, derived from a hash of the match. Use it to deduplicate and to build a baseline. **rule_id** `string` The detection rule that matched (e.g. `aws-access-key-id`). **description** `string` Human-readable description of what was found. **severity** `string` `critical`, `high`, `medium`, `low`, or `unknown`. **severity_source** `string` Where the severity came from (the rule, or an engine override). **engines** `string[]` The detection engines that produced this finding. **file** `string` Path to the file containing the secret. **start_line** `integer` 1-based line where the match starts. **end_line** `integer` 1-based line where the match ends. **column** `integer` 1-based column of the match on `start_line`. **entropy** `number` Shannon entropy of the matched string. Higher means more secret-looking. **tags** `string[]` Rule tags, for your own triage routing. **preview** `string` A masked preview of the match (e.g. `AKIA****************`). The raw secret is never returned. **commit** `string` The commit SHA the secret was found in. A **string**, not an object. The `author`, `email`, and `date` strings sit beside it on the finding. **author** `string` Commit author name, when available. **email** `string` Commit author email, when available. **date** `string` Commit timestamp, when available. **likely_false_positive** `boolean` Whether this finding is flagged as a likely false positive. **summary** `object` Roll-up of the scan: `total`, `by_severity`, `by_engine`, `engines_run`, `rules_requested`, `head_sha`, `deep_scan`, `duration_ms`, `suppressed` (dropped by a filter or baseline), and `truncated`. **reused** `boolean` An existing scan of this repository state answered the request, so no new scan ran. This is the only case that returns findings with `200`. **charged** `boolean` Whether this request debited the account. `false` on a clean scan, or when the account already paid for this repository state and configuration. **credits** `integer` Credits debited: one per leak found, or `0` when the scan was clean or already paid for. Always `0` on a `202`, because nothing is settled yet. ## Run a scan **1. Start the scan** `POST /api/lookup/breaches/github` returns `202` with a `scan_id` and `status: "processing"`. If an identical scan of the same repository state already completed, you get `200` with the findings inline and `reused: true`. **2. Poll for the result** Call `GET /api/lookup/breaches/github/{scan_id}` until `status` is `succeeded` or `failed`. Re-reads never re-scan and never charge again. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/lookup/breaches/github/{scan_id}?min_severity=high" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` **3. Triage the findings** Store each `fingerprint` and pass known ones back as `config.baseline_fingerprints` on the next scan to suppress them. **min_severity** `string` Filter the stored findings by minimum severity (`critical`, `high`, `medium`, `low`). This filters what is returned - it never re-scans and never charges again. > [!TIP] > > Completion also pushes a realtime event. See [Webhooks & events](/webhooks). ## Errors Errors use the same envelope: `{"success": false, "result": {"code": "..."}, "message": "..."}`. | Status | Cause | | - | - | | `400` | Unreadable JSON body | | `401` | Missing or invalid API key | | `402` | Insufficient credits. The service requires at least 1 available credit before it will start a scan, even though a clean scan settles at 0 | | `404` | The repository doesn't exist or isn't public | | `422` | `repo` missing, not a `github.com` repository URL, or `depth` was sent alongside the forced `deep_scan` | | `429` | All concurrent scan slots are busy. This is a parallelism cap, not a requests-per-minute limit - retry once a running scan finishes | | `500` | Unexpected server failure | | `502` | The repository could not be cloned or scanned | | `503` | The scanning service is not available | | `504` | The scan exceeded its time limit | ## Credits You pay **1 credit per leak found**. A clean scan (zero leaks), a refused or failed scan, and a repeat of a repository state and configuration you already paid for are all free. Settlement happens when the scan completes, so a `202` always reports `credits: 0`. See [Credits](/credits). ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/breaches/github" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"repo": "https://github.com/org/repo"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/breaches/github", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"repo": "https://github.com/org/repo"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/breaches/github", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ repo: "https://github.com/org/repo" }), }); const data = await resp.json(); ``` ```json 202 Scan started theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "scan_id": "d4e5f6a1-7b8c-4d9e-8f10-1a2b3c4d5e6f", "repository_id": "3f8c1a22-9e41-4b0d-8d77-5a6b7c8d9e01", "target": "https://github.com/org/repo", "kind": "github", "type": 0, "status": "processing", "credits": 0 }, "message": "Scan started. We'll notify you when it's ready." } ``` ```json 200 Leaks found (polled) theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "scan_id": "6f1c2e94-2b6a-4a1e-9b3a-6c9f0f2a1d77", "repository_id": "3f8c1a22-9e41-4b0d-8d77-5a6b7c8d9e01", "target": "https://github.com/org/repo", "kind": "github", "type": 0, "commit_sha": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "status": "succeeded", "findings": [ { "fingerprint": "b9d1...e2", "rule_id": "aws-access-key-id", "description": "AWS Access Key", "severity": "high", "severity_source": "rule", "engines": ["gitleaks"], "file": "config/prod.env", "start_line": 12, "end_line": 12, "column": 19, "entropy": 4.21, "tags": ["aws", "cloud"], "preview": "AKIA****************", "commit": "a1b2c3d", "author": "Jane Dev", "email": "jane@example.com", "date": "2026-02-11T09:14:00Z", "likely_false_positive": false } ], "summary": { "total": 1, "by_severity": { "high": 1 }, "by_engine": { "gitleaks": 1 }, "engines_run": ["gitleaks"], "head_sha": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2", "deep_scan": true, "duration_ms": 1840, "suppressed": 0, "truncated": false }, "reused": false, "charged": true, "credits": 1 }, "message": "Found 1 leaked secret in this repository." } ``` ```json 200 Clean (polled) theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "scan_id": "0a7b9c11-4d22-4e88-9a10-2b3c4d5e6f70", "repository_id": "3f8c1a22-9e41-4b0d-8d77-5a6b7c8d9e01", "target": "https://github.com/org/repo", "kind": "github", "type": 0, "status": "succeeded", "findings": [], "summary": { "total": 0, "by_severity": {}, "by_engine": {}, "engines_run": ["gitleaks"], "deep_scan": true, "duration_ms": 900, "suppressed": 0, "truncated": false }, "reused": false, "charged": false, "credits": 0 }, "message": "No leaked secrets were found in this repository." } ``` ```json 422 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "validation_failed" }, "message": "repo must be a github.com repository URL." } ``` > [!WARNING] > > **Known issue:** Public repositories, including > `https://github.com/octocat/Hello-World`, can return `404` with the message > `That repository doesn't exist or isn't public. Check the URL and try again.` # Health Check Source: https://docs.encrata.com/api-reference/endpoint/health GET /api/health Check if the API is reachable. No credentials, no credits. ## Request No parameters required. This is the only endpoint that takes no credentials, so use it to verify connectivity before you debug an auth problem. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/health" ``` ## Response **status** `string` Always `"ok"` when the server is running. **service** `string` The service that answered. The live value is `auth`. **time** `string` The server's current time, RFC 3339 in UTC. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/health" ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "status": "ok", "service": "auth", "time": "2026-10-07T15:13:34Z" } ``` # Image Scan Source: https://docs.encrata.com/api-reference/endpoint/image-scan POST /api/lookup/malware/scan Inspect an image for malware and suspicious content. Image Scan analyzes an uploaded image for malware, suspicious content, and embedded indicators. ## Authentication Send your API key as `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. ## Request **kind** `string` *required* Set this value to `image`. **file** `file` The image to scan, uploaded as `multipart/form-data`. Send this field or `content_base64`. When you omit `filename`, the uploaded file's name is used. **content_base64** `string` For a JSON body, send this field or `file`. The base64-encoded image. Send raw base64 only. A data URL prefix such as `data:image/png;base64,` returns `400`. **filename** `string` The original image file name. **stix** `boolean` Set to `true` to include STIX 2.1 output when available. Defaults to `false`. ## Example request Upload the image from disk as `multipart/form-data`. Replace `screenshot.png` with the path to your image. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=image" \ -F "file=@screenshot.png" ``` To send JSON instead, base64-encode the image into `content_base64`: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "image", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "screenshot.png" }' ``` ## Example response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_7d2e9f01b4a6", "kind": "image", "status": "done", "verdict": "clean", "score": 0, "sha256": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2", "data_residency": "global", "image": { "format": "png", "width": 1280, "height": 720 }, "file_type": "PNG image data", "signals": [], "iocs": [ { "type": "sha256", "value": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2" } ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` The example is shortened. A full image result can also include `hashes`, `metadata`, `appended_data`, `steganography`, `ocr_text`, `ocr_urls`, and `url_scans`. ## Image result fields **sha256** `string` The SHA-256 hash of the decoded image. **signals** `object[]` Evidence for the verdict. Each item is an object with `source`, `malicious`, `detail`, and optional `severity`. **iocs** `object[]` Indicators of compromise extracted from the image. See [Malware Scan](/api-reference/endpoint/malware-scan#image-fields) for every image field. ## Errors The API returns `400` for invalid base64 content (including a `data:` URL prefix) or an unsupported image, `401` for a missing or invalid API key, `402` when your account has insufficient credits, and `429` when you exceed a rate limit. ## Credits A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=image" \ -F "file=@screenshot.png" ``` ```bash cURL (JSON) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "image", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "screenshot.png" }' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_7d2e9f01b4a6", "kind": "image", "status": "done", "verdict": "clean", "score": 0, "sha256": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2", "data_residency": "global", "image": { "format": "png", "width": 1280, "height": 720 }, "file_type": "PNG image data", "signals": [], "iocs": [ { "type": "sha256", "value": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2" } ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` # List API Keys Source: https://docs.encrata.com/api-reference/endpoint/list-keys GET /api/account/keys List the API keys you can see, newest first. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!NOTE] > > **Scope depends on your workspace.** When a workspace is active, this returns > every key in the workspace, including other members' keys and their metadata. > Outside a workspace it returns only your own keys. ## Request No request body required. ### Example request ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Response Returns a JSON **array** of API key objects (not wrapped in an object), ordered newest first and capped at **500** entries. **id** `string` The key's database id. Use this - never `key_prefix` - when renaming, toggling, limiting, or revoking a key. **name** `string` Display name for the key. **key_prefix** `string` The key's non-secret prefix (the leading characters, e.g. `enc_0be0a9a0…`). **is_active** `boolean` Whether the key is currently active. Revoked and disabled keys both return `false`, so this field does not distinguish them. **disabled_by_admin** `boolean` Whether the key was disabled by an administrator. **created_at** `string` ISO 8601 creation timestamp. **last_used_at** `string | null` ISO 8601 timestamp of last use, or `null` if never used. **credits_used** `integer` Total credits consumed by this key. **credit_limit** `integer | null` Per-key credit cap, or `null` if unlimited. **creator_email** `string` Email of the workspace member who created the key. The literal `removed user` when that member no longer exists. **revealable** `boolean` Whether the full key can still be read back via `GET /api/account/keys/reveal?id={id}`. ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. | Status | Cause | | - | - | | `401` | Missing or invalid API key | | `429` | Rate limit exceeded. See [Rate limits](/rate-limits) | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} [ { "id": "a1b2c3d4-0000-4000-8000-000000000000", "name": "Production", "key_prefix": "enc_0be0a9a0", "is_active": true, "disabled_by_admin": false, "created_at": "2024-01-15T10:00:00Z", "last_used_at": "2024-03-01T14:30:00Z", "credits_used": 980, "credit_limit": null, "creator_email": "jane@example.com", "revealable": true } ] ``` ```json 401 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "unauthorized" }, "message": "Unauthorized", "request_id": "req_7f3a9c21", "error": "Unauthorized" } ``` # Password Breaches Source: https://docs.encrata.com/api-reference/endpoint/password-breaches POST /api/lookup/email/password/breaches Check whether a password has appeared in known data breaches, privately, via HIBP k-anonymity. ## Overview Password Breaches tells you whether a password has appeared in known data breaches, and how many times, without ever transmitting or storing the plaintext password. It's built for a **sign-up / password-reset guard**: warn a user when the password they chose has already leaked and prompt them to pick a different one. It uses the **k-anonymity** model on top of Have I Been Pwned's Pwned Passwords corpus: the password is SHA-1 hashed and only the first 5 hex characters of the hash are ever sent to the upstream service. There are two ways to run it: * **Single check** (`POST /api/lookup/email/password/breaches`): the API-key endpoint documented on this page, for programmatic access (e.g. your sign-up backend). * **Batches** (`POST /api/jobs/bulk` with `type=password-breaches`): a background job for up to 1,000,000 SHA-1 hashes. See [Check many passwords](#check-many-passwords). > [!NOTE] > > The plaintext password is **never stored**. History records only a masked label > (a dotted mask plus the 5-char hash prefix), never the password or its full hash. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request Send `sha1` (recommended) or `password`. If you send both, `sha1` wins and `password` is ignored. **sha1** `string` Upper-case hex SHA-1 of the password. Must be exactly **40 hex characters**; surrounding whitespace is trimmed and lowercase hex is upper-cased for you. Preferred: the plaintext never leaves the caller. Only the first 5 hex chars are sent upstream. **password** `string` The raw password to check. Hashed server-side (SHA-1) immediately and never stored; only the 5-char hash prefix leaves the server. Prefer `sha1` in production. ### Example request ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/password/breaches" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"sha1": "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"}' ``` ## Response **prefix** `string` The 5-char SHA-1 hash prefix used for the k-anonymity query. **found** `boolean` Whether the password appears in any known breach. **count** `number` How many times the password has been seen across breaches. **message** `string` Human-readable summary of the verdict. **credits** `number` Credits charged for this request. `1` on the first check, or `0` when you already checked this password during the [6-month free-repeat window](/credits#free-repeat-window). ## Errors Errors return a JSON body of the form `{"error": "", "code": ""}` with the matching HTTP status code. | Status | Message | Cause | | - | - | - | | `400` | `bad body` | Malformed JSON | | `400` | `Provide a SHA-1 password hash (sha1) or a password` | Neither `sha1` nor `password` supplied | | `400` | `Provide a SHA-1 password hash (sha1) or a password` | `sha1` is not 40 hexadecimal characters | | `401` | `bad key` | Missing or invalid API key | | `402` | `You don't have enough credits for this lookup. Top up to continue.` | No credits remaining | | `405` | `Only POST method is allowed` | Wrong HTTP method | | `413` | `body too large` | Request body exceeds 1 MiB | | `500` | `internal error` | Unexpected server failure | | `502` | `password breach lookup failed` | Transient upstream error, retry shortly | | `503` | `password breach service unavailable` | Breach corpus not configured | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/password/breaches" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"sha1": "5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8"}' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "prefix": "5BAA6", "found": true, "count": 52372427, "message": "This password has appeared in known breaches.", "credits": 1 } ``` ```json 402 theme={"theme":{"light":"github-light","dark":"vesper"}} { "code": "insufficient_credits", "error": "You don't have enough credits for this lookup. Top up to continue." } ``` ## Check many passwords To check many passwords, upload SHA-1 hashes with `POST /api/jobs/bulk` (`type=password-breaches`) and download the result with `kind=password`. `POST /api/jobs/bulk` runs in the background and handles up to **1,000,000** hashes. SHA-1 hash every password client-side first, so plaintext never reaches the server. A webhook delivers the finished file. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=password-breaches" \ -F "download_link=true" \ -F "file=@hashes.csv" ``` * Charged **1 credit per unique password**. * `download_link=true` returns a `download_url` in the `bulk.completed` webhook; fetch it with your API key. * Export filters: `all`, `breached`. Only the masked hash prefix and breach count are stored - never the password or full hash. See the [Bulk Operations guide](/guides/bulk-operations) for the webhook payload and download options. ## Cost 1 credit per unique password checked. Repeat single lookups are free during the [6-month free-repeat window](/credits#free-repeat-window). # QR Code Scan Source: https://docs.encrata.com/api-reference/endpoint/qr-code-scan POST /api/lookup/malware/scan Decode a QR code and inspect its content for security threats. QR Code Scan decodes an uploaded image and checks the extracted content for suspicious links and other threats. It reads QR, Data Matrix, and Aztec codes. ## Authentication Send your API key as `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. ## Request **kind** `string` *required* Set this value to `qr`. **file** `file` The QR code image to scan, uploaded as `multipart/form-data`. Send this field or `content_base64`. When you omit `filename`, the uploaded file's name is used. **content_base64** `string` For a JSON body, send this field or `file`. The base64-encoded QR code image. Send raw base64 only. A data URL prefix such as `data:image/png;base64,` returns `400` with "content_base64 is not valid base64." **filename** `string` The original image file name. **stix** `boolean` Set to `true` to include STIX 2.1 output when available. Defaults to `false`. ## Example request Upload the QR code image from disk as `multipart/form-data`. Replace `qr-code.png` with the path to your QR code image. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=qr" \ -F "file=@qr-code.png" ``` To send JSON instead, base64-encode the QR code image into `content_base64`: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "qr", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "qr-code.png" }' ``` ## Example response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_4b7e21d09a3c", "kind": "qr", "status": "done", "verdict": "clean", "score": 0, "sha256": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2", "category": "benign", "confidence": "medium", "data_residency": "global", "image": { "format": "png", "width": 290, "height": 290 }, "codes": [ { "format": "qr", "payload_type": "url", "raw": "https://example.com", "final_url": "https://example.com/", "verdict": "clean", "score": 0, "error_correction": "M", "position": {"x": 24, "y": 24, "width": 242, "height": 242} } ], "signals": [], "iocs": [ {"type": "url", "value": "https://example.com", "source": "qr"} ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` ## QR code result fields A `qr` result can contain these fields: `scan_id`, `kind`, `status`, `verdict`, `score`, `sha256`, `category`, `confidence`, `data_residency`, `codes`, `image`, `signals`, `iocs`, and `scanned_at`. **codes** `object[]` Every code decoded from the image. Missing when no code could be read. **code** **format** `string` `qr`, `data_matrix`, or `aztec`. **payload_type** `string` What the code contains, such as `url`, `text`, or `wifi`. **raw** `string` The decoded content. Secrets are redacted: a Wi-Fi password is returned as `REDACTED`. **final_url** `string` The destination after redirects, when the code contains a link. **verdict** `string` Verdict for this code: `clean`, `suspicious`, `malicious`, or `unknown`. **score** `integer` Risk score for this code, from 0 to 100. **signals** `object[]` Signals for this code, in the same shape as the top-level `signals`. **error_correction** `string` QR error-correction level. **position** `object` Pixel bounding box of the code: `x`, `y`, `width`, and `height`. **signals** `object[]` Evidence for the verdict. Each item is an object with `source`, `malicious`, `detail`, and optional `severity`. ### When no code is found If the image has no readable code, the scan still returns `200` with `verdict: "unknown"`, `category: "unknown"`, `confidence: "low"`, no `codes` field, and this signal: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "source": "qr", "malicious": false, "detail": "No QR code, Data Matrix or Aztec code could be read in this image.", "severity": "info" } ``` See [Malware Scan](/api-reference/endpoint/malware-scan) for the complete response schema and shared fields. ## Errors The API returns `400` for invalid base64 content (including a `data:` URL prefix) or an unreadable image, `401` for a missing or invalid API key, `402` when your account has insufficient credits, and `429` when you exceed a rate limit. ## Credits A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=qr" \ -F "file=@qr-code.png" ``` ```bash cURL (JSON) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "qr", "content_base64": "BASE64_ENCODED_IMAGE", "filename": "qr-code.png" }' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "No threats found.", "result": { "scan_id": "scn_4b7e21d09a3c", "kind": "qr", "status": "done", "verdict": "clean", "score": 0, "sha256": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2", "category": "benign", "confidence": "medium", "data_residency": "global", "image": { "format": "png", "width": 290, "height": 290 }, "codes": [ { "format": "qr", "payload_type": "url", "raw": "https://example.com", "final_url": "https://example.com/", "verdict": "clean", "score": 0, "error_correction": "M", "position": {"x": 24, "y": 24, "width": 242, "height": 242} } ], "signals": [], "iocs": [ {"type": "url", "value": "https://example.com", "source": "qr"} ], "scanned_at": "2026-10-09T09:30:00Z" } } ``` # Rename API Key Source: https://docs.encrata.com/api-reference/endpoint/rename-key PUT /api/account/keys Change the display name of an existing API key. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **id** `string` *required* The key's **database id**, as returned by [List API keys](/api-reference/endpoint/list-keys). Not the `key_prefix`. **name** `string` *required* The new display name. Trimmed, non-blank, and at most 100 bytes. Duplicate names are currently allowed. ### Example request ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PUT "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "name": "Production key"}' ``` ## Response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key renamed" } ``` ## Permissions `readonly` members get `403`. A `tech` member can only rename their own keys; only a **workspace admin** can rename another member's key. A key that is out of your scope returns `404`, the same as an unknown id. ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PUT "https://developer.encrata.com/api/account/keys" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "name": "Production key"}' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key renamed" } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "bad_request" }, "message": "id and name are required", "request_id": "req_7f3a9c21", "error": "id and name are required" } ``` ```json 404 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "API key not found", "request_id": "req_7f3a9c21", "error": "API key not found" } ``` # Reveal API Key Source: https://docs.encrata.com/api-reference/endpoint/reveal-key GET /api/account/keys/reveal Read the full value of a revealable API key. Reveal API Key returns the full secret for a key that Encrata stored as revealable. ## Authentication Requires an API key in the `Authorization` header. Members with the `readonly` role cannot reveal keys. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **id** `string` *required* The key's UUID, as returned by [List API Keys](/api-reference/endpoint/list-keys). ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/keys/reveal?id=a1b2c3d4-0000-4000-8000-000000000000" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Response The response uses `Cache-Control: no-store`. **key** `string` The full API key, including its `enc_` prefix. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "key": "enc_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d" } ``` ## Errors | Status | Cause | | - | - | | `400` | `id` is missing or is not a valid UUID | | `403` | The caller has the `readonly` role | | `404` | The key does not exist or belongs to a different workspace | | `410` | The key can no longer be shown | | `405` | The request did not use `GET` | | `500` | The key could not be retrieved | > [!WARNING] > > Anyone who can read this response can use the key. Do not log, cache, or send > the returned value to a client-side application. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/account/keys/reveal?id=a1b2c3d4-0000-4000-8000-000000000000" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` # Revoke or Delete API Key Source: https://docs.encrata.com/api-reference/endpoint/revoke-key DELETE /api/account/keys Revoke an API key (soft disable) or permanently delete it. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **id** `string` *required* The key's **database id**, as returned by [List API keys](/api-reference/endpoint/list-keys). Not the `key_prefix`. **permanent** `string` Set to the exact string `true` to permanently delete the key instead of revoking it. Any other value revokes. ### Revoke (soft disable) ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ### Delete (permanent removal) ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&permanent=true" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key revoked" } ``` Or for permanent deletion: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key deleted" } ``` > [!WARNING] > > **Known issue:** A revoked key can be enabled again with `PATCH ?action=enable` > and revealed with `GET /api/account/keys/reveal`. Revoked and disabled keys > both appear as `is_active: false`. Permanently delete a leaked key. ## Permissions `readonly` members get `403`. A `tech` member can only revoke their own keys; only a **workspace admin** can revoke another member's key. A key that is out of your scope returns `404`, the same as an unknown id. ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X DELETE "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```json 200 Revoked theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key revoked" } ``` ```json 200 Deleted theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key deleted" } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "bad_request" }, "message": "Key ID is required", "request_id": "req_7f3a9c21", "error": "Key ID is required" } ``` ```json 404 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "API key not found", "request_id": "req_7f3a9c21", "error": "API key not found" } ``` # Set API Key Credit Limit Source: https://docs.encrata.com/api-reference/endpoint/set-key-limit POST /api/account/keys/limit Cap how many credits an API key can spend, or remove the cap. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **id** `string` *required* The key's **database id**, as returned by [List API keys](/api-reference/endpoint/list-keys). Not the `key_prefix`. **credit_limit** `integer` The maximum number of credits this key may spend. Must be between `0` and `2147483647`. `0` blocks all spending on the key. Send `null`, or omit the field entirely, to remove the cap. ### Set a limit ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys/limit" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "credit_limit": 5000}' ``` ### Remove the limit (unlimited) ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys/limit" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "credit_limit": null}' ``` ## Response **message** `string` Confirmation message. > [!WARNING] > > **Known issue:** A `credit_limit` above `2147483647` returns `404` with > `API key not found` instead of a validation error. **credit_limit** `integer | null` The newly-applied credit cap, or `null` when the cap was removed. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "Credit limit updated", "credit_limit": 5000 } ``` ## Permissions `readonly` members get `403`. A `tech` member can only change their own keys; only a **workspace admin** can change another member's key. A key that is out of your scope returns `404`, the same as an unknown id. ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys/limit" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "credit_limit": 5000}' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "Credit limit updated", "credit_limit": 5000 } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "bad_request" }, "message": "Credit limit must be a positive number", "request_id": "req_7f3a9c21", "error": "Credit limit must be a positive number" } ``` ```json 404 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "API key not found", "request_id": "req_7f3a9c21", "error": "API key not found" } ``` # Test webhook Source: https://docs.encrata.com/api-reference/endpoint/test-webhook POST /api/webhooks/test Send a synthetic event to a webhook and see how your endpoint replies. Delivers a `test` event to a registered webhook and returns your endpoint's response. Use it to confirm an endpoint is reachable before you depend on it. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!WARNING] > > Testing a webhook requires the workspace `admin` or `tech` role. `readonly` keys get `403`. ## Request **id** `string` *required* The webhook ID to send the test event to. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks/test" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "360cb300-d885-4c18-af2c-d259f936bb38"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/webhooks/test", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"id": "360cb300-d885-4c18-af2c-d259f936bb38"}, ) result = response.json()["result"] print(result["status"], result.get("status_code")) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks/test", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ id: "360cb300-d885-4c18-af2c-d259f936bb38" }), }); const { result } = await response.json(); console.log(result.status, result.status_code); ``` ## What your endpoint receives The test always advertises itself as a `test` event, so your production handler will not mistake it for a real one. ```json Test payload theme={"theme":{"light":"github-light","dark":"vesper"}} { "event": "test", "data": { "test": true, "message": "This is a test webhook from Encrata" }, "created_at": "2026-05-02T12:00:00Z" } ``` For a `generic` webhook the request carries the same headers as a real delivery, including `X-Encrata-Signature` and `X-Encrata-Event: test`. Chat destinations receive their provider's message format instead. The attempt is recorded, so it also appears in [delivery history](/api-reference/endpoint/webhook-deliveries). ## Response Returns `200 OK` whenever the test ran, even if your endpoint rejected it. Read `result.status` to learn the delivery outcome. **success** `boolean` `true` when the test was executed. This describes the API call, not your endpoint's reply. **result** `object` **result** **status** `string` `delivered` when your endpoint returned a 2xx status, otherwise `failed`. **url** `string` The URL the test was sent to. Empty for `telegram`. **status_code** `integer` The HTTP status your endpoint returned. Absent when Encrata could not reach it at all. **response_body** `string` Your endpoint's response body, truncated to 512 bytes. Absent when Encrata could not reach it, or when the body was empty. **error** `string` Present only when the request never completed, such as a DNS failure, a refused connection, or a timeout. The text is a fixed, safe message: transport details are logged, not returned. **message** `string` A human-readable summary. ```json Delivered theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "status": "delivered", "url": "https://example.com/webhooks/encrata", "status_code": 200, "response_body": "OK" }, "message": "Test event sent." } ``` ```json Rejected theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "status": "failed", "url": "https://example.com/webhooks/encrata", "status_code": 401, "response_body": "missing signature" }, "message": "Test event sent." } ``` ```json Unreachable theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "status": "failed", "url": "https://example.com/webhooks/encrata", "error": "We couldn't reach that endpoint. Check that the URL is correct and publicly reachable, then try again." }, "message": "Test event sent." } ``` > [!NOTE] > > A failed test is still `success: true` with HTTP `200`. The API call worked; the delivery did not. Branch on `result.status`. ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | `id` was missing, or the JSON body could not be parsed. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your role is `readonly`. | | `404` | `not_found` | No webhook with that ID exists in your workspace. | | `500` | `internal` | Encrata could not load the webhook. Retry. | ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "forbidden" }, "message": "You don't have permission to manage webhooks." } ``` ## Next steps * [Verify signatures](/webhooks): Make your handler accept the signed payload. * [Inspect deliveries](/api-reference/endpoint/webhook-deliveries): Review attempts, statuses, and retries. * [Update a webhook](/api-reference/endpoint/update-webhook): Fix the URL and test again. * [Error reference](/errors): Every status code the API returns. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/webhooks/test" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "360cb300-d885-4c18-af2c-d259f936bb38"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.post( "https://developer.encrata.com/api/webhooks/test", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"id": "360cb300-d885-4c18-af2c-d259f936bb38"}, ) result = response.json()["result"] print(result["status"], result.get("status_code")) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks/test", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ id: "360cb300-d885-4c18-af2c-d259f936bb38" }), }); const { result } = await response.json(); console.log(result.status, result.status_code); ``` # Enable or Disable API Key Source: https://docs.encrata.com/api-reference/endpoint/toggle-key PATCH /api/account/keys Temporarily disable an API key or re-enable a disabled one. ## Authentication Requires an API key in the `Authorization` header. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **id** `string` *required* The key's **database id**, as returned by [List API keys](/api-reference/endpoint/list-keys). Not the `key_prefix`. **action** `string` *required* The action to perform. One of `disable` or `enable`. ### Disable a key ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ### Re-enable a key ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=enable" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key disabled" } ``` > [!NOTE] > > Disabling is reversible - re-enable the same key with `action=enable`. A > disabled key immediately returns `401` on any request. > [!WARNING] > > **Known issue:** `action=enable` can also re-enable a key that was soft-revoked. > Permanently delete a compromised key instead of relying on revocation. ## Permissions `readonly` members get `403`. A `tech` member can only toggle their own keys; only a **workspace admin** can toggle another member's key. A key that is out of your scope returns `404`, the same as an unknown id. ## Errors Errors return the shared envelope with `success`, `result.code`, `message`, and `request_id`. A legacy `error` key is included alongside it. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PATCH "https://developer.encrata.com/api/account/keys?id=a1b2c3d4-0000-4000-8000-000000000000&action=disable" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "API key disabled" } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "bad_request" }, "message": "Key ID and action (disable|enable) are required", "request_id": "req_7f3a9c21", "error": "Key ID and action (disable|enable) are required" } ``` ```json 404 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "API key not found", "request_id": "req_7f3a9c21", "error": "API key not found" } ``` # Update webhook Source: https://docs.encrata.com/api-reference/endpoint/update-webhook PUT /api/webhooks Change a webhook's URL, events, description, or active status. Applies a partial update. Send only the fields you want to change: anything you leave out keeps its stored value. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!WARNING] > > Updating a webhook requires the workspace `admin` or `tech` role. `readonly` keys get `403`. ## Request **id** `string` *required* The webhook ID to update. This is the only required field. **url** `string` A new HTTPS URL. Must resolve to a public address. Ignored for `telegram` webhooks, whose target comes from the bot token. **events** `string[]` Replaces the subscribed events. Must be non-empty, known, and free of duplicates. See [supported events](/webhooks#supported-events). **description** `string` A new label. Trimmed, and limited to 255 characters. Send `""` to clear it. **is_active** `boolean` Set to `false` to pause deliveries without deleting the webhook. Set to `true` to resume. **chat_id** `string` Re-points a `telegram` webhook at a different chat. Ignored for other kinds. > [!NOTE] > > The destination `kind` is immutable. To move from a generic endpoint to Slack, delete the webhook and create a new one. ### Examples ```bash Pause deliveries theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PUT "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "id": "360cb300-d885-4c18-af2c-d259f936bb38", "is_active": false }' ``` ```bash Change events theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PUT "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "id": "360cb300-d885-4c18-af2c-d259f936bb38", "events": ["lookup.completed", "bulk.completed"] }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests requests.put( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "id": "360cb300-d885-4c18-af2c-d259f936bb38", "url": "https://example.com/webhooks/encrata-v2", }, ) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} await fetch("https://developer.encrata.com/api/webhooks", { method: "PUT", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ id: "360cb300-d885-4c18-af2c-d259f936bb38", url: "https://example.com/webhooks/encrata-v2", }), }); ``` ## Response Returns `200 OK`. The updated webhook is not echoed back. Call [list webhooks](/api-reference/endpoint/webhook) or [get webhook](/api-reference/endpoint/get-webhook) to read the new state. **success** `boolean` `true` when the update was applied. **result** `object` **result** **status** `string` Always `updated`. **message** `string` A human-readable summary. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": { "status": "updated" }, "message": "Webhook updated." } ``` ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | The JSON body could not be parsed. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your role is `readonly`. | | `404` | `not_found` | No webhook with that ID exists in your workspace. | | `422` | `validation_failed` | `id` was missing, or a supplied field failed validation. | | `500` | `internal` | Encrata could not apply the update. Retry. | > [!NOTE] > > A missing `id` returns `422`, not `400`: the body parsed correctly, but a required value was absent. ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "not_found" }, "message": "That webhook no longer exists. It may have been deleted." } ``` ## Next steps * [Send a test event](/api-reference/endpoint/test-webhook): Confirm the new URL is reachable. * [Inspect deliveries](/api-reference/endpoint/webhook-deliveries): See whether deliveries resumed. * [Delete a webhook](/api-reference/endpoint/delete-webhook): Remove an endpoint for good. * [Supported events](/webhooks): Every event you can subscribe to. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X PUT "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "id": "360cb300-d885-4c18-af2c-d259f936bb38", "is_active": false }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests requests.put( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "id": "360cb300-d885-4c18-af2c-d259f936bb38", "url": "https://example.com/webhooks/encrata-v2", }, ) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} await fetch("https://developer.encrata.com/api/webhooks", { method: "PUT", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ id: "360cb300-d885-4c18-af2c-d259f936bb38", url: "https://example.com/webhooks/encrata-v2", }), }); ``` # URL Scan Source: https://docs.encrata.com/api-reference/endpoint/url-scan POST /api/lookup/malware/scan Scan a URL for phishing, malware, and other security threats. URL Scan checks a URL against Encrata's threat-detection signals and returns a verdict, risk score, and supporting indicators. ## Authentication Send your API key as `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. ## Request **kind** `string` *required* Set this value to `url`. **url** `string` *required* The URL to scan. A URL without `http://` or `https://` is scanned as `http://`. **stix** `boolean` Set to `true` to include STIX 2.1 output when available. Defaults to `false`. > [!NOTE] > > Encrata never fetches private or internal addresses, such as `127.0.0.1` or > `10.x.x.x`. For those URLs the verdict is `unknown` and `signals` contains an > `ssrf` signal: "The link resolves to a private or internal address and was > not fetched." ## Example request ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "url", "url": "http://testsafebrowsing.appspot.com/s/phishing.html" }' ``` ## Example response ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "Malicious content detected.", "result": { "scan_id": "scn_abd996a03f8a", "kind": "url", "status": "done", "verdict": "malicious", "score": 80, "submitted_url": "http://testsafebrowsing.appspot.com/s/phishing.html", "final_url": "http://testsafebrowsing.appspot.com/s/phishing.html", "final_domain": "testsafebrowsing.appspot.com", "redirects": [ "http://testsafebrowsing.appspot.com/s/phishing.html" ], "category": "phishing", "confidence": "medium", "attack": [ { "id": "T1566.002", "name": "Phishing: Spearphishing Link", "tactic": "initial-access", "url": "https://attack.mitre.org/techniques/T1566/002/" }, { "id": "T1204.001", "name": "User Execution: Malicious Link", "tactic": "execution", "url": "https://attack.mitre.org/techniques/T1204/001/" }, { "id": "T1598.003", "name": "Phishing for Information: Spearphishing Link", "tactic": "reconnaissance", "url": "https://attack.mitre.org/techniques/T1598/003/" } ], "redirect_hops": [ { "url": "http://testsafebrowsing.appspot.com/s/phishing.html", "status_code": 200, "host": "testsafebrowsing.appspot.com" } ], "domain": { "name": "testsafebrowsing.appspot.com", "tld": "appspot.com", "risky_tld": false }, "hosting": { "ip": "142.250.154.153", "reverse_dns": "bt-in-f153.1e100.net", "asn": 15169, "as_name": "Google LLC", "org": "Google LLC", "country": "United States", "country_code": "US", "in_eu": false, "network_cidr": "142.250.0.0/15", "rir": "ARIN", "abuse_contact": "network-abuse@google.com", "cloud_provider": "Google Cloud", "is_hosting": true, "is_vpn": true, "is_proxy": true, "is_tor": false, "blocklisted": false }, "page": { "status_code": 200, "content_type": "text/html", "server": "Google Frontend", "size_bytes": 989, "password_fields": 1, "forms": 0, "iframes": 0, "hidden_iframes": 0, "external_scripts": 0, "obfuscated_js": false, "security_headers": { "hsts": false, "csp": false, "x_frame_options": false } }, "threat_intel": [ { "source": "encrata intelligence", "status": "listed", "malicious": true, "malware_families": [ "Mal/HTMLGen-A" ], "categories": [ "misc", "not recommended site", "information technology", "phishing and fraud", "Phishing and Other Frauds", "Information Technology, Suspicious (alphaMountain.ai)" ], "first_seen": "2016-06-01T12:33:36Z", "last_seen": "2026-10-29T16:21:02Z", "detections": { "malicious": 10, "suspicious": 3, "harmless": 47, "undetected": 33 }, "detail": "10 security engine(s) flagged this URL as malicious." } ], "data_residency": "global", "signals": [ { "source": "tls", "malicious": false, "detail": "The final page is served over plain HTTP, without encryption.", "severity": "info" }, { "source": "page", "malicious": false, "detail": "The page asks for a password over an unencrypted (HTTP) connection.", "severity": "high" }, { "source": "multi_engine_reputation", "malicious": true, "detail": "10 security engine(s) flagged this URL as malicious.", "severity": "critical" } ], "iocs": [ { "type": "domain", "value": "testsafebrowsing.appspot.com" }, { "type": "url", "value": "http://testsafebrowsing.appspot.com/s/phishing.html" }, { "type": "ip", "value": "142.250.154.153", "source": "hosting" } ], "scanned_at": "2026-11-02T05:26:37.446397467Z" } } ``` This is the full response for the example request. Fields that don't apply to a URL are omitted. For example, `tls` is missing here because the page is served over plain HTTP. ## Response **success** `boolean` `true` when the scan completed. **message** `string` Human-readable summary of the verdict, such as `Malicious content detected.` **result** `object` The URL scan result. **result fields** **scan_id** `string` Scan ID in the form `scn_` followed by 12 hex characters. **kind** `string` Always `url` for this endpoint. **status** `string` `done` when the scan completed. **verdict** `string` `clean`, `suspicious`, `malicious`, or `unknown`. **score** `integer` Risk score from `0` (safe) to `100` (dangerous). **submitted_url** `string` The URL that Encrata scanned, after adding `http://` when the request had no scheme. **final_url** `string` The URL after redirects. **final_domain** `string` Host of the final URL. **redirects** `string[]` Every URL in the redirect chain, in order. Contains only the submitted URL when there were no redirects. **category** `string` `c2`, `malware_distribution`, `phishing`, `malicious`, `suspicious`, `benign`, or `unknown`. **confidence** `string` How much evidence supports the verdict: `high`, `medium`, or `low`. It isn't derived from `score`. A `malicious` verdict is `medium` with one malicious signal (score `80`) and `high` with two or more (score `100`). See [Confidence](/api-reference/endpoint/malware-scan#confidence) for every verdict. **attack** `object[]` MITRE ATT\&CK mappings, present when the URL is malicious. Each item contains `id`, `name`, `tactic`, and `url` (a link to the technique on attack.mitre.org). **redirect_hops** `object[]` One item per hop in the redirect chain. Each item contains `url`, `status_code`, and `host`. **domain** `object` Registration and DNS data for the final domain. **domain fields** **name** `string` Domain name. **tld** `string` Public suffix, such as `com` or `appspot.com`. **risky_tld** `boolean` `true` when the TLD is commonly abused. **registrar** `string` Registrar name. **created_at** `string` Registration date. **updated_at** `string` Last update date. **expires_at** `string` Expiry date. **age_days** `integer` Days since registration. **status** `string[]` Registry status codes. **nameservers** `string[]` Authoritative nameservers. **dnssec** `string` DNSSEC status. **registrant_org** `string` Registrant organization. **registrant_country** `string` Registrant country. Registration fields are omitted when the registry doesn't return them, as for subdomains like `testsafebrowsing.appspot.com`. **tls** `object` Certificate data for HTTPS URLs: `version`, `cipher_suite`, `trusted`, `self_signed`, `expired`, `issuer`, `issuer_org`, `subject`, `sans`, `not_before`, `not_after`, `days_remaining`, `cert_age_days`, `fingerprint_sha256`, and `serial`. Omitted for plain HTTP. **hosting** `object` Data about the server that hosts the final URL. **hosting fields** **ip** `string` IP address the domain resolved to. **reverse_dns** `string` PTR record for the IP. **asn** `integer` Autonomous system number. **as_name** `string` Autonomous system name. **org** `string` Organization that owns the network. **country** `string` Country name. **country_code** `string` ISO 3166-1 alpha-2 country code. **in_eu** `boolean` `true` when the IP is in the EU. **network_cidr** `string` Network range that contains the IP. **rir** `string` Regional internet registry, such as `ARIN` or `RIPE`. **abuse_contact** `string` Takedown contact for the hosting network. **cloud_provider** `string` Cloud provider, when the IP belongs to one. **is_hosting** `boolean` `true` for data center or hosting IPs. **is_vpn** `boolean` `true` when the IP is a known VPN endpoint. **is_proxy** `boolean` `true` when the IP is a known proxy. **is_tor** `boolean` `true` for Tor exit nodes. **blocklisted** `boolean` `true` when the IP appears on a blocklist. **blocklists** `string[]` Blocklists that list the IP. Present only when `blocklisted` is `true`. **c2** `object` Command-and-control attribution. Present only when the IP is a known C2 server. **page** `object` Static analysis of the final page. Encrata doesn't execute scripts from the scanned URL. **page fields** **status_code** `integer` HTTP status of the final response. **content_type** `string` `Content-Type` of the response. **server** `string` `Server` header value. **powered_by** `string` `X-Powered-By` header value. **title** `string` Page title. **size_bytes** `integer` Response body size. **password_fields** `integer` Number of password inputs. **forms** `integer` Number of forms. **external_form_targets** `string[]` Form actions that post to another domain. **iframes** `integer` Number of iframes. **hidden_iframes** `integer` Number of hidden iframes. **external_scripts** `integer` Number of scripts loaded from other domains. **meta_refresh** `string` Target of a `` redirect. **obfuscated_js** `boolean` `true` when inline JavaScript looks obfuscated. **brands_mentioned** `string[]` Brands the page references, used for impersonation checks. **security_headers** `object` Whether the response sets `hsts`, `csp`, and `x_frame_options`. **favicon** `object` Favicon details. **download** `object` Details of a file the URL serves for download. **threat_intel** `object[]` Reputation results. **threat_intel fields** **source** `string` Always `encrata intelligence`. **status** `string` `listed`, `not_listed`, `error`, or `skipped`. **malicious** `boolean` `true` when the source flags the URL as malicious. **threat_type** `string` Threat type, when known. **malware_families** `string[]` Malware families associated with the URL. **tags** `string[]` Tags associated with the URL. **categories** `string[]` Content and threat categories assigned to the URL. **first_seen** `string` ISO 8601 timestamp when the URL was first seen. **last_seen** `string` ISO 8601 timestamp when the URL was last seen. **confidence** `integer` Source confidence score. **detections** `object` Engine counts: `malicious`, `suspicious`, `harmless`, and `undetected`. **payloads** `object[]` Malware payloads linked to the URL. **detail** `string` Summary of the result. **data_residency** `string` `global` or `eu`. **signals** `object[]` Evidence for the verdict. Each item contains `source`, `malicious`, `detail`, and optional `severity` (`info`, `low`, `medium`, `high`, or `critical`). **iocs** `object[]` Indicators of compromise found during the scan. Each item contains `type` (such as `url`, `domain`, or `ip`), `value`, and optional `source`. **scanned_at** `string` ISO 8601 timestamp for the scan. **stix** `object` STIX 2.1 bundle. Present only when the request sets `stix: true`. See [Malware Scan](/api-reference/endpoint/malware-scan) for fields shared with other scan kinds. ## Errors The API returns `400` for an invalid URL, `401` for a missing or invalid API key, `402` when your account has insufficient credits, and `429` when you exceed a rate limit. ## Credits A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "url", "url": "http://testsafebrowsing.appspot.com/s/phishing.html" }' ``` ```json 200 theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "message": "Malicious content detected.", "result": { "scan_id": "scn_abd996a03f8a", "kind": "url", "status": "done", "verdict": "malicious", "score": 80, "submitted_url": "http://testsafebrowsing.appspot.com/s/phishing.html", "final_url": "http://testsafebrowsing.appspot.com/s/phishing.html", "final_domain": "testsafebrowsing.appspot.com", "redirects": [ "http://testsafebrowsing.appspot.com/s/phishing.html" ], "category": "phishing", "confidence": "medium", "attack": [ { "id": "T1566.002", "name": "Phishing: Spearphishing Link", "tactic": "initial-access", "url": "https://attack.mitre.org/techniques/T1566/002/" }, { "id": "T1204.001", "name": "User Execution: Malicious Link", "tactic": "execution", "url": "https://attack.mitre.org/techniques/T1204/001/" }, { "id": "T1598.003", "name": "Phishing for Information: Spearphishing Link", "tactic": "reconnaissance", "url": "https://attack.mitre.org/techniques/T1598/003/" } ], "redirect_hops": [ { "url": "http://testsafebrowsing.appspot.com/s/phishing.html", "status_code": 200, "host": "testsafebrowsing.appspot.com" } ], "domain": { "name": "testsafebrowsing.appspot.com", "tld": "appspot.com", "risky_tld": false }, "hosting": { "ip": "142.250.154.153", "reverse_dns": "bt-in-f153.1e100.net", "asn": 15169, "as_name": "Google LLC", "org": "Google LLC", "country": "United States", "country_code": "US", "in_eu": false, "network_cidr": "142.250.0.0/15", "rir": "ARIN", "abuse_contact": "network-abuse@google.com", "cloud_provider": "Google Cloud", "is_hosting": true, "is_vpn": true, "is_proxy": true, "is_tor": false, "blocklisted": false }, "page": { "status_code": 200, "content_type": "text/html", "server": "Google Frontend", "size_bytes": 989, "password_fields": 1, "forms": 0, "iframes": 0, "hidden_iframes": 0, "external_scripts": 0, "obfuscated_js": false, "security_headers": { "hsts": false, "csp": false, "x_frame_options": false } }, "threat_intel": [ { "source": "encrata intelligence", "status": "listed", "malicious": true, "malware_families": [ "Mal/HTMLGen-A" ], "categories": [ "misc", "not recommended site", "information technology", "phishing and fraud", "Phishing and Other Frauds", "Information Technology, Suspicious (alphaMountain.ai)" ], "first_seen": "2016-06-01T12:33:36Z", "last_seen": "2026-10-29T16:21:02Z", "detections": { "malicious": 10, "suspicious": 3, "harmless": 47, "undetected": 33 }, "detail": "10 security engine(s) flagged this URL as malicious." } ], "data_residency": "global", "signals": [ { "source": "tls", "malicious": false, "detail": "The final page is served over plain HTTP, without encryption.", "severity": "info" }, { "source": "page", "malicious": false, "detail": "The page asks for a password over an unencrypted (HTTP) connection.", "severity": "high" }, { "source": "multi_engine_reputation", "malicious": true, "detail": "10 security engine(s) flagged this URL as malicious.", "severity": "critical" } ], "iocs": [ { "type": "domain", "value": "testsafebrowsing.appspot.com" }, { "type": "url", "value": "http://testsafebrowsing.appspot.com/s/phishing.html" }, { "type": "ip", "value": "142.250.154.153", "source": "hosting" } ], "scanned_at": "2026-11-02T05:26:37.446397467Z" } } ``` # Email Validity Source: https://docs.encrata.com/api-reference/endpoint/validate-email POST /api/lookup/email/validity Check if an email address is deliverable, invalid, or disposable. 1 credit, with free repeats for 6 months. ## Overview Email Validity checks whether an address is safe to send to: is it **deliverable**, **invalid**, **disposable**, a **catch-all** domain that accepts anything, or otherwise **risky**. Each result carries a status, a machine-readable reason, and a confidence score, plus enrichment signals: domain trust, breach exposure, gravatar, person-signal, and mail-security records (DKIM/BIMI/DNSSEC). Use it to scrub a list before a send and cut bounces. Validate a single address here (1 credit), or run a whole list through the [bulk job pipeline](#bulk-jobs) below. ## Authentication Requires an API key in the `Authorization` header. In the API playground, enter the full value `Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` in the **Authorization** field. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Request **email** `string` *required* The email address to validate. > [!WARNING] > > Request bodies are capped at **1 MiB**. Anything larger returns `413`. ### Example request ```bash cURL (API Key) theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/validity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/validity", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ## Response **email** `string` The email address that was validated (normalized to lowercase). **status** `string` The public verdict - one of `valid`, `invalid`, `catch-all`, or `risky`. **reason** `string` Machine-readable explanation, e.g. `deliverable`, `syntax`, `disposable`, `null_mx`, `no_dns`, `no_mail_route`, `hard_reject`, `unverifiable`, `greylist_unresolved`, `ip_blocked`, `unreachable`, `abuse_reported`, `catch_all`, or `catchall_corroborated`. **disposable** `boolean` `true` when the domain is a known disposable/temporary provider. **confidence** `string` Provider-calibrated confidence - `high`, `medium`, or `low`. **role** `boolean` `true` for role/shared mailboxes (e.g. `support@`). A flag only - role accounts still deliver. **role_name** `string` The matched role local-part when `role` is `true` (e.g. `support`). This field is always present and is `""` when no role is found. **did_you_mean** `string` A suggested correction when available. This field is always present and is `""` when empty. > [!WARNING] > > **Known issue:** `did_you_mean` is currently not populated; > `john.smith@gmial.com` returns `""`. **domain** `string` The domain part of the address. **provider** `string` Mailbox provider classification - `google`, `microsoft`, `yahoo`, or `other`. **free_provider** `boolean` `true` for free consumer mailbox providers (Gmail, Outlook, etc.). **canonical** `string` The canonicalized address (e.g. Gmail dot/plus normalization). **mx** `string[] | null` The domain's resolved mail servers (MX hosts) in preference order. This is `null` when the domain has no mail route. **domain_trust** `object` The domain's **email-authentication posture** (non-voting). Not domain age or reputation: `grade` (A-F), `spf`, `dkim`, `dkim_selectors`, `dmarc`, `dmarc_policy`, `tls_rpt`, `bimi`, `bimi_record`, and `dnssec`. `mta_sts` is a string: `enforce`, `testing`, or `none`. Raw records are returned in `spf_record`, `dmarc_record`, `tls_rpt_record`, and `mta_sts_record`. **person_signal** `object` OSINT corroboration: `count` of independent hits and the `sources` that hit (`hibp`, `gravatar`, `github`, `gitlab`, `pgp`). A positive signal on a catch-all domain promotes the status to `valid`. **smtp** `object` Technical probe detail when available: `mx_host`, `message`, `catch_all`, and `greylisted`. This is `null` when the domain has no mail route. **domain_info** `object` Domain registration and DNS detail: `registrar`, `created_at`, `expires_at`, `age_days`, `nameservers`, `dnssec`, and `a`. **mail_servers** `object[] | null` An **array** of per-MX infrastructure and TLS detail objects, one entry per resolved mail server. This is `null` when the domain has no mail route. **footprint** `object` Identity footprint signals. `breaches` is an object with `count`, `exposed_data`, and `services`, where each service contains `name`, `date`, and `data_types`. The object can also contain `gravatar_url` and `registered_services`, whose entries contain `name`, `category`, and `url`. **provider_answered** `boolean` `true` when the mailbox provider itself answered the probe. `false` means the verdict rests on DNS and heuristics alone. **checked_at** `string` ISO 8601 timestamp of when the check ran. **message** `string` Human-readable explanation of the verdict. **validity** `string` *deprecated* Legacy mirror of `status`, retained for backward compatibility. **credits** `number` Credits charged for this request. `1` on a fresh charge, or `0` when **you** were already charged for this address during the [6-month free-repeat window](/credits#free-repeat-window). This is per-customer and independent of `cached` - a cached result is still charged `1` if it's your first request for that address in the window. **cached** `boolean` Whether the **deliverability verdict** was served from Encrata's cache. This field is always present as `true` or `false`. It is a performance signal, not a billing signal. A cached result can still cost `1` credit. ## Errors Errors return a JSON body of the form `{"error": "", "code": ""}` with the matching HTTP status code. | Status | `code` | `error` | Cause | | - | - | - | - | | 400 | `bad_request` | `Invalid request body` | Malformed JSON | | 400 | `bad_request` | `Invalid email address` | `email` missing or not a valid address | | 402 | `insufficient_credits` | (not verified) | No credits and not a free repeat | | 405 | `method_not_allowed` | `Only POST method is allowed` | Wrong method | | 413 | `payload_too_large` | `Request body too large.` | Body over 1 MiB | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/validity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "test@example.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "test@example.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/validity", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "test@example.com" }), }); const data = await resp.json(); ``` ```json 200 Valid theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "satya@microsoft.com", "status": "valid", "reason": "deliverable", "disposable": false, "confidence": "high", "role": false, "role_name": "", "did_you_mean": "", "domain": "microsoft.com", "provider": "microsoft", "free_provider": false, "mx": ["microsoft-com.mail.protection.outlook.com"], "domain_trust": { "grade": "A", "spf": true, "dkim": true, "dmarc": true }, "person_signal": { "count": 1, "sources": ["hibp"] }, "provider_answered": true, "message": "Mailbox exists and accepts mail, safe to send.", "validity": "valid", "credits": 1, "cached": false } ``` ```json 200 Disposable theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "user@tempmail.com", "status": "invalid", "reason": "disposable", "disposable": true, "role_name": "", "did_you_mean": "", "provider_answered": false, "message": "Undeliverable, will bounce or is not worth sending.", "validity": "invalid", "credits": 1, "cached": false } ``` ```json 200 Free repeat theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "satya@microsoft.com", "status": "valid", "reason": "deliverable", "provider_answered": true, "message": "Mailbox exists and accepts mail, safe to send.", "validity": "valid", "credits": 0, "cached": true } ``` ```json 400 theme={"theme":{"light":"github-light","dark":"vesper"}} { "code": "bad_request", "error": "Invalid email address" } ``` ## Notes * Each validation costs **1 credit**. Repeat checks of the same address during the [6-month free-repeat window](/credits#free-repeat-window) are free (`credits: 0`). * `cached` and `credits` are independent. `cached` reports a cache hit on the deliverability verdict; `credits: 0` is the billing signal. * Disposable detection runs first; disposable domains are flagged (`disposable: true`) and marked `invalid`. * A corroborated catch-all can be promoted from `catch-all` to `valid` via `person_signal`. ## Bulk jobs To validate a whole list, submit it as a bulk job instead of looping this endpoint. One entrypoint handles every lookup - set `type=validity` - and a webhook delivers the finished file when it's done. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=validity" \ -F "download_link=true" \ -F "file=@list.csv" ``` * Up to **1,000,000 emails per job**, charged **1 credit per email**. * `download_link=true` returns a `download_url` in the `bulk.completed` webhook; fetch it with your API key. * Export filters: `all`, `valid`, `invalid`, `catch-all`, `risky`. See the [Bulk Operations guide](/guides/bulk-operations) for the webhook payload and download options. # List webhooks Source: https://docs.encrata.com/api-reference/endpoint/webhook GET /api/webhooks List every webhook endpoint registered in your workspace. Returns every webhook endpoint in the workspace your API key belongs to. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` Any workspace role can list webhooks: `admin`, `tech`, or `readonly`. ## Request This endpoint takes no parameters. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.get( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) for webhook in response.json()["result"]: print(webhook["id"], webhook["url"], webhook["is_active"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks", { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); const { result } = await response.json(); result.forEach((webhook) => console.log(webhook.id, webhook.url, webhook.is_active)); ``` ## Response **success** `boolean` `true` when the request succeeded. **result** `object[]` The workspace's webhook endpoints, newest first. An empty workspace returns `[]`. **webhook** **id** `string` Webhook identifier (UUID). Use it with [update](/api-reference/endpoint/update-webhook), [delete](/api-reference/endpoint/delete-webhook), [test](/api-reference/endpoint/test-webhook), and [deliveries](/api-reference/endpoint/webhook-deliveries). **workspace_id** `string` The workspace this webhook belongs to. **kind** `string` Destination type: `generic`, `slack`, `discord`, or `telegram`. **url** `string` The HTTPS URL that receives deliveries. Empty for `telegram`, whose target is derived from the bot token. **events** `string[]` The event types this webhook is subscribed to. See [supported events](/webhooks#supported-events). **is_active** `boolean` Whether Encrata currently delivers to this endpoint. **description** `string` Your label for the webhook. Empty string when unset. **config** `object` Destination-specific settings. Present only for `telegram`, where it carries `chat_id`. **created_by** `string | null` User ID of the creator, or `null` when the creator is unknown or has been removed. **created_at** `string` ISO 8601 creation timestamp. **updated_at** `string` ISO 8601 last-updated timestamp. **message** `string` A human-readable summary. Do not branch on it. > [!NOTE] > > Signing secrets are never returned by this endpoint. To read a secret, fetch the single webhook with [`GET /api/webhooks/{id}`](/api-reference/endpoint/get-webhook) as a workspace admin. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": [ { "id": "360cb300-d885-4c18-af2c-d259f936bb38", "workspace_id": "51cdc9d9-203c-4345-b06d-222b560460aa", "kind": "generic", "url": "https://example.com/webhooks/encrata", "events": ["lookup.completed", "apikey.created"], "is_active": true, "description": "Production webhook", "created_by": "e861d7cb-1d7f-48d9-ab13-9af06a4055cf", "created_at": "2026-05-02T12:00:00Z", "updated_at": "2026-05-02T12:00:00Z" }, { "id": "c0a8f1e2-5b3d-4a77-9c21-7f0e4d6b8a19", "workspace_id": "51cdc9d9-203c-4345-b06d-222b560460aa", "kind": "slack", "url": "https://hooks.slack.com/services/T000/B000/XXXXXXXX", "events": ["credits.low"], "is_active": true, "description": "#alerts channel", "created_by": "e861d7cb-1d7f-48d9-ab13-9af06a4055cf", "created_at": "2026-05-04T09:12:00Z", "updated_at": "2026-05-04T09:12:00Z" } ], "message": "Webhooks loaded." } ``` ## Errors | Status | Code | When | | - | - | - | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your key resolves to no workspace membership. | | `500` | `internal` | Encrata could not load the webhooks. Retry. | Failures use the same envelope with `success: false` and the code in `result.code`: ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "forbidden" }, "message": "You don't have access to this workspace." } ``` ## Next steps * [Create a webhook](/api-reference/endpoint/create-webhook): Register an endpoint and get its signing secret. * [Verify signatures](/webhooks): Check that a delivery really came from Encrata. * [Inspect deliveries](/api-reference/endpoint/webhook-deliveries): See recent attempts and your endpoint's replies. * [Error reference](/errors): Every status code the API returns. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.get( "https://developer.encrata.com/api/webhooks", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, ) for webhook in response.json()["result"]: print(webhook["id"], webhook["url"], webhook["is_active"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const response = await fetch("https://developer.encrata.com/api/webhooks", { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); const { result } = await response.json(); result.forEach((webhook) => console.log(webhook.id, webhook.url, webhook.is_active)); ``` # List deliveries Source: https://docs.encrata.com/api-reference/endpoint/webhook-deliveries GET /api/webhooks/deliveries Inspect recent delivery attempts for one webhook. Returns the 50 most recent delivery attempts for a webhook, including your endpoint's reply. This is the first place to look when a webhook is not arriving. ## Authentication Send your Encrata API key in the `Authorization` header with the `Bearer` prefix. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` Any workspace role can read deliveries: `admin`, `tech`, or `readonly`. ## Request **webhook_id** `string` *required* The webhook to list deliveries for. > [!NOTE] > > This endpoint is not paginated. It always returns at most 50 records, newest first. There is no `limit`, `page`, or `offset` parameter. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks/deliveries?webhook_id=360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.get( "https://developer.encrata.com/api/webhooks/deliveries", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, params={"webhook_id": "360cb300-d885-4c18-af2c-d259f936bb38"}, ) for delivery in response.json()["result"]: print(delivery["event_type"], delivery["status"], delivery["attempts"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const url = new URL("https://developer.encrata.com/api/webhooks/deliveries"); url.searchParams.set("webhook_id", "360cb300-d885-4c18-af2c-d259f936bb38"); const response = await fetch(url, { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); const { result } = await response.json(); result.forEach((d) => console.log(d.event_type, d.status, d.attempts)); ``` ## Response **success** `boolean` `true` when the request succeeded. **result** `object[]` Delivery attempts, newest first. A webhook with no history returns `[]`. **delivery** **id** `string` Delivery identifier (UUID). **webhook_id** `string` The webhook this delivery belongs to. **event_type** `string` The event that triggered the delivery, or `test` for a [test event](/api-reference/endpoint/test-webhook). **payload** `object` The exact JSON envelope that was sent. For a `generic` webhook this is the body the signature was computed over. **status** `string` `pending`, `retrying`, `delivered`, or `failed`. See the table below. **attempts** `integer` How many attempts have been made, counting the first. Caps at 4. **last_attempt_at** `string | null` ISO 8601 timestamp of the most recent attempt, or `null` before the first attempt. **response_status** `integer | null` The HTTP status your endpoint returned, or `null` when the request never completed. **response_body** `string | null` Your endpoint's response body, sanitized and truncated, or `null` when unavailable. **created_at** `string` ISO 8601 timestamp of when the delivery was queued. **message** `string` A human-readable summary. ```json Example response theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true, "result": [ { "id": "8f2b1c90-4a7e-4d31-9b6f-2c5e81a40d77", "webhook_id": "360cb300-d885-4c18-af2c-d259f936bb38", "event_type": "lookup.completed", "payload": { "event": "lookup.completed", "data": { "email": "satya@microsoft.com" }, "created_at": "2026-05-02T12:00:00Z" }, "status": "delivered", "attempts": 1, "last_attempt_at": "2026-05-02T12:00:01Z", "response_status": 200, "response_body": "OK", "created_at": "2026-05-02T12:00:00Z" }, { "id": "b41d7a62-9e05-4f88-a0c3-6d2f93b715ae", "webhook_id": "360cb300-d885-4c18-af2c-d259f936bb38", "event_type": "credits.low", "payload": { "event": "credits.low", "data": { "credits_remaining": 500 }, "created_at": "2026-05-02T11:40:00Z" }, "status": "retrying", "attempts": 2, "last_attempt_at": "2026-05-02T11:42:30Z", "response_status": 503, "response_body": "service unavailable", "created_at": "2026-05-02T11:40:00Z" } ], "message": "Deliveries loaded." } ``` ### Delivery statuses | Status | Meaning | | - | - | | `pending` | Queued, not yet attempted. | | `retrying` | An attempt failed and another is scheduled. | | `delivered` | Your endpoint returned a 2xx status. | | `failed` | Every attempt was used without a 2xx response. | ### Retry schedule Encrata allows a delivery 4 attempts in total and waits 10 seconds for each one. | Attempt | Delay before it runs | | - | - | | 1 | Immediate | | 2 | 30 seconds | | 3 | 2 minutes | | 4 | 10 minutes | If your endpoint returns a `Retry-After` header with a longer delay, Encrata honours it, up to a maximum of 15 minutes. After the fourth attempt the delivery is marked `failed` and is not retried. ## Errors | Status | Code | When | | - | - | - | | `400` | `bad_request` | `webhook_id` was missing. | | `401` | `unauthorized` | The API key is missing, revoked, or disabled. | | `403` | `forbidden` | Your key resolves to no workspace membership. | | `404` | `not_found` | No webhook with that ID exists in your workspace. | | `500` | `internal` | Encrata could not load the delivery history. Retry. | ```json Example error theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "bad_request" }, "message": "A webhook id is required." } ``` ## Next steps * [Send a test event](/api-reference/endpoint/test-webhook): Reproduce a failure on demand. * [Verify signatures](/webhooks): A 401 from your own handler usually means a signature mismatch. * [Update a webhook](/api-reference/endpoint/update-webhook): Point the webhook at a working URL. * [Error reference](/errors): Every status code the API returns. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl "https://developer.encrata.com/api/webhooks/deliveries?webhook_id=360cb300-d885-4c18-af2c-d259f936bb38" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests response = requests.get( "https://developer.encrata.com/api/webhooks/deliveries", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, params={"webhook_id": "360cb300-d885-4c18-af2c-d259f936bb38"}, ) for delivery in response.json()["result"]: print(delivery["event_type"], delivery["status"], delivery["attempts"]) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const url = new URL("https://developer.encrata.com/api/webhooks/deliveries"); url.searchParams.set("webhook_id", "360cb300-d885-4c18-af2c-d259f936bb38"); const response = await fetch(url, { headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, }); const { result } = await response.json(); result.forEach((d) => console.log(d.event_type, d.status, d.attempts)); ``` # Response Fields Source: https://docs.encrata.com/api-reference/fields Complete guide to every field returned by the Encrata Lookup API: what it means, where it comes from, and what to expect. The Lookup API returns a profile object across identity, work, education, social, company, and security categories. > [!TIP] > > In the [Sandbox](https://developer.encrata.com/sandbox), hover over any field name to see a short description. This page provides the full reference. *** ## Data sources Encrata aggregates data from multiple sources in a single API call: | Source | Fields powered | Description | | - | - | - | | **Profile Enrichment** | Name, bio, company, job role, education, `company_info` | Structured profile data aggregated from multiple public sources | | **Professional Networks** | Name, job role, company, industry, socials, education | Professional profile enrichment | | **Email Validity** | `validity` | Real-time mailbox verification | | **Breach Database** | `breach_info` | Breach history from breach databases | | **Account Detection** | `registered_services` | Probes 219+ platforms to detect where the email is registered | *** ## Person fields Core identity and demographic data about the person. | Field | Type | Description | Example | | - | - | - | - | | `first_name` | string | Person's first/given name | `"Satya"` | | `middle_name` | string | Middle name, if available | `"Narayana"` | | `last_name` | string | Last/family name | `"Nadella"` | | `age` | string | Estimated age (derived from public records) | `"57"` | | `gender` | string | Gender `Male`, `Female`, or empty if unknown | `"Male"` | | `nationality` | string | Country of citizenship | `"American"` | | `country` | string | Country where the person is currently based | `"United States"` | | `city` | string | City where the person is currently based | `"Redmond"` | | `birthplace` | string | City/country where the person was born | `"Hyderabad, India"` | | `current_location` | string | Full current location string | `"Redmond, WA, US"` | | `bio` | string | Short biography or description | `"Chairman and CEO of Microsoft..."` | | `photo_url` | string | URL to the person's profile photo | `"https://..."` | | `interests` | string | Known hobbies, interests, or topics (comma-separated) | `"Cloud Computing, AI, Cricket"` | *** ## Work fields Professional and career information. | Field | Type | Description | Example | | - | - | - | - | | `company` | string | Current employer or company name | `"Microsoft"` | | `job_role` | string | Current job title or position | `"Chairman and CEO of Microsoft"` | | `industry` | string | Industry sector | `"Technology"` | | `website` | string | Personal website or portfolio URL | `"https://microsoft.com"` | *** ## Education fields Academic background. | Field | Type | Description | Example | | - | - | - | - | | `education` | string | Comma-separated list of institutions attended | `"University of Wisconsin-Milwaukee, Manipal Institute of Technology"` | | `education_level` | string | Highest education level achieved | `"Master's"` | | `university` | string | Primary university or college | `"University of Wisconsin-Milwaukee"` | | `field_of_study` | string | Major or area of study | `"Computer Science"` | *** ## Social fields Links to social media profiles. These are nested at **`person.socials.`**. There are no top-level social fields. Empty string if not found. | Field | Type | Description | Example | | - | - | - | - | | `person.socials.linkedin` | string | LinkedIn profile URL | `"https://linkedin.com/in/satyanadella"` | | `person.socials.twitter` | string | Twitter/X profile URL | `"https://twitter.com/satyanadella"` | | `person.socials.instagram` | string | Instagram profile URL | `""` | | `person.socials.facebook` | string | Facebook profile URL | `""` | | `person.socials.github` | string | GitHub profile URL | `""` | *** ## Company fields Structured data about the person's employer, nested at **`person.company_info.`**. There are no flat `company_*` fields. | Field | Type | Description | Example | | - | - | - | - | | `person.company_info.name` | string | Official registered company name | `"Microsoft Corporation"` | | `person.company_info.phone` | string | Company phone number | `"+1-425-882-8080"` | | `person.company_info.address` | string | Company physical address | `"One Microsoft Way, Redmond, WA 98052"` | | `person.company_info.website` | string | Company website URL | `"https://microsoft.com"` | | `person.company_info.category` | string | Business category classification | `"Technology company"` | | `person.company_info.rating` | number | Average star rating (1.0-5.0) | `4.1` | | `person.company_info.rating_count` | integer | Total number of reviews | `25000` | | `person.company_info.price_level` | string | Price level indicator | `"$$"` | | `person.company_info.latitude` | number | Company HQ latitude coordinate | `47.6396` | | `person.company_info.longitude` | number | Company HQ longitude coordinate | `-122.1283` | | `person.company_info.attributes` | object | Key-value pairs with extra info | `{"Founded": "1975"}` | *** ## Security fields Email security, breach exposure, and account detection. ### `validity` Email deliverability status. Returns a single string value. | Value | Meaning | | - | - | | `valid` | Mailbox exists and accepts mail | | `invalid` | Mailbox does not exist or rejects mail | | `catch-all` | Domain accepts any address; existence is unconfirmed | | `risky` | Ambiguous or temporary - the provider produced no verifiable result | ### `breach_info` Data breach history from aggregated breach databases. Returns an object. | Sub-field | Type | Description | | - | - | - | | `breach_count` | integer | Total number of breaches the email appears in | | `services` | array | List of breached services (`name`, `domain`, `breach_date`, `data_types`) | | `interests` | array | Inferred interest categories based on breach sources (e.g., Gaming sites → `{"category": "Gaming", "signal": 3}`) | | `exposed_data` | array | All unique data types leaked across all breaches (e.g., `["Passwords", "Email addresses", "IP addresses"]`) | Each item in `services`: | Sub-field | Type | Description | | - | - | - | | `name` | string | Breach name (e.g., "LinkedIn", "Adobe") | | `domain` | string | Domain of the breached service | | `breach_date` | string | Date the breach occurred | | `data_types` | array | Types of data exposed in this specific breach | ### `registered_services` Detects which online services the email is registered on by probing login, registration, and password-reset flows across **219+ platforms** (GitHub, Spotify, Netflix, Adobe, etc.). | Sub-field | Type | Description | | - | - | - | | `total_checked` | integer | Number of platforms probed | | `registered_count` | integer | Number of platforms where the email is registered | | `services` | array | Registered services as **objects**, each `{ name }` plus optional `recovery_email` and `recovery_phone`. Not a list of plain strings | > [!WARNING] > > **Recovery data** (partial emails/phones like `s***a@outlook.com` or `+1***456`) may be exposed by platforms during password reset flows. This is public information but should be handled carefully. *** ## Dedicated endpoint responses The fields above describe the **full identity lookup** (`POST /api/lookup/email/identity`), which returns everything in one call. Encrata also exposes focused, single-purpose endpoints that return only their own compact response. Use these when you need one signal quickly and cheaply. Each endpoint's full response schema lives on its reference page, linked below. | Endpoint | Route | Returns | | - | - | - | | [Email Validity](/api-reference/endpoint/validate-email) | `POST /api/lookup/email/validity` | Deliverability verdict plus domain and MX enrichment | | [Email Gender](/api-reference/endpoint/email-gender) | `POST /api/lookup/email/gender` | Likely gender and country behind an address | | [Email Breaches](/api-reference/endpoint/check-breaches) | `POST /api/lookup/email/breaches` | Breach exposure for the address | | [Email Compliance](/api-reference/endpoint/email-compliance) | `POST /api/lookup/email/compliance` | Send-legality guidance and applicable laws | | [Password Breaches](/api-reference/endpoint/password-breaches) | `POST /api/lookup/email/password/breaches` | Whether a password appears in known breaches (k-anonymity) | | [GitHub Leaks](/api-reference/endpoint/github-leaks) | `POST /api/lookup/breaches/github` | Secrets leaked in a public GitHub repository | | [Exposed API Keys](/api-reference/endpoint/exposed-api-keys) | `POST /api/lookup/breaches/exposed-keys` | Credentials exposed in collected text and their validation state | | [Malware Scan](/api-reference/endpoint/malware-scan) | `POST /api/lookup/malware/scan` | Safety verdict for a URL, QR code, barcode, image, or file | > [!NOTE] > > Email lookup responses use the [6-month free-repeat window](/credits#free-repeat-window). GitHub Leaks and > Exposed API Keys charge per finding. Malware Scan costs 1 credit per scan. > See [Credits](/credits) for the complete billing rules. ### Email Validity `POST /api/lookup/email/validity` verifies whether an address can receive mail and enriches the domain behind it. | Field | Type | Description | Example | | - | - | - | - | | `email` | string | The queried address | `"satya@microsoft.com"` | | `status` | string | Deliverability verdict: `valid`, `invalid`, `catch-all`, `risky` | `"valid"` | | `reason` | string | Why that verdict was reached | `"deliverable"` | | `disposable` | boolean | True for throwaway / temporary providers | `false` | | `confidence` | string | Confidence in the verdict | `"high"` | | `role` | boolean | True if a role address (info@, support@) | `false` | | `role_name` | string | The matched role, or `""` when empty. Always present | `"support"` | | `did_you_mean` | string | Suggested correction, or `""` when empty. Always present, but currently not populated | `""` | | `free_provider` | boolean | True for free consumer mailboxes (Gmail, Outlook) | `false` | | `domain` | string | Domain portion of the address | `"microsoft.com"` | | `provider` | string | Mailbox provider | `"microsoft"` | | `mx` | array \| null | MX hostnames serving the domain, or `null` when no mail route exists | `["mx.microsoft.com"]` | | `canonical` | string | Canonicalized address (Gmail dot/plus normalization) | `"satya@microsoft.com"` | | `provider_answered` | boolean | True when the mailbox provider itself answered the probe | `true` | | `domain_trust` | object | Email-authentication posture. `mta_sts` is `enforce`, `testing`, or `none`. Raw records use `spf_record`, `dmarc_record`, `tls_rpt_record`, and `mta_sts_record` | | | `person_signal` | object | OSINT corroboration: `{ count, sources }` | | | `smtp` | object \| null | SMTP details: `mx_host`, `message`, `catch_all`, and `greylisted`. `null` when no mail route exists | | | `domain_info` | object | `registrar`, `created_at`, `expires_at`, `age_days`, `nameservers`, `dnssec`, and `a` | | | `mail_servers` | array \| null | Per-MX infrastructure and TLS detail, or `null` when no mail route exists | | | `footprint` | object | Identity footprint. `breaches` is `{count, exposed_data, services[{name, date, data_types}]}` and the object may include `gravatar_url` and `registered_services[{name, category, url}]` | | | `checked_at` | string | Timestamp the verdict was produced | `"2026-09-28T10:12:00Z"` | | `message` | string | Human-readable summary of the verdict | `"Mailbox exists and accepts email"` | | `validity` | string | Deprecated alias of `status`, kept for older clients | `"valid"` | | `credits` | integer | Credits billed (0 on a free repeat) | `1` | | `cached` | boolean | Whether the deliverability verdict was served from cache. Always present | `true` | > [!NOTE] > > `validity` is also returned as a top-level alias of `status` for backward compatibility with older clients. ### Email Gender `POST /api/lookup/email/gender` infers the most likely gender and country behind an address. | Field | Type | Description | Example | | - | - | - | - | | `email` | string | The queried address | `"satya@microsoft.com"` | | `name` | string | Name extracted from the address | `"Satya"` | | `gender` | string | `male`, `female`, or `unknown` | `"male"` | | `country` | string \| null | ISO alpha-2 country code. The live API can return the string `"NULL"` when unknown | `"US"` | | `probability` | integer | Confidence in the prediction, 0-100 | `98` | | `credits` | integer | Credits billed (0 on a free repeat) | `1` | | `cached` | boolean | True if served from cache. Omitted when false | `true` | ### Email Breaches `POST /api/lookup/email/breaches` returns the breach exposure (HIBP) for an address. | Field | Type | Description | | - | - | - | | `email` | string | The queried address | | `breached` | boolean | True if the email appears in 1 or more breaches | | `breach_info` | object | Full breach detail (same shape as the `breach_info` field above) | | `credits` | integer | Credits billed (0 on a free repeat) | `breach_info` object: | Sub-field | Type | Description | | - | - | - | | `breach_count` | integer | Number of breaches the email appears in | | `services` | array | Breached services (`name`, plus `domain`, `breach_date`, `data_types` when known) | | `exposed_data` | array | Unique data types leaked across all breaches. Omitted when empty | | `interests` | array | Interest categories inferred from breach sources | ### Email Compliance `POST /api/lookup/email/compliance` tells you whether it is legally safe to email an address and which laws apply. | Field | Type | Description | Example | | - | - | - | - | | `email` | string | The queried address | `"satya@microsoft.com"` | | `country` | string | Inferred country of the recipient | `"United States"` | | `country_code` | string | ISO alpha-2 country code | `"US"` | | `email_type` | string | `consumer` or `business` | `"business"` | | `recommendation_code` | string | Machine-readable verdict code | `"allowed_with_conditions"` | | `recommendation` | string | Human-readable send guidance | `"Permitted with a working opt-out"` | | `main_laws` | array | Governing laws that apply | `["CAN-SPAM"]` | | `law_reference_urls` | array | Links to the referenced laws | | | `main_restrictions` | array | Key restrictions you must honor | `["Include an opt-out link"]` | | `applicability` | string | How the guidance applies | | | `confidence` | string | Confidence in the country inference: `confident`, `medium`, or `unknown` | `"confident"` | | `jurisdictions_applicable` | array | All jurisdictions that may apply | `["US", "EU"]` | | `possible_travel` | array | Other jurisdictions the recipient may fall under | | | `signals` | object | Consolidated check summary: `points`, `max_points`, `checks`, `latency_ms` | | | `checking` | boolean | True while a background check is still running | `false` | | `result_id` | integer | Row id; the background check finalises this result | | | `credits` | integer | Credits billed (0 on a free repeat) | `1` | > [!NOTE] > > `checking` and `result_id` are omitted when they are `false` / `0`, so a settled verdict has neither key. While `checking` is `true` the verdict is provisional. Repeat the request to get the settled one. The repeat is free during the [6-month free-repeat window](/credits#free-repeat-window). There is no webhook event for this. ### Password Breaches `POST /api/lookup/email/password/breaches` checks whether a password appears in known breaches using HIBP k-anonymity. The plaintext password is never sent; only the first 5 characters of its SHA-1 hash leave the server. | Field | Type | Description | Example | | - | - | - | - | | `prefix` | string | The 5-char SHA-1 hash prefix used for the k-anonymity query | `"5BAA6"` | | `found` | boolean | True if the password appears in any known breach | `true` | | `count` | integer | How many times the password has been seen across breaches | `52372427` | | `message` | string | Human-readable summary of the verdict | `"This password has appeared in known breaches."` | | `credits` | integer | Credits billed (0 on a free repeat) | `1` | ### GitHub Leaks `POST /api/lookup/breaches/github` scans a public GitHub repository for leaked secrets. Returns the `{ success, result, message }` envelope, with the fields below inside `result`. | Field | Type | Description | | - | - | - | | `scan_id` | string | The scan's id; poll the result with `GET /api/lookup/breaches/github/{id}` | | `repository_id` | string | Encrata's stable id for the scanned repository | | `target` | string | The normalized repository URL that was scanned | | `kind` | string | The scan family (e.g. `github`) | | `type` | integer | The detection profile that ran (`0`, `1`, or `2`) | | `depth` | integer | The history depth that was applied | | `config` | object | The effective configuration, after defaults | | `commit_sha` | string | The repository state these findings describe | | `status` | string | `processing`, `succeeded`, or `failed` | | `findings` | array | Detected secrets. Each finding never contains the raw credential | | `summary` | object | Roll-up: `total`, `by_severity`, `by_engine`, `engines_run`, `rules_requested`, `head_sha`, `deep_scan`, `duration_ms`, `suppressed`, `truncated` | | `reused` | boolean | An existing scan of this repository state answered the request | | `charged` | boolean | Whether the request debited the account | | `credits` | integer | Credits debited: 1 per leak found, `0` on a clean or reused scan | Each item in `findings`: | Sub-field | Type | Description | | - | - | - | | `fingerprint` | string | Stable identifier for the finding, used to deduplicate and build a baseline | | `rule_id` | string | The detection rule that matched (e.g. `aws-access-key-id`) | | `severity` | string | `critical`, `high`, `medium`, `low`, or `unknown` | | `severity_source` | string | Where the severity came from | | `engines` | array | The detection engines that produced this finding | | `file` | string | Path to the file containing the secret | | `start_line` | integer | 1-based line where the match starts | | `end_line` | integer | 1-based line where the match ends | | `column` | integer | 1-based column of the match | | `entropy` | number | Shannon entropy of the matched string | | `tags` | array | Rule tags, for triage routing | | `preview` | string | Masked preview of the match (e.g. `AKIA****************`) | | `commit` | string | The commit SHA. A **string**, with sibling `author`, `email`, and `date` strings | | `likely_false_positive` | boolean | Whether the finding is flagged as a likely false positive | > [!NOTE] > > A GitHub Leaks scan with **zero findings is a success**, not an error, and is free. Scans are **always asynchronous**: a new scan returns `202` with `status: "processing"`, and you poll `GET /api/lookup/breaches/github/{id}` for the findings. ### Exposed API Keys `POST /api/lookup/breaches/exposed-keys` scans supplied text for exposed credentials. The response uses the `{success, result, message}` envelope. | Field | Type | Description | | - | - | - | | `scan_id` | string | Stored scan ID | | `repository_id` | string | Internal target ID used to store and authorize the result | | `kind` | string | Always `keys` | | `target` | string | SHA-256 identifier for the supplied content | | `type` | integer | Detection profile: `0`, `1`, or `2` | | `commit_sha` | string | SHA-256 digest of the supplied content | | `depth` | integer | Always `0` because text has no repository history | | `config` | object | Effective rules, severity, baseline, limit, and validation settings | | `summary` | object | Counts by severity and engine, timing, suppression, validation, live credentials, and truncation | | `findings` | array | Masked credential findings with locations, fingerprints, severity, and optional validation | | `reused` | boolean | Whether a stored scan answered the request | | `charged` | boolean | Whether the request deducted credits | | `credits` | integer | One per finding, or `0` for a clean or already-paid result | Each finding can include `fingerprint`, `rule_id`, `description`, `severity`, `severity_source`, `engines`, `file`, `start_line`, `end_line`, `column`, `preview`, `entropy`, commit context, and `likely_false_positive`. When validation runs, `validation` contains `status`, `confidence`, and `checked_at`. See [Exposed API Keys](/api-reference/endpoint/exposed-api-keys) for the complete request and response reference. ### Malware Scan `POST /api/lookup/malware/scan` accepts five `kind` values through one request shape: `url`, `qr`, `bar`, `image`, and `file`. | Field | Type | Description | | - | - | - | | `scan_id` | string | Unique scan ID | | `kind` | string | Scanner selected by the request | | `status` | string | Completed scans return `done` | | `verdict` | string | `clean`, `suspicious`, `malicious`, or `unknown` | | `score` | integer | Risk score from 0 to 100 | | `sha256` | string | Hash of uploaded content | | `category` | string | Threat category | | `confidence` | string | `high`, `medium`, or `low` | | `attack` | array | MITRE ATT\&CK mappings | | `signals` | array | Evidence used to produce the verdict | | `iocs` | array | Indicators of compromise found during the scan | | `data_residency` | string | `global` or `eu` | | `scanned_at` | string | ISO 8601 scan timestamp | | `stix` | object | STIX 2.1 bundle when requested | URL scans add redirect, domain, TLS, hosting, page, and threat-intelligence fields. QR and barcode scans add decoded `codes` and image details. Image scans add hashes, metadata, hidden-data analysis, OCR, and discovered URL results. File scans add `file_type` and malware-rule signals. See [Malware Scan](/api-reference/endpoint/malware-scan) for all five request examples and kind-specific response fields. *** ## Response structure The full API response wraps fields inside the `person` object: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "satya@microsoft.com", "person": { "first_name": "Satya", "last_name": "Nadella", "validity": "valid", "company": "Microsoft", "job_role": "Chairman and CEO of Microsoft", "socials": { "linkedin": "https://linkedin.com/in/satyanadella", "twitter": "https://twitter.com/satyanadella" }, "company_info": { "name": "Microsoft Corporation", "rating": 4.1, "category": "Technology company" }, "breach_info": { "breach_count": 2, "services": [{"name": "LinkedIn", "domain": "linkedin.com", "breach_date": "2012-05-05"}], "exposed_data": ["Email addresses", "Passwords"] }, "registered_services": { "total_checked": 219, "registered_count": 8, "services": [{"name": "GitHub"}, {"name": "Spotify"}] } }, "files": { "json": "/api/files/satya_at_microsoft_com.json", "csv": "/api/files/satya_at_microsoft_com.csv" } } ``` > [!NOTE] > > Most `person` fields are serialized even when empty: expect `""` for unresolved strings and `null` for unresolved lists. Check for a truthy value rather than for the key's presence. # API Overview Source: https://docs.encrata.com/api-reference/overview Base URL, rate limiting, and response format. ## Base URL ``` https://developer.encrata.com ``` ## Authentication `https://developer.encrata.com` is **API-key only**. A dashboard session is not a credential here. Every endpoint below authenticates with your `enc_` API key: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` Only `GET /api/health` is public. ## Endpoints ### Lookups | Method | Path | Description | | - | - | - | | `POST` | `/api/lookup/email/validity` | Email validity (deliverability) | | `POST` | `/api/lookup/email/identity` | Person behind an email | | `POST` | `/api/lookup/email/breaches` | Email breach check | | `POST` | `/api/lookup/email/breaches/check` | Breached yes/no | | `POST` | `/api/lookup/email/gender` | Gender & country from an email | | `POST` | `/api/lookup/email/compliance` | Cold-email jurisdiction & rule | | `POST` | `/api/lookup/email/password/breaches` | Password breach check | | `POST` | `/api/lookup/breaches/github` | Scan a GitHub repo for leaked secrets | | `GET` | `/api/lookup/breaches/github/{id}` | Read a stored GitHub scan | | `POST` | `/api/lookup/breaches/exposed-keys` | Scan collected text for exposed credentials | | `GET` | `/api/lookup/breaches/exposed-keys/{id}` | Read a stored exposed-key scan | | `POST` | `/api/lookup/malware/scan` | Scan a URL, QR code, barcode, image, or file | ### Bulk jobs | Method | Path | Description | | - | - | - | | `POST` | `/api/jobs/bulk` | Run any lookup on a list (`type` = `validity`, `identity`, `email-breaches`, `gender`, `password-breaches`) | | `GET` | `/api/jobs/exports/download` | Download a finished job's result file | The result is delivered by webhook - see [Bulk Operations](/guides/bulk-operations). ### API keys & credits | Method | Path | Description | | - | - | - | | `GET` | `/api/account/keys` | List API keys | | `POST` | `/api/account/keys` | Create API key | | `PUT` | `/api/account/keys` | Rename API key | | `PATCH` | `/api/account/keys` | Enable or disable API key | | `DELETE` | `/api/account/keys` | Revoke or delete API key | | `GET` | `/api/account/keys/reveal` | Re-read a revealable key's full value | | `POST` | `/api/account/keys/limit` | Set API key credit limit | | `GET` | `/api/account/credits` | Remaining credit balance | ### Workspaces | Method | Path | Description | | - | - | - | | `GET`, `POST`, `PUT`, `DELETE` | `/api/workspaces` | Manage workspaces | | `PUT` | `/api/workspaces/switch` | Switch the active workspace | | `GET`, `POST`, `PUT`, `DELETE` | `/api/workspaces/members` | Manage members | See the [Workspaces guide](/guides/workspaces). ### Webhooks | Method | Path | Description | | - | - | - | | `GET` | `/api/webhooks` | List webhooks | | `GET` | `/api/webhooks/{id}` | Get one webhook, with its signing secret | | `POST` | `/api/webhooks` | Create webhook | | `PUT` | `/api/webhooks` | Update webhook | | `DELETE` | `/api/webhooks/{id}` | Delete webhook | | `POST` | `/api/webhooks/test` | Send a test event | | `GET` | `/api/webhooks/deliveries` | List webhook deliveries | ### System | Method | Path | Auth | Description | | - | - | - | - | | `GET` | `/api/health` | None | Health check | ## Rate limits Lookup requests are limited **per account** at a default of 200 per minute. Lookup responses carry `X-Ratelimit-Limit`, `X-Ratelimit-Remaining`, and `X-Ratelimit-Reset`. The reset value is the number of seconds until the window resets. Account and health routes do not return these headers. A `429 Too Many Requests` response doesn't include `Retry-After`. Wait `X-Ratelimit-Reset` seconds instead. See [Rate limits](/rate-limits) for the current limit, the response headers, and retry guidance. ## Response format All endpoints return JSON, but the **error shape is not uniform**. Match on the HTTP status code first, then read whichever of these is present. > [tab] Email lookups > > `/api/lookup/email/validity`, `/identity`, `/gender`, `/breaches`, and > `/password/breaches` return a flat body with a machine-readable `code`: > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "code": "bad_request", "error": "Invalid email address" } > ``` > [tab] Enveloped routes > > `/api/lookup/email/compliance`, `/api/lookup/breaches/github`, > `/api/lookup/breaches/exposed-keys`, `/api/lookup/malware/scan`, and the > webhook routes return an envelope on **every** response, including > validation errors: > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { > "success": false, > "result": { "code": "bad_request" }, > "message": "That doesn't look like a valid email address. Please check it and try again." > } > ``` > > On success, the payload is in `result`. > [tab] Account routes > > `/api/account/*` returns the shared envelope plus a legacy `error` key: > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { > "success": false, > "result": { "code": "not_found" }, > "message": "API key not found", > "request_id": "req_7f3a9c21", > "error": "API key not found" > } > ``` > [tab] Bulk jobs > > Bulk job validation errors return a bare error object: > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { > "error": "type must be one of: validity, identity, email-breaches, gender, password-breaches" > } > ``` > [tab] Unknown route > > Routes that are not exposed on the developer host return: > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { > "success": false, > "result": { "code": "not_found" }, > "message": "That endpoint is not available on the developer API. See the docs for the endpoints this host exposes.", > "request_id": "..." > } > ``` A `429` is the one exception and always returns: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "Rate limit exceeded. Please try again later." } ``` ## Credits Most lookups cost **1 credit**. Email Identity and the full email lookup cost **1,000 credits** each. GitHub leak scans are billed **per finding**, so a clean scan is free. Repeat lookups of the same input are free during the [6-month free-repeat window](/credits#free-repeat-window). See [Credits](/credits) for the full breakdown. # The auth.md File Source: https://docs.encrata.com/auth-md/file Anatomy of Encrata's auth.md. Where it lives, what it contains, and how agents parse it. auth.md is a single Markdown file that Encrata publishes to tell agents how to authenticate. This page covers where to find it, the sections it contains, and how agents are expected to parse it. ## Where to find it The file is served from the API host: ``` https://developer.encrata.com/auth.md ``` Agents discover it by: * Reading documentation or SDK pointers * Fetching the canonical URL directly * Following links from AI tool configurations (Cursor, Claude Code, Windsurf) The file carries a `Last updated` date and its canonical URL at the top, so an agent can tell whether a cached copy is stale. ## Sections in order The file is a numbered walkthrough an agent follows top to bottom. ### Title and summary table A one-line title (`# auth.md`), a short preamble addressed to the agent, and a table of the facts an agent needs before anything else: | | | | - | - | | API base URL | `https://developer.encrata.com` | | Auth header | `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` | | Key format | `enc_` followed by 32 hex characters | | Docs index | `https://docs.encrata.com/llms.txt` | | Endpoint list | `https://docs.encrata.com/api-reference/overview` | The file doesn't list every endpoint. It points agents to the docs index and the endpoint list instead. ### 1. Get a key Tells the agent to ask the user for their API key. The user signs in at `https://app.encrata.com`, opens **API Keys**, clicks **Create API key**, and pastes the key (it starts with `enc_`). The agent must never ask for the user's password or sign in on the user's behalf. Encrata has no password-login endpoint for agents. The agent stores the key in an environment variable such as `ENCRATA_API_KEY`, and never writes it to logs, chat transcripts, URLs, or version control. ### 2. Use the key Shows the key sent as a Bearer token on every request: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} POST https://developer.encrata.com/api/lookup/email/validity Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json { "email": "satya@microsoft.com" } ``` The key never goes in a query string. ### 3. Verify the key Before running a batch, the agent confirms the key works with a free call: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} GET https://developer.encrata.com/api/account/credits Authorization: Bearer enc_... ``` ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "credits_remaining": 4850, "credits_used": 150, "stats_degraded": false, "total_lookups": 120 } ``` A `200` means the key is valid. `credits_remaining` is the account balance. ### 4. Key facts | Property | Value | | - | - | | Scope | One workspace. All keys in the account share its credits and rate limit. | | Expiry | None. A key works until it is disabled or revoked. | | Credit cap | Optional per key. Once reached, requests return `402`. | | Read again | `GET /api/account/keys/reveal?id={id}` while the key's `revealable` is `true`. Requires a non-readonly role. | | Revoke | Dashboard, or `DELETE /api/account/keys?id={id}`. Add `&permanent=true` to delete a leaked key for good. | ### 5. Errors Errors are JSON. On authentication and rate-limit failures the body looks like this: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": false, "result": { "code": "unauthorized" }, "message": "Please sign in to continue.", "request_id": "050916e6-f499-4113-934d-d92d07aa1150" } ``` Agents branch on the HTTP status, then on `result.code`, and never on `message`. They include `request_id` when reporting a problem. See [Errors](/errors) for the full list. | Status | `result.code` | Meaning | What to do | | - | - | - | - | | `401` | `unauthorized` | Key missing, invalid, disabled, or revoked | Stop. Ask the user for a new key. Do not retry. | | `402` | `insufficient_credits` | Account is out of credits, or the key hit its credit cap | Stop. Tell the user to add credits or raise the key's cap. Do not retry. | | `403` | `forbidden` | Key is valid but the user's workspace role can't do this | Stop. Tell the user which action needs a higher role. | | `429` | `rate_limited` | Rate limit reached | Wait for `X-Ratelimit-Reset` seconds, then retry. Max 3 attempts. | | `5xx` | `internal` / `upstream_unavailable` | Server or upstream provider error | Retry with exponential backoff (1s, 2s, 4s). Max 3 attempts. | ### 6. Rate limits * **200 requests per minute per account**, shared by every key. * Every API response includes: * `X-Ratelimit-Limit`: the limit (200) * `X-Ratelimit-Remaining`: requests left in the current window * `X-Ratelimit-Reset`: **seconds** until the window resets (not a timestamp) * `429` responses don't include a `Retry-After` header. Use `X-Ratelimit-Reset`. ### 7. Rules for agents 1. Use only `https://developer.encrata.com`. `encrata.com` and `app.encrata.com` are the website and dashboard, not the API. 2. Never request, store, or send the user's password. 3. Keep the key out of URLs, logs, and anything echoed back to the user. 4. Verify the key with `/api/account/credits` before spending credits. 5. Stop on `401`, `402`, and `403`. Back off on `429` and `5xx`. ## How agents parse it Agents treat `auth.md` as both prose and structured data: * **Read the summary table first** to learn the host, header, and key format * **Follow the numbered steps in order**: get a key, use it, verify it * **Extract code blocks** as templates for HTTP requests. Fenced blocks with language hints (`http`, `json`) let agents identify request shapes without ambiguity * **Branch on status and `result.code`** using the errors table * **Follow the docs index** to find endpoints beyond the examples Keep the file short and high in signal. Anything an agent doesn't need to authenticate belongs in the main documentation, not in `auth.md`. # API Key Flow Source: https://docs.encrata.com/auth-md/flows/api-key How a user gives an AI agent access to Encrata with an API key. The API key flow gives an agent long-lived access without sharing the user's Encrata password. ## When to use it * Your agent needs long-lived access to Encrata's lookup APIs. * You want each agent or service to use a separately named key. * You need to disable or delete one agent's access without affecting other integrations. ## How it works ```mermaid theme={"theme":{"light":"github-light","dark":"vesper"}} sequenceDiagram participant User participant Agent participant Encrata User->>Encrata: Create API key in dashboard Encrata-->>User: enc_ + 32 hexadecimal characters User->>Agent: Provide API key securely Agent->>Encrata: POST /api/lookup/email/identity (Bearer API key) Encrata-->>Agent: 200 OK (enrichment data) ``` 1. The user creates an API key in the dashboard. 2. The user provides the key to the agent through a secure configuration channel. 3. The agent sends the key as a Bearer credential on each request. Never ask a user for their Encrata password. ## Step 1: Create a key Sign in to the [Encrata dashboard](https://app.encrata.com), open **API Keys**, and click **Create API key**. Copy the key and give it to the agent. If you already have a valid API key, you can create another one programmatically: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} POST https://developer.encrata.com/api/account/keys Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json { "name": "my-agent-key" } ``` The returned key uses the format `enc_` followed by 32 hexadecimal characters. ## Step 2: Configure the agent Store the key in an environment variable such as `ENCRATA_API_KEY`, or in a secret manager. Never write it to logs, chat transcripts, URLs, or version control. ## Step 3: Verify the key Before running a batch, confirm the key works. This call is free. ```http theme={"theme":{"light":"github-light","dark":"vesper"}} GET https://developer.encrata.com/api/account/credits Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "credits_remaining": 4850, "credits_used": 150, "stats_degraded": false, "total_lookups": 120 } ``` A `200` means the key is valid. `credits_remaining` is the account balance. ## Step 4: Make API calls Send the key as a Bearer token on every request. Never put it in a query string. ```http theme={"theme":{"light":"github-light","dark":"vesper"}} POST https://developer.encrata.com/api/lookup/email/validity Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json { "email": "satya@microsoft.com" } ``` ## Key facts | Property | Value | | - | - | | Scope | One workspace. All keys in the account share its credits and rate limit. | | Expiry | None. A key works until it is disabled or revoked. | | Credit cap | Optional per key. Once reached, requests return `402`. | | Read again | `GET /api/account/keys/reveal?id={id}` while the key's `revealable` is `true`. Requires a non-readonly role. | | Revoke | Dashboard, or `DELETE /api/account/keys?id={id}`. Add `&permanent=true` to delete a leaked key for good. | ## Credential lifecycle | Event | What happens | | - | - | | Key created | The key is active immediately | | Credits exhausted or cap reached | Requests that require credits return `402` | | Role too low for an action | The request returns `403` | | Key disabled or revoked | Requests with the key return `401` | | Key permanently deleted | The key record is removed | ## Security considerations * Store keys in an environment variable or secret manager. * Create a separately named key for each agent. * Set a credit limit to cap the key's spend. * Permanently delete a compromised key with `DELETE /api/account/keys?id={id}&permanent=true`. # For AI Agents Source: https://docs.encrata.com/auth-md/for-agents How AI agents discover and use Encrata with a user-provided API key. This guide is for AI agents that need to call Encrata's API. If you configure an agent, see [For Developers](/auth-md/for-developers). ## Discovery Fetch the auth file from Encrata's API host: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} GET https://developer.encrata.com/auth.md ``` The file describes the API host, authentication header, key format, errors, and rate limits. For endpoints, use the docs index at `https://docs.encrata.com/llms.txt`. ## Minimum steps to operate ### 1. Ask the user for an API key Tell the user: > Sign in at [https://app.encrata.com](https://app.encrata.com), open **API Keys**, click **Create API key**, copy the key (it starts with `enc_`) and paste it here. A key uses `enc_` followed by 32 hexadecimal characters. Never ask for the user's password or sign in on their behalf. Encrata has no password-login endpoint for agents. ### 2. Store the key securely Store the key in an environment variable such as `ENCRATA_API_KEY`. Never write it to logs, chat transcripts, URLs, or version control. ### 3. Verify the key Before spending credits, confirm the key works. This call is free. ```http theme={"theme":{"light":"github-light","dark":"vesper"}} GET https://developer.encrata.com/api/account/credits Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` A `200` means the key is valid. `credits_remaining` is the account balance. ### 4. Make API calls Send the key as a Bearer token on every request. Never put it in a query string. ```http theme={"theme":{"light":"github-light","dark":"vesper"}} POST https://developer.encrata.com/api/lookup/email/validity Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json { "email": "satya@microsoft.com" } ``` ## Available endpoints | Endpoint | Method | Body | Description | | - | - | - | - | | `/api/lookup/email/identity` | POST | `{ "email": "..." }` | Full email enrichment | | `/api/account/credits` | GET | none | Check remaining credits | ## Credits * All keys in an account share its credits and rate limit. * A key can have an optional credit cap. Once reached, requests return `402`. * Do not retry a `402` response. Ask the user to add credits or raise the key's cap. ## Error handling Branch on the HTTP status, then on `result.code`. Never branch on `message`. Include `request_id` when reporting a problem. | Status | `result.code` | Agent action | | - | - | - | | `401` | `unauthorized` | Stop. Ask the user for a new key. Do not retry. | | `402` | `insufficient_credits` | Stop. Tell the user to add credits or raise the key's cap. | | `403` | `forbidden` | Stop. Tell the user which action needs a higher role. | | `429` | `rate_limited` | Wait `X-Ratelimit-Reset` seconds, then retry. Max 3 attempts. | | `5xx` | `internal` / `upstream_unavailable` | Retry with exponential backoff (1s, 2s, 4s). Max 3 attempts. | `429` responses don't include `Retry-After`. Use `X-Ratelimit-Reset`, which is a number of seconds, not a timestamp. ## Rules 1. Use only `https://developer.encrata.com`. `encrata.com` and `app.encrata.com` are the website and dashboard, not the API. 2. Never request, store, or send the user's password. 3. Keep the key out of URLs, logs, and anything you echo back to the user. 4. Verify the key with `/api/account/credits` before spending credits. 5. Stop on `401`, `402`, and `403`. Back off on `429` and `5xx`. ## Removed access If a previously working key returns `401`, do not retry and do not try to create a replacement. Ask the user to provide a new key. # For Developers Source: https://docs.encrata.com/auth-md/for-developers How to configure your AI agent to use Encrata's auth.md for autonomous authentication. This guide shows you how to point your AI agent at Encrata's `auth.md` and configure it for autonomous operation. Whether you're building a custom agent, using an orchestration framework, or configuring an AI coding tool, the setup is the same. ## Quick start 1. Create an API key in the [dashboard](https://app.encrata.com), or create another with [`POST /api/account/keys`](/api-reference/endpoint/create-key) using an existing key 2. Point your agent at `https://developer.encrata.com/auth.md` 3. Provide the API key to your agent's configuration, for example as `ENCRATA_API_KEY` The agent reads the file, verifies the key with the free `GET /api/account/credits` call, and follows the [docs index](https://docs.encrata.com/llms.txt) to find endpoints. ## Provide the API key directly If you already have an API key, just configure your agent with it: ```python theme={"theme":{"light":"github-light","dark":"vesper"}} # Python agent example import requests API_KEY = "enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" headers = {"Authorization": f"Bearer {API_KEY}"} response = requests.post( "https://developer.encrata.com/api/lookup/email/identity", headers=headers, json={"email": "target@example.com"} ) ``` ## Give the agent the API contract Point your agent at `auth.md` and provide the API key through its secret or environment configuration. Never give the agent your Encrata password. ### System prompt example ``` You have access to Encrata's data lookup API. Read https://developer.encrata.com/auth.md for authentication instructions. Read the API key from ENCRATA_API_KEY. Verify the key with GET /api/account/credits before running a batch. Available endpoints: - POST /api/lookup/email/identity - email enrichment ``` ## Framework integration ### LangChain ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from langchain_community.tools import EncrataTool tool = EncrataTool(api_key="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") ``` ### CrewAI ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from crewai_tools import EncrataTool encrata = EncrataTool(api_key="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") agent = Agent(tools=[encrata]) ``` ### Custom agent ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests class EncrataClient: def __init__(self, api_key: str): self.base = "https://developer.encrata.com/api/lookup/email" self.headers = {"Authorization": f"Bearer {api_key}"} def lookup(self, email: str) -> dict: r = requests.post(f"{self.base}/identity", headers=self.headers, json={"email": email}) r.raise_for_status() return r.json() ``` ## Key management best practices > [accordion] Create named keys per agent > > Give each agent its own named key so you can revoke individually without disrupting other agents: > > ``` > my-research-agent > crewai-pipeline > monitoring-bot > ``` > [accordion] Rotate keys periodically > > Encrata keys don't expire. A key works until you disable or revoke it, so rotating periodically limits blast radius if one is compromised. > [accordion] Set a credit cap per key > > All keys share the account's credits. Set an optional credit cap on each key so one agent can't drain the balance. Once a key reaches its cap, its requests return `402`. > [accordion] Never commit keys to source control > > Use environment variables or secret managers: > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > export ENCRATA_API_KEY="enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > [accordion] Monitor credit usage > > Set up alerts when credits drop below a threshold. Your agent should check `GET /api/account/credits` before batch operations. ## Rate limits Requests are limited to 200 per minute per account, shared by every key. Every response includes `X-Ratelimit-Limit`, `X-Ratelimit-Remaining`, and `X-Ratelimit-Reset`. On a `429`, wait `X-Ratelimit-Reset` seconds, then retry, up to 3 attempts. `429` responses don't include a `Retry-After` header. See [Rate limits](/rate-limits) for the current limit, headers, and retry guidance. ## Monitoring agent activity All API calls made with your key are logged in your [dashboard](https://developer.encrata.com/history). You can: * See which endpoints your agent called * Track credit consumption over time * Identify unusual patterns * Revoke a key instantly if needed # Overview Source: https://docs.encrata.com/auth-md/overview A standardized path for AI agents to discover and authenticate with Encrata. auth.md provides a standardized path for agents to discover Encrata's API-key authentication and available endpoints. At its core, auth.md is a small Markdown file hosted at `https://developer.encrata.com/auth.md`. The file describes how agents get and use an API key, how to verify it, and how to handle errors and rate limits. Because Markdown is plain text, the same file works as documentation for human integrators and as a discoverable runtime artifact for agents. ## How it works An agent authenticates with Encrata via the API Key Flow: > [card] [API Key Flow](/auth-md/flows/api-key) > > A user creates an API key and provides it to the agent for authenticated requests. ## The contract The `auth.md` file at `developer.encrata.com/auth.md` tells agents everything they need to authenticate: 1. **How to get an API key** - ask the user to create one in the dashboard and paste it 2. **How to authenticate** - send the key as a Bearer token on every request 3. **How to verify the key** - call the free `GET /api/account/credits` endpoint 4. **Key facts** - scope, expiry, credit caps, and revocation 5. **Error handling** - status codes, `result.code` values, rate limits, and retry behavior For endpoints, the file points agents to the [docs index](https://docs.encrata.com/llms.txt) and the [API reference](/api-reference/overview). ## Why auth.md? An agent needs a small, reliable contract that identifies the supported host, credential format, and routes. auth.md solves this by making authentication **machine-discoverable**: * **User-approved access** - the user creates the credential and gives it to the agent * **Self-describing** - the file contains everything needed to authenticate, and links to the endpoint docs * **Standard format** - plain Markdown that any agent can parse * **Stable location** - hosted at one well-known URL that agents can fetch ## Integration guides > [card] [The auth.md File](/auth-md/file) > > The anatomy of Encrata's auth.md, where it lives, and how agents parse it. > [card] [For AI Agents](/auth-md/for-agents) > > How agents discover and use Encrata's auth.md to authenticate and operate. > [card] [For Developers](/auth-md/for-developers) > > How to point your agent at Encrata's auth.md and configure access. > [card] [API Key Flow](/auth-md/flows/api-key) > > The supported flow for giving an agent API access. # API keys & authentication Source: https://docs.encrata.com/authentication Create and use an Encrata API key to authenticate API requests. ## Encrata API keys API keys are secret credentials used to authenticate your requests. They are unique to your account and must be kept confidential. Every key starts with `enc_`. You need at least one key to call the Encrata API from code, the CLI, or an AI tool. ## Create an API key Choose the method that fits your workflow. > [tab] Dashboard > > **1. Sign in to the Encrata dashboard** > > Open the [Encrata dashboard](https://app.encrata.com/signup). > > **2. Open the API Keys page** > > **3. Click Create API key** > > **4. Name your key** > > Choose a name that identifies where the key is used, for example > `Production`. > > **5. Copy and store the key** > > Copy the `enc_` key and store it in a secret manager before closing the > dialog. > [tab] Encrata API > > Use [`POST /api/account/keys`](/api-reference/endpoint/create-key) to create > another key programmatically. The key you use to authenticate must belong > to a workspace member with permission to manage keys. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X POST "https://developer.encrata.com/api/account/keys" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{"name": "Production"}' > ``` > > The response includes the new key in the `key` field. Store it in a secret > manager as soon as you receive it. > [tab] CLI > > [Install the Encrata CLI](/cli#get-started), sign in with an existing key, > then create a named key: > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > encrata login enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > encrata keys create Production > ``` > > Copy the new `enc_` key from the command output and store it in a secret > manager. > [!NOTE] > > Revealable keys can be read again with > [`GET /api/account/keys/reveal`](/api-reference/endpoint/reveal-key). Access is > limited by workspace permissions. ## Use the API key in your code Authenticate every request by sending your key as a Bearer credential in the `Authorization` header. **1. Store the key as an environment variable** Keep the key out of your source code. In a Node.js project, store it in a `.env` file at the project root: ```sh .env theme={"theme":{"light":"github-light","dark":"vesper"}} ENCRATA_API_KEY=enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` > [!TIP] > > Add `.env` to your `.gitignore` so the key is never committed. > > ```sh .gitignore theme={"theme":{"light":"github-light","dark":"vesper"}} > .env > ``` **2. Send the key in the Authorization header** Read the key from the environment and pass it on every call: ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/validity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "satya@microsoft.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import os, requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers={"Authorization": f"Bearer {os.environ['ENCRATA_API_KEY']}"}, json={"email": "satya@microsoft.com"}, ) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/validity", { method: "POST", headers: { Authorization: `Bearer ${process.env.ENCRATA_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ email: "satya@microsoft.com" }), }); ``` ## Key behavior | Behavior | Detail | | - | - | | **Format** | `enc_` followed by 32 hexadecimal characters | | **Scope** | Tied to your user account | | **Credit limit** | Optional per-key spend cap - `402` once reached | | **Removal** | Permanently delete a compromised key with `DELETE /api/account/keys?id={id}&permanent=true` | | **Usage tracking** | Every request is logged with credits consumed and response time | ## Set a credit limit Every key can carry a **credit limit**: a cap on how many credits it is allowed to spend. A key with no limit can spend your full account balance, so a leaked or runaway key drains everything. A capped key stops at its ceiling instead, which contains the damage. Set a cap with [`POST /api/account/keys/limit`](/api-reference/endpoint/set-key-limit): ```bash Set a limit theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys/limit" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "credit_limit": 5000}' ``` ```bash Remove the limit theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/keys/limit" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"id": "a1b2c3d4-0000-4000-8000-000000000000", "credit_limit": null}' ``` > [!WARNING] > > When a key reaches its limit, requests are rejected with `402 api key credit > limit exceeded`. Raise the limit or use another key to continue. > [!NOTE] > > Send `credit_limit: null` to remove the cap. Setting a limit requires a > non-`readonly` role in the active workspace. The maximum value is > `2147483647`. ## Manage your keys Inspect, rename, pause, and retire keys from the dashboard or the API. A workspace admin can manage other members' keys in the same workspace. > [card] [List keys](/api-reference/endpoint/list-keys) > > See every key with its usage, limit, and last-used time. > [card] [Rename a key](/api-reference/endpoint/rename-key) > > Update a key's display name. > [card] [Enable or disable](/api-reference/endpoint/toggle-key) > > Temporarily turn a key off without deleting it. > [card] [Revoke or delete](/api-reference/endpoint/revoke-key) > > Permanently delete a leaked key or soft-disable an unused key. > [!WARNING] > > **Known issue:** A revoked key can be enabled again with `PATCH ?action=enable` > and revealed with `GET /api/account/keys/reveal`. Revoked and disabled keys > both appear as `is_active: false`. Permanently delete a leaked key. ## Handle common errors Email API errors use this shape: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "Invalid email address", "code": "bad_request" } ``` | Status | `code` or error | When it happens | What to do | | - | - | - | - | | `400` | `bad_request` | The JSON body is invalid or `email` is not a valid address. | Send valid JSON with an `email` field. | | `401` | `unauthorized` | The Encrata API key is missing, malformed, invalid, or revoked. | Send an active `enc_` key in the `Authorization` header. | | `402` | `insufficient_credits` | Your account does not have enough credits for the lookup. | Add credits, then retry. | | `402` | `api key credit limit exceeded` | The key has reached its configured credit limit. | Raise the key limit or use another permitted key. | | `405` | `method_not_allowed` | The endpoint was called with a method other than `POST`. | Send a `POST` request. | | `413` | `payload_too_large` | The request body is larger than the endpoint accepts. | Send only the required request body. | | `429` | `rate_limited` | You sent requests faster than the endpoint allows. | Wait before retrying; use exponential backoff. | | `502`, `503`, `504` | `upstream_unavailable` | A required upstream provider is temporarily unavailable. | Retry with exponential backoff. | | `500` | `internal` | An unexpected server error occurred. | Retry later; include the response request ID when contacting support. | > [!NOTE] > > Do not retry `400` or `401` responses unchanged. Correct the request or credential first. Retries are appropriate for `429` and `5xx` responses. > [!WARNING] > > Keep your API key secret. Do not commit it to version control or expose it in client-side code. ## Next steps * [Quickstart](/quickstart): Make your first lookup in under two minutes. * [All endpoints](/api-reference/overview): Browse every lookup with request and response schemas. # Changelog Source: https://docs.encrata.com/changelog What's new and improved in Encrata. **October 1, 2026** Webhook API reference rewritten Webhook management is documented at its real paths. The previous `/api/account/webhooks` paths were wrong and returned `404`. * `Fixed` Every webhook endpoint now documents `/api/webhooks*`. Update any hard-coded `/api/account/webhooks` paths. * `New` [Get webhook](/api-reference/endpoint/get-webhook) documents `GET /api/webhooks/{id}`, the only way to read a signing secret after creation. * `Changed` Responses are shown with the real `{success, result, message}` envelope instead of bare objects. * `Changed` [Create webhook](/api-reference/endpoint/create-webhook) documents all four destination kinds (`generic`, `slack`, `discord`, `telegram`) and all eight subscribable events. The list previously showed five. * `Changed` [Update webhook](/api-reference/endpoint/update-webhook) is a partial update: only `id` is required, and omitted fields keep their stored values. * `Fixed` Delivery status values are `pending`, `retrying`, `delivered`, and `failed`. The docs previously showed a `success` status that the API never returns. * `Fixed` The retry policy is 4 attempts at 30 seconds, 2 minutes, and 10 minutes, with a 10 second timeout per attempt. The old "respond within 5 seconds, exponential backoff" guidance was wrong. * `Fixed` Signing secrets are not create-only, and each endpoint now states the workspace role it requires. **September 28, 2026** Reference corrections and a dedicated Changelog The API Reference now documents every response field for the breach lookups, and several routes, credit costs, and key formats are corrected to match the live API. * `New` Dedicated Changelog tab so you can track releases without digging through the guides. * `Docs` The [Response Fields](/api-reference/fields) reference now documents the full response shapes for [Password Breaches](/api-reference/endpoint/password-breaches) and [GitHub Leaks](/api-reference/endpoint/github-leaks), including every finding sub-field. * `Changed` API keys use the `enc_` prefix. Docs and examples that showed `enc_live_` have been corrected. * `Fixed` Credit costs are now consistent across the docs: Email Identity is 1,000 credits per lookup, while Validity, Breaches, Gender, and Compliance are 1 credit each with free repeats during the [6-month free-repeat window](/credits#free-repeat-window). * `Fixed` The LangChain, LlamaIndex, CrewAI, and Haystack integration guides now call the canonical `/api/lookup/email/...` routes instead of the old `/api/email/...` paths. **September 18, 2026** Compliance and GitHub secret scanning Two new lookups join the API, and every email route now documents its canonical path. * `New` Email Compliance: `POST /api/lookup/email/compliance` resolves which country's cold-email law applies to an address and returns that jurisdiction's rule and recommendation, with a confidence rating. 1 credit, with free repeats. See [Email Compliance](/api-reference/endpoint/email-compliance). * `New` GitHub Leaks: `POST /api/lookup/breaches/github` scans a public GitHub repository for leaked secrets, returning each finding with its location, a masked preview, and a severity. Billed one credit per leak found - a clean scan is free. See [GitHub Leaks](/api-reference/endpoint/github-leaks). * `Changed` Email lookup routes are now documented under their canonical `/api/lookup/email/...` paths (for example `/api/lookup/email/validity`), matching the API. Update any hard-coded `/api/email/...` paths. * `Docs` Refreshed the [API overview](/api-reference/overview) with the new lookups, and corrected paths across the Quickstart, Credits, Rate limits, and authentication guides. **September 1, 2026** One endpoint for every bulk lookup, delivered by webhook Run any bulk lookup from a single call and let a webhook hand you the finished file - no polling. * `New` Unified bulk endpoint: `POST /api/jobs/bulk` runs any lookup on a list. Set `type` to `validity`, `identity`, `email-breaches`, `gender`, or `password-breaches`, attach a `file`, and get a job id back immediately. See [Bulk Operations](/guides/bulk-operations). * `New` Webhook result delivery: submit with `download_link=true` and the `bulk.completed` webhook now carries a `download_url`. Fetch it with the same API key to get the finished file - it's built once, cached, and ready the moment the job completes. See [Webhooks](/webhooks). * `New` Email Gender in bulk: gender and country prediction now runs as an async job, like the rest of the email suite. * `Improved` Cursor pagination on job results: page through millions of rows with a `cursor` (alongside the existing `page`/`page_size`), so large result sets stay fast. * `Fixed` Bulk jobs now reliably fire their completion signal and `bulk.completed` webhook the instant the final chunk lands, across every lookup type. * `Docs` Refreshed the [Bulk Operations](/guides/bulk-operations) guide, added a concise bulk section to every lookup in the API Reference, and corrected the routes on the [API overview](/api-reference/overview) page. * `Changed` The canonical credit-balance endpoint is `GET /api/account/credits`. The legacy `GET /api/agent/credits` route has been removed. See [Credits](/api-reference/endpoint/credits). * `Note` These endpoints are rolling out and will be fully available by end of day tomorrow. * `Note` We're continuing to refine the API Reference for accuracy and consistency - thank you for your patience while this work is in progress. If you notice a discrepancy in the meantime, the endpoint's live response is the authoritative schema. **August 31, 2026** API Reference improvements are underway We're refreshing our endpoint documentation to ensure it remains accurate, complete, and aligned with the current API. Updates will roll out incrementally over the coming days. * `Docs` We are updating the [API Reference](/api-reference/introduction) endpoints. This includes revised request and response schemas, updated examples, and clearer descriptions that reflect current behavior. * `Note` We appreciate your patience while this work is in progress. If you notice a discrepancy in the meantime, please refer to the endpoint's response for the authoritative schema. **August 27, 2026** Email Breaches and Identity on the API, plus async breach jobs The full email suite is now reachable with an API key, and breach checks scale to a million. * `New` Email Breaches on the agent API: `POST /api/agent/breaches` checks an email against known data breaches with an API key, returning the same `breach_info` shape (breach count, services, exposed data) as the dashboard. **(Superseded: route removed.)** See [Email Breaches](/api-reference/endpoint/check-breaches). * `New` Email Identity on the agent API: `POST /api/agent/email-identity` resolves the person behind an email with an API key. **(Superseded: route removed.)** See [Email Identity](/api-reference/endpoint/email-identity). * `New` Async breach jobs: `POST /api/agent/breaches-jobs` checks up to 1,000,000 emails in the background, with status polling, paginated results, CSV download, cancel, and retry. **(Superseded: route removed.)** * `Docs` API Reference corrections: accurate request/response schemas for [API Keys](/api-reference/endpoint/list-keys) and [Webhooks](/api-reference/endpoint/webhook), and the async "Bulk" sections now match the real per-batch limits. **July 27, 2026** Email Lookup is in public beta Our full email suite is live over the API, AI agents, and bulk. * `Beta` Encrata is entering public beta with **Email Lookup** as the first generally available product. The full email suite is live: [Email Validity](/api-reference/endpoint/validate-email), [Email Identity](/api-reference/endpoint/email-identity), [Check Breaches](/api-reference/endpoint/check-breaches), and [Password Breaches](/api-reference/endpoint/password-breaches), each with single, agent (API-key), and bulk (up to 1M) access. * `Docs` The API Reference is now organized by lookup. Email Lookup is available today. * `Note` Endpoints under a "Coming soon" badge are still documented for preview but are not yet part of the beta. **July 14, 2026** Smarter email validity Every email now gets a clear status (valid, invalid, catch-all, or risky) with the reasons behind it. * `New` [Email Validity](/api-reference/endpoint/validate-email) now returns a full deliverability report instead of a single string. Every check resolves to one of four statuses `valid`, `invalid`, `catch-all`, or `risky` alongside metadata that explains it: `reason`, provider-calibrated `confidence`, a `role` flag, `did_you_mean` typo suggestions, `domain_trust` (an A-F grade from the SPF/DMARC/MTA-STS/TLS-RPT auth stack), `person_signal` (OSINT corroboration from HIBP, Gravatar, GitHub, GitLab and PGP keyservers), and raw `smtp` probe details. * `New` Catch-all disambiguation: a catch-all domain with a positive person signal is promoted to `valid` (`reason=catchall_corroborated`); a definitive SMTP verdict is never overridden. * `Improved` Explicit mail-route checks surface `null_mx`, `no_dns`, and `no_mail_route` reasons, and the SMTP probe now rotates source IPs, retries greylisting, and confirms catch-all with a double-random probe. * `Improved` The same structured result now powers the app endpoint and the agent endpoint (`POST /api/agent/email-validity`). **(Superseded: route removed.)** `validity` is retained as a legacy mirror of `status`. * `Dashboard` Redesigned Email Validity page: an inline report with the verdict, provider, domain-trust grade, person footprint, and SMTP details, plus a redesigned bulk-upload flow. **July 10, 2026** Use-case map and AI advisor Browse what Encrata can do, and let an assistant match it to your workflow. * `New` Use cases: a browsable commercial map of Encrata use cases (Sales, Marketing, Security, Fraud, E-commerce, Finance, Recruiting, AI, Data Ops and more), filterable by industry and function, each with a dedicated page covering what it means, when to use it, how Encrata powers it, and an example payload. * `New` Use-case advisor: an AI assistant on every use-case page that maps your product, team, risk workflow, data pipeline, or AI agent to the right Encrata lookups right in the browser. * `Improved` Marketing site polish: Across the home and use-case pages and a cleaner pure-white light theme. **June 1, 2026** Bulk operations Run bulk lookups and manage everything in one place. * `New` Async bulk jobs: Upload CSV files for background processing (up to 10,000 rows) with progress tracking and download. * `New` AI chat: Conversational interface for lookups. * `New` Settings integrated into app sidebar: All settings pages accessible from the main navigation without leaving the app. * `Improved` UI consistency: Standardized to 16px (text-base) across all sidebars, dropdowns, and menus. * `Improved` Removed breadcrumb clutter from settings pages. **May 26, 2026** Enriched views and social profiles A visual view for every lookup, plus automatic social-profile detection. * `New` Enriched output mode: All sandbox lookups now support a visual "Enriched" view alongside raw JSON. * `New` Person enrichment: Additional intelligence sources integrated into email lookups. **May 22, 2026** Auto top-up Never run out of credits. * `New` Auto top-up: Automatically recharge credits when balance drops below your configured threshold. **May 17, 2026** CLI and developer docs Run lookups from your terminal, with full docs and API-key auth. * `New` CLI: Look up emails and more directly from your terminal. * `New` Developer docs: Errors, rate limits, pagination, credits, SDKs, and code examples. * `New` API key auth: All endpoints now use `X-API-Key` header (JWT removed). *(Superseded: the API now authenticates with `Authorization: Bearer` - see [authentication](/authentication).)* * `New` Careers page: Public job board with application support. **May 15, 2026** Multi-type contact lists Reusable target lists scoped by type. * `New` Contact lists with types: Create reusable target lists scoped to a type (`POST /api/lists` with `type` field). **(Superseded: route removed.)** * `New` `GET /api/lists?type=X` filter contact lists by type. **(Superseded: route removed.)** **May 2, 2026** Webhooks Real-time event callbacks for your workspace. * `New` Webhooks: Receive real-time HTTP callbacks when events occur in your workspace - lookup completions, API key changes, and credit alerts. * `New` Webhook management API: Full CRUD endpoints to create, list, update, delete, and test webhooks programmatically. * `New` Webhook delivery logs: Track every delivery attempt with status, response codes, and payload history. * `New` HMAC-SHA256 signature verification: Every webhook delivery is signed so you can verify authenticity. * `New` OTP verification for destructive actions: Delete account and leave workspace now require email OTP confirmation. * `Improved` Updated to Inter font across the entire UI for better readability. * `Improved` Lightened dialog backdrop overlay for less intrusive modals. * `Fixed` Dialog footer no longer shows a dark background strip. **May 19, 2025** Agent API and bulk streaming A token-optimized endpoint for AI agents and streaming bulk lookups. * `New` Agent Lookup API: Token-optimized endpoint for AI agents with compact field keys and selective field retrieval. * `New` Bulk Lookup with SSE streaming: Look up up to 1,000 emails in a single request with real-time results. * `New` Breach detection: Lookups now return breach history - compromised services, exposed data types, and breach dates. * `New` Email validation: Every lookup includes deliverability status - valid, invalid, or disposable. * `New` Export to CSV & JSON: Download lookup results directly from the dashboard or via the API. **April 28, 2025** Dashboard, logs, and teams Usage analytics, an activity feed, workspaces, and API key management. * `New` Dashboard & analytics: Lookup volume charts, validity breakdowns, and endpoint usage stats. * `New` Logs & activity feed: Detailed log of every API call, filterable by endpoint, validity, and date range. * `New` Team & workspace management: Invite members, manage roles, and collaborate in a shared workspace. * `New` API key management: Create, revoke, and manage multiple API keys with per-key usage tracking. * `Improved` Lookup response expanded to 30+ structured fields across identity, professional, education, and social categories. **April 7, 2025** Faster, more reliable lookups Single email lookups are 40% faster with more consistent fields. * `Improved` Response time reduced by 40% for single email lookups. * `Improved` More consistent field formatting across all response objects. * `Fixed` Occasional timeout on lookups with uncommon email providers. **March 18, 2025** Encrata is live The core Email Lookup API: pass any email, get structured intelligence about the person behind it. * `Launch` Encrata is live. Core Email Lookup API: pass any email, get structured intelligence about the person behind it. # CLI Source: https://docs.encrata.com/cli Run Encrata lookups directly from your terminal. The Encrata CLI runs every lookup from your terminal - no code required. Install it, save your API key once, and pipe results straight into your shell scripts. ## Get started **1. Install the CLI** > [tab] npm > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > npm install -g encrata-cli > ``` > [tab] Homebrew (macOS / Linux) > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > brew install Encratahq/tap/encrata > ``` > [tab] PowerShell (Windows) > > ```powershell theme={"theme":{"light":"github-light","dark":"vesper"}} > irm https://raw.githubusercontent.com/Encratahq/encrata-cli/main/install.ps1 | iex > ``` > [tab] Manual download > > Download a binary for your platform from [GitHub Releases](https://github.com/Encratahq/encrata-cli/releases). > Windows users can grab a `windows_amd64.zip` or `windows_arm64.zip` asset, > extract it, and run `encrata.exe`. **2. Verify the install** ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} encrata version ``` **3. Authenticate** Save and verify your API key in one step. `login` stores the key and checks it against the API: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} encrata login enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # or run `encrata login` to be prompted encrata whoami # confirm account, plan, credits, and workspace encrata logout # clear the saved key ``` **4. Run your first lookup** ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} encrata email satya@microsoft.com ``` ## Commands Every lookup is available as a subcommand. Pass an email address as the argument (or a repository URL for GitHub Leaks). | Command | Lookup | | - | - | | `encrata email
` | Full email profile | | `encrata email validity
` | Deliverability check | | `encrata email identity
` | Person profile | | `encrata email gender
` | Gender and country | | `encrata email compliance
` | Cold-email jurisdiction | | `encrata email breaches
` | Breach history | | `encrata breaches github ` | Scan a public repo for secrets | ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} encrata email validity jane@acme.com encrata email identity jane@acme.com --json ``` > [!TIP] > > Add `--json` to any command to get raw JSON, ready to pipe into `jq` or a > script. ## Authentication The CLI resolves your API key using this priority chain: | Priority | Source | How to set | | - | - | - | | 1 | `--api-key` flag | `encrata email validity jane@acme.com --api-key enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` | | 2 | `ENCRATA_API_KEY` env var | `export ENCRATA_API_KEY=enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` | | 3 | Config file | `encrata config set-key enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` | > [!NOTE] > > If no key is found, protected commands return an API key error. ## Configuration ### Config commands | Command | Description | | - | - | | `encrata config set-key enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` | Save your API key locally | | `encrata config set-url http://localhost:8080` | Point the CLI at a custom API server | | `encrata config show` | Show the current CLI configuration | | `encrata config unset api-key` | Remove the saved key | | `encrata config unset base-url` | Revert to the default API URL | | `encrata config unset output` | Revert to table output | Configuration is saved to `~/.encrata/config.yaml`, written with `0600` permissions since it stores your API key: ```yaml theme={"theme":{"light":"github-light","dark":"vesper"}} api_key: enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx base_url: https://developer.encrata.com output: table ``` ### Global options | Flag | Description | | - | - | | `--json` | Print raw JSON output | | `--api-key` | Override the saved API key | | `--base-url` | Override the saved API base URL | | `--quiet` | Suppress decorative output (headers, spinner); results still print | | `--no-color` | Disable colored output (also honors the `NO_COLOR` env var) | | `--timeout` | Per-request timeout in seconds (`0` = default 90s) | The `ENCRATA_API_KEY`, `ENCRATA_BASE_URL`, and `NO_COLOR` environment variables are all honored. The spinner auto-disables when output is not a terminal. ## Output Results display as a formatted table by default. Switch to raw JSON with `--json`: ```bash Table (default) theme={"theme":{"light":"github-light","dark":"vesper"}} encrata email satya@microsoft.com ``` ```bash JSON theme={"theme":{"light":"github-light","dark":"vesper"}} encrata email satya@microsoft.com --json ``` ## Next steps * [Lookups](/lookups): See every lookup you can run and when to use each. * [Quickstart](/quickstart): Prefer the API? Make your first lookup over HTTP. * [All endpoints](/api-reference/overview): Full request and response schemas for every lookup. * [Source code](https://github.com/Encratahq/encrata-cli): The CLI is open source on GitHub. # Credits Source: https://docs.encrata.com/credits Understand how credits work, what costs credits, and what's free. Every Encrata account has a credit balance. Lookups use fixed, outcome-based, or free pricing. You are only charged on a successful response. > [!NOTE] > > Credits are deducted **after** a successful response. If a lookup fails with a > `5xx` error, you are not charged. ## How billing works ### Free-repeat window Repeat lookups of the same input are free for 6 months after your first paid lookup. > [card] Pay on success > > Failed lookups (`502`, `503`, `504`) never cost credits. > [card] Free repeats > > Most 1-credit lookups are free again for the same address during the > [6-month free-repeat window](#free-repeat-window). > [card] Outcome-based > > GitHub Leaks and Exposed API Keys charge only when they find credentials. ## What each lookup costs > [tab] Standard (1 credit) > > | Endpoint | What it does | > | - | - | > | `/api/lookup/email/validity` | Email deliverability check | > | `/api/lookup/email/gender` | Predict gender and country | > | `/api/lookup/email/compliance` | Resolve cold-email jurisdiction and rule | > | `/api/lookup/email/breaches` | Breach history for an email | > | `/api/lookup/email/breaches/check` | Breached yes/no for an email | > | `/api/lookup/email/password/breaches` | Check if a password has leaked | > | `/api/lookup/malware/scan` | Scan one URL, QR code, barcode, image, or file | > > > [!TIP] > > > > Repeat lookups of the same input during the [6-month free-repeat window](#free-repeat-window) are free > > (`credits: 0`, served from cache). > [tab] Premium > > | Endpoint | What it does | Cost | > | - | - | - | > | `/api/lookup/email/identity` | Resolve the person behind an email: name, role, company, socials | 1,000 credits | > > > [!NOTE] > > > > Repeat Email Identity lookups of the same address are served from cache as > > free repeats during the [6-month free-repeat window](#free-repeat-window). > [tab] Outcome-based > > | Endpoint | What it does | Cost | > | - | - | - | > | `/api/lookup/breaches/github` | Scan a public repo for leaked secrets | 1 credit per leak found | > | `/api/lookup/breaches/exposed-keys` | Scan collected text for exposed credentials | 1 credit per credential found | > > > [!TIP] > > > > Clean scans are free. Reused GitHub and exposed-key scans do not charge an > > account twice for the same stored result. > [tab] Free > > | Endpoint | What it does | > | - | - | > | `GET/POST /api/webhooks` | Webhook management | > | `GET /api/health` | Health check | ## Bulk runs > [!NOTE] > > Bulk runs charge per successful item, not per request. A run of many addresses > charges only for the ones that resolve successfully. | Operation | Cost | | - | - | | Bulk lookup (up to 1,000,000 emails) | The lookup's normal rate per row. Email Identity costs 1,000 credits per row. | ## Check your balance Check it in the dashboard, or read it programmatically to gate spend in your own code. > [tab] API > > Call [`GET /api/account/credits`](/api-reference/endpoint/credits): > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl "https://developer.encrata.com/api/account/credits" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { > "credits_remaining": 4794, > "credits_used": 206, > "total_lookups": 206, > "stats_degraded": false > } > ``` > [tab] Dashboard > > **1. Open the dashboard.** > > Sign in at [developer.encrata.com](https://developer.encrata.com/billing). > > **2. Go to Billing.** > > Your current credit balance and recent usage are shown on the **Billing** > page. ## When you run out > [!WARNING] > > When your balance is too low for a lookup, the API rejects the request with > `402 Payment Required` and does not run the lookup. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "Insufficient credits" } ``` ## Get notified before you run out Set up webhooks to catch low balances before they block a lookup. > [accordion] credits.low > > Fires when your balance drops below the threshold you configure. > [accordion] credits.exhausted > > Fires when your balance reaches zero. See [Webhooks](/webhooks) to configure these alerts. ## Tips to spend less > [card] Validate before you enrich > > Run the free-repeat validity check first and skip invalid addresses before a > premium lookup. > [card] Batch high-volume work > > Bulk runs share the same per-item cost but are built for volume. > [card] Reuse recent lookups > > Repeat lookups during the [6-month free-repeat window](#free-repeat-window) are free. Cache results on your side > to avoid unnecessary calls. ## Next steps * [Quickstart](/quickstart): Make your first lookup in under two minutes. * [Rate limits](/rate-limits): Understand request limits alongside credit costs. # Errors Source: https://docs.encrata.com/errors HTTP status codes and error response formats returned by the Encrata API. When a request fails, Encrata returns a standard HTTP status code and a JSON body describing what went wrong. This page lists every code and how to recover from the common ones. ## Error format All errors use `application/json`, but the body shape depends on the endpoint family. Branch on the HTTP status first. Then read `code` or `result.code` when that field is present. | Endpoint family | Response shape | | - | - | | Email lookups: validity, identity, gender, breaches, password | `{"code": "bad_request", "error": "Invalid email address"}` | | Compliance, GitHub Leaks, webhooks | `{"success": false, "result": {"code": "bad_request"}, "message": "..."}` | | `/api/account/*` | `{"success": false, "result": {"code": "method_not_allowed"}, "message": "Only GET method is allowed", "error": "Only GET method is allowed", "request_id": "..."}` | | Unknown route | `{"success": false, "result": {"code": "not_found"}, "message": "That endpoint is not available on the developer API. See the docs for the endpoints this host exposes.", "request_id": "..."}` | | Bulk jobs | `{"error": "..."}` | ## Status codes | Code | Name | When | | - | - | - | | `200` | OK | Request succeeded | | `201` | Created | Resource created (lists, webhooks, API keys) | | `202` | Accepted | Bulk job queued | | `204` | No Content | Delete succeeded | | `400` | Bad Request | Invalid or missing request body or parameters | | `401` | Unauthorized | Missing or invalid API key | | `402` | Payment Required | Insufficient credits for the operation | | `403` | Forbidden | Permission denied (wrong workspace role) | | `404` | Not Found | Resource does not exist | | `405` | Method Not Allowed | Wrong HTTP method | | `409` | Conflict | Resource already exists (duplicate) | | `413` | Payload Too Large | Request body exceeds the size limit (bulk) | | `429` | Too Many Requests | Rate limit exceeded | | `500` | Internal Server Error | Unexpected server failure | | `502` | Bad Gateway | Upstream data provider failed | | `503` | Service Unavailable | Required service not configured | | `504` | Gateway Timeout | Upstream provider timed out | ## Handle common errors > [accordion] 401 Unauthorized > > Your API key is missing, invalid, or revoked. > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > {"error": "unauthorized"} > ``` > > **Fix:** Send an active key in the `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` header. If the > key was revoked, [create a new one](/authentication). > [accordion] 402 Payment Required > > Your account does not have enough credits, or an API key has reached its credit > limit. > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > {"error": "Insufficient credits"} > ``` > > **Fix:** Add credits on the [billing page](https://developer.encrata.com/billing), > or raise the key's [credit limit](/authentication#set-a-credit-limit). Repeat > lookups of an address you already queried are free during the > [6-month free-repeat window](/credits#free-repeat-window). > [accordion] 403 Forbidden > > Your credential is valid, but your workspace role does not permit this action. > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > {"error": "Insufficient permissions"} > ``` > > **Fix:** Use a key with a non-`readonly` role, or ask a workspace admin. > [accordion] 429 Too Many Requests > > You sent requests faster than the endpoint allows. > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > {"error": "Rate limit exceeded. Please try again later."} > ``` > > The response carries headers to time your retry: > > | Header | Meaning | > | - | - | > | `X-Ratelimit-Limit` | Maximum requests allowed in the window | > | `X-Ratelimit-Remaining` | Requests left in the current window | > | `X-Ratelimit-Reset` | Seconds until the window resets. **Use this.** | > > **Fix:** Wait `X-Ratelimit-Reset` seconds, then retry with exponential backoff. > `429` responses don't include `Retry-After`. See [Rate limits](/rate-limits). > [accordion] 5xx Server and upstream errors > > `500` is an unexpected failure. `502`, `503`, and `504` mean an upstream data > provider failed, is unconfigured, or timed out. > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > {"error": "upstream provider failed"} > ``` > > **Fix:** These are usually transient. Retry with exponential backoff. You are > not charged for a failed lookup. ## Retry safely > [!WARNING] > > Never retry a `400` or `401` unchanged. The request or credential is wrong, so > the retry fails identically. Fix the cause first. | Retry with backoff | Fix first, do not retry | | - | - | | `429`, `500`, `502`, `503`, `504` | `400`, `401`, `403`, `404`, `405`, `409`, `413` | For a `429`, wait `X-Ratelimit-Reset` seconds before retrying. The value is a number of seconds, not a timestamp. `429` responses don't include `Retry-After`. ## Next steps * [Rate limits](/rate-limits): Request limits, windows, and backoff guidance. * [Create API key](/authentication): Fix 401s: create and manage your API keys. # Examples Source: https://docs.encrata.com/examples Copy-paste recipes for every Encrata lookup, with real fields and real values. One recipe per lookup. Each snippet runs as-is once you set your API key, and uses the exact response fields the API returns. ## Skip undeliverable emails before you send Drop dead addresses so you never waste a send. Check `status` on [Email Validity](/api-reference/endpoint/validate-email). ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def is_deliverable(email: str) -> bool: r = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers=HEADERS, json={"email": email}, ) return r.json()["status"] == "valid" for email in ["satya@microsoft.com", "user@tempmail.com"]: if is_deliverable(email): send_welcome_email(email) ``` ## Enrich a signup into a CRM contact Turn a new user's email into a full profile with [Email Identity](/api-reference/endpoint/email-identity). Fields live under `person` and are empty strings when unknown. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} r = requests.post( "https://developer.encrata.com/api/lookup/email/identity", headers=HEADERS, json={"email": "jane@acme.com"}, ) person = r.json()["person"] crm.create_contact( name=f"{person.get('first_name', '')} {person.get('last_name', '')}".strip(), company=person.get("company"), title=person.get("job_role"), linkedin=person.get("socials", {}).get("linkedin"), ) ``` ## Personalize a greeting Pick a salutation from [Email Gender](/api-reference/endpoint/email-gender), and only when `probability` is high. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} r = requests.post( "https://developer.encrata.com/api/lookup/email/gender", headers=HEADERS, json={"email": "jane.doe@example.com"}, ) g = r.json() title = {"male": "Mr.", "female": "Ms."}.get(g["gender"]) if g["probability"] >= 90 else None greeting = f"Dear {title} Doe," if title else "Hi there," ``` ## Check cold-email compliance by country Gate outreach on the jurisdiction's rule from [Email Compliance](/api-reference/endpoint/email-compliance). The verdict is under `result`. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} r = requests.post( "https://developer.encrata.com/api/lookup/email/compliance", headers=HEADERS, json={"email": "priya.sharma@example.in"}, ) result = r.json()["result"] if result["recommendation_code"] in ("prohibited", "consent_required"): print(f"Hold: {result['recommendation']}") else: send_cold_email("priya.sharma@example.in") ``` ## Warn users about breached accounts Prompt a password reset when an address shows exposure in [Email Breaches](/api-reference/endpoint/check-breaches). ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} r = requests.post( "https://developer.encrata.com/api/lookup/email/breaches", headers=HEADERS, json={"email": "user@example.com"}, ) data = r.json() if data["breached"]: count = data["breach_info"]["breach_count"] notify_user(f"Your email appeared in {count} known breaches. Consider resetting your password.") ``` ## Block breached passwords at signup Reject leaked passwords with [Password Breaches](/api-reference/endpoint/password-breaches). Hash client-side and send `sha1`, so the plaintext never leaves your server. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import hashlib import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def password_is_safe(password: str) -> bool: sha1 = hashlib.sha1(password.encode()).hexdigest().upper() r = requests.post( "https://developer.encrata.com/api/lookup/email/password/breaches", headers=HEADERS, json={"sha1": sha1}, ) return not r.json()["found"] if not password_is_safe(user_password): reject("That password has appeared in a data breach. Please choose another.") ``` ## Fail CI on leaked secrets Scan a repo with [GitHub Leaks](/api-reference/endpoint/github-leaks) and fail the build on any finding. Read totals from `result.summary`. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} #!/usr/bin/env bash set -euo pipefail result=$(curl -s -X POST "https://developer.encrata.com/api/lookup/breaches/github" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d "{\"repo\": \"$GITHUB_REPO_URL\"}") leaks=$(echo "$result" | jq '.result.summary.total') if [ "$leaks" -gt 0 ]; then echo "$result" | jq -r '.result.findings[] | "\(.severity)\t\(.file):\(.start_line)\t\(.rule_id)"' echo "Found $leaks leaked secret(s). Failing the build." exit 1 fi ``` ## Find live credentials in collected text Scan text from your own crawler or feed with [Exposed API Keys](/api-reference/endpoint/exposed-api-keys). Act first on findings whose validation status is `valid`. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} response = requests.post( "https://developer.encrata.com/api/lookup/breaches/exposed-keys", headers=HEADERS, json={ "content": collected_text, "source": "security-crawler", "config": {"validate": True, "min_severity": "high"}, }, ) response.raise_for_status() for finding in response.json()["result"]["findings"]: validation = finding.get("validation", {}) if validation.get("status") == "valid": alert_security_team(finding["rule_id"], finding["preview"]) ``` ## Block a suspicious URL Use [URL Scan](/api-reference/endpoint/url-scan) before opening a link or passing it to another service. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} response = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, json={"kind": "url", "url": "https://example.com"}, ) response.raise_for_status() result = response.json()["result"] if result["verdict"] in {"malicious", "suspicious"}: block_url(result["final_url"], result["signals"]) ``` ## Check where a QR code leads Decode a photo of a QR code with [QR Code Scan](/api-reference/endpoint/qr-code-scan) before anyone follows it. Each code in the photo gets its own `verdict` under `codes`. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} with open("poster.jpg", "rb") as f: response = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "qr"}, files={"file": f}, ) response.raise_for_status() result = response.json()["result"] for code in result.get("codes", []): if code["verdict"] in {"malicious", "suspicious"}: flag_code(code["raw"], code.get("final_url"), code["position"]) ``` When the image has no readable code, `codes` is missing and `verdict` is `unknown`. ## Validate a barcode before you store it Decode a label image with [Barcode Scan](/api-reference/endpoint/barcode-scan) and write the value only when the scan is `clean`. A crafted barcode can carry script or SQL injection payloads. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} with open("label.png", "rb") as f: response = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "bar"}, files={"file": f}, ) response.raise_for_status() result = response.json()["result"] if result["verdict"] == "clean" and result.get("codes"): save_label(result["codes"][0]["format"], result["codes"][0]["raw"]) else: hold_item(result["signals"]) ``` ## Inspect an image before you publish it Check an upload with [Image Scan](/api-reference/endpoint/image-scan) for phishing text, embedded links, GPS location, and hidden data. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} with open("upload.jpg", "rb") as f: response = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "image"}, files={"file": f}, ) response.raise_for_status() result = response.json()["result"] if result["verdict"] in {"malicious", "suspicious"}: reject_upload(result["signals"]) elif result.get("metadata", {}).get("gps"): strip_location_and_publish("upload.jpg") ``` `url_scans` holds a full URL Scan result for up to three links found in the image text or in an embedded QR code. ## Reject malware in file uploads Scan an attachment with [File Scan](/api-reference/endpoint/file-scan) before anyone opens it. Accept the file only when `verdict` is `clean`. ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} with open("invoice.pdf", "rb") as f: response = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "file"}, files={"file": f}, ) response.raise_for_status() result = response.json()["result"] if result["verdict"] == "clean": accept_file("invoice.pdf") else: quarantine_file(result["sha256"], result["file_type"], result["signals"]) ``` For files already in storage, send a download link in `source_url` instead of uploading the file. Files can be up to 100 MiB. ## Next steps * [All lookups](/lookups): Every lookup, its input, and its cost. * [Bulk operations](/guides/bulk-operations): Run supported lookups over a million-row list as a background job. * [API reference](/api-reference/overview): Full request and response schemas. * [Credits](/credits): What each lookup costs and how free repeats work. # Bulk operations Source: https://docs.encrata.com/guides/bulk-operations Run any enrichment lookup at scale - hundreds to millions of records - from a single API call, with results delivered by webhook. Bulk operations run any Encrata lookup over hundreds to millions of records from a single API call. Submit the list as a **background job**, get a job `id` back immediately, and Encrata delivers the finished result to your webhook. No held-open request, no polling. The flow is always the same: 1. Submit the job with `download_link=true`. 2. Encrata processes it in the background and, when it finishes, calls your webhook with a `download_url`. 3. Fetch the `download_url` with your API key to get the file. Every request is authenticated with your `enc_` API key: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## Supported lookups Pick the lookup with the `type` field on the unified endpoint. | Lookup | `type` | Cost per row | Max per job | | - | - | - | - | | Email Validity | `validity` | 1 credit | 1,000,000 | | Email Identity | `identity` | 1,000 credits | 1,000,000 | | Email Breaches | `email-breaches` | 1 credit | 1,000,000 | | Email Gender | `gender` | 1 credit | 1,000,000 | | Password Breaches | `password-breaches` | 1 credit | 1,000,000 | > [!WARNING] > > **Dashboard only:** Job status, paginated results, cancellation, retry, and > deletion routes under `/api/jobs/{kind}` are not available with an API key on > `developer.encrata.com`. Submit with `POST /api/jobs/bulk`, receive the > completion webhook, then download with `GET /api/jobs/exports/download`. > [!NOTE] > > Credits are reserved when a job is created and refunded for any rows that don't > process. Size your list against your balance first - an identity job costs > **1,000 credits per resolved email**. ## Input formats Upload a file as `multipart/form-data` (field `file`) or send a JSON list. Files may be `CSV`, `TXT`, `MD`, `XLS`, `XLSX`, `DOCX`, or `PDF`, up to **50 MB** (60 MB for password breaches). Password jobs take **SHA-1 hashes** - the raw password never leaves your infrastructure. ## Run a bulk job A single endpoint runs every lookup, and a webhook delivers the finished file. **1. Register a webhook once** In **Settings → Webhooks**, add your endpoint and subscribe to the `bulk.completed` event. Encrata signs every delivery so you can verify it - see [Webhooks](/webhooks). **2. Submit the job** Send three fields: `type`, `file`, and `download_link=true`. You get a job `id` back right away (`202 Accepted`). ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=email-breaches" \ -F "download_link=true" \ -F "file=@leads.csv" ``` | Field | Required | Description | | - | - | - | | `type` | yes | `validity`, `identity`, `email-breaches`, `gender`, or `password-breaches`. | | `file` | yes | The list to process. | | `download_link` | no | Set `true` to pre-build the result file and receive a `download_url` in the webhook. Defaults to `false`. | **3. Receive the completion webhook** When the job finishes, Encrata `POST`s your endpoint. Because you set `download_link=true`, the payload carries a ready-to-fetch `download_url`. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "event": "bulk.completed", "data": { "job_id": "a1b2c3d4-0000-0000-0000-000000000000", "kind": "breaches", "status": "completed", "processed": 5000, "total": 5000, "download_url": "https://developer.encrata.com/api/jobs/exports/download?kind=breaches&id=a1b2c3d4-0000-0000-0000-000000000000&format=csv&filter=all" }, "created_at": "2026-05-02T12:00:00Z" } ``` **4. Download the file with your API key** Fetch the `download_url` exactly as delivered, authenticating with the **same API key**. It redirects to the finished file. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -L -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "$DOWNLOAD_URL" -o results.csv ``` Add `&json=1` to get `{"url": "..."}` instead of a redirect. A complete receiver - verify the signature, then download: ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} import express from "express"; import crypto from "crypto"; const app = express(); const KEY = process.env.ENCRATA_API_KEY; const SECRET = process.env.ENCRATA_WEBHOOK_SECRET; // Capture the raw body so the signature can be verified. app.post("/webhooks/encrata", express.raw({ type: "*/*" }), async (req, res) => { const signature = req.get("X-Encrata-Signature") || ""; const expected = crypto.createHmac("sha256", SECRET).update(req.body).digest("hex"); if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) { return res.status(400).json({ error: "bad signature" }); } const { event, data } = JSON.parse(req.body.toString()); res.sendStatus(200); // ack fast; do the download out of band if (event === "bulk.completed" && data.download_url) { const file = await fetch(data.download_url, { headers: { Authorization: `Bearer ${KEY}` }, redirect: "follow", }); const csv = await file.text(); // ...persist or process csv... } }); app.listen(3000); ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import hmac, hashlib, os, requests from flask import Flask, request, abort app = Flask(__name__) KEY = os.environ["ENCRATA_API_KEY"] SECRET = os.environ["ENCRATA_WEBHOOK_SECRET"].encode() @app.post("/webhooks/encrata") def receive(): body = request.get_data() signature = request.headers.get("X-Encrata-Signature", "") expected = hmac.new(SECRET, body, hashlib.sha256).hexdigest() if not hmac.compare_digest(expected, signature): abort(400) payload = request.get_json() if payload["event"] == "bulk.completed" and payload["data"].get("download_url"): file = requests.get( payload["data"]["download_url"], headers={"Authorization": f"Bearer {KEY}"}, allow_redirects=True, ) # ...persist or process file.content... return "", 200 ``` > [!TIP] > > Acknowledge the webhook quickly (return `2xx`), then download the file > in the background. Encrata retries deliveries that don't receive a `2xx`. ## Download options The `download_url` in the webhook returns a CSV of every row. To get a different format or a filtered subset, request the file yourself with the same fields: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -L "https://developer.encrata.com/api/jobs/exports/download?kind=validity&id=JOB_ID&format=xlsx&filter=valid" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -o results.xlsx ``` The export `kind` matches the job `type`, except for two lookups: `email-breaches` uses `kind=breaches` and `password-breaches` uses `kind=password`. **format** `string` `csv` (default), `xlsx`, or `json`. **filter** `string` Which rows to include. `all` (default), plus per-lookup subsets: validity → `valid` / `invalid` / `catch-all`; identity / gender → `found`; breaches / password → `breached`. ## Credits Each processed row costs the standard rate for that lookup - see the [Supported lookups](#supported-lookups) table above. Rows that fail on invalid input are not charged, and any reserved-but-unused credits are refunded when the job finishes. See [Credits](/credits) for the full breakdown. ## Troubleshooting > [accordion] 402 - insufficient credits > > Credits are reserved up front. Top up, or split the list into smaller jobs > that fit your balance. Unused reservations are refunded on completion. > [accordion] 400 - invalid type > > `type` must be one of `validity`, `identity`, `email-breaches`, `gender`, or > `password-breaches`. > [accordion] No download_url in the webhook > > The job was created without `download_link=true`. Re-submit with the flag set > to receive the `download_url` in the webhook. > [accordion] Webhook returns 4xx / never arrives > > Confirm the endpoint is subscribed to `bulk.completed` and returns `2xx` > quickly. Check delivery attempts in **Settings → Webhooks**; failed deliveries > are retried. See [Webhooks](/webhooks) for signature verification. ## Next steps * [Webhooks](/webhooks): Verify signatures and handle the `bulk.completed` delivery. * [All lookups](/lookups): Every lookup you can run in bulk. * [Credits](/credits): Costs, reservations, and refunds. # Single sign-on (SSO) Source: https://docs.encrata.com/guides/sso Connect your OIDC identity provider so your team signs in with your company login. SSO lets your team sign in to Encrata with your existing identity provider over OIDC. You add a connection for your email domain, verify you own that domain, then optionally require everyone on it to log in through your IdP. This guide walks through the full setup. > [!NOTE] > > SSO is managed per workspace and only a workspace `admin` can configure it. Connections use **OIDC** - point them at any provider that publishes a standard discovery document (Okta, Entra ID, Google, Auth0, and others). ## Before you start **1. Be a workspace admin** Only an `admin` can manage SSO. See [Workspaces and teams](/guides/workspaces) for roles. **2. Register an OIDC app with your IdP** Create an OIDC application in your identity provider and note its **issuer URL**, **client ID**, and **client secret**. ## Set up a connection **1. Create the connection** Send your issuer, client credentials, and the email domain it covers. Only `issuer`, `client_id`, `client_secret`, and `email_domain` are required. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/sso/connections" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "issuer": "https://acme.okta.com", "client_id": "0oa1b2c3d4", "client_secret": "your-client-secret", "email_domain": "acme.com", "display_name": "Okta", "enforce_sso": true, "auto_provision": true }' ``` A `201` returns the connection. Note `domain_verified` is `false` and a `verification_token` is included for the next step. The `client_secret` is never returned. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f", "workspace_id": "b3f1c2a4-5d6e-4f70-8a1b-9c2d3e4f5a6b", "provider": "custom", "display_name": "Okta", "issuer": "https://acme.okta.com", "client_id": "0oa1b2c3d4", "scopes": "openid email profile", "email_domain": "acme.com", "enforce_sso": true, "auto_provision": true, "default_role": "member", "active": true, "domain_verified": false, "verification_token": "9f8e7d6c5b4a39281706", "created_at": "2026-01-15T10:00:00Z", "updated_at": "2026-01-15T10:00:00Z", "last_used_at": null, "connection_count": 0 } ``` | Field | Type | Required | Description | | - | - | - | - | | `issuer` | string | Yes | OIDC issuer URL. Must be reachable over HTTPS and publish `/.well-known/openid-configuration`. | | `client_id` | string | Yes | OIDC client ID from your IdP. | | `client_secret` | string | Yes | OIDC client secret. Stored encrypted and never returned. | | `email_domain` | string | Yes | Email domain this connection covers, e.g. `acme.com`. | | `display_name` | string | No | Label shown on the login screen. Defaults to `SSO`. | | `provider` | string | No | Provider tag. Defaults to `custom`. | | `scopes` | string | No | OIDC scopes. Defaults to `openid email profile`. | | `enforce_sso` | boolean | No | Require users on this domain to sign in through SSO. Defaults to `false`. | | `auto_provision` | boolean | No | Create an account on first SSO login. Defaults to `true`. | | `default_role` | string | No | Role given to auto-provisioned users. Defaults to `member`. | **2. Verify domain ownership** A connection cannot log anyone in until you prove you own its domain. Add a DNS `TXT` record, then call verify. Create this record with your DNS provider: | Host | Value | | - | - | | `_encrata-sso.acme.com` | `encrata-sso-verify=` | Then confirm it: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/sso/verify-domain" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f" }' ``` ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "domain_verified": true } ``` > [!NOTE] > > DNS changes can take time to propagate. If the record is not visible yet, the response returns `domain_verified: false` with the exact `record_host` and `record_value` to set. Wait and retry. **3. Test the connection** Check that your issuer's discovery endpoint is reachable before you rely on it. Pass just the issuer. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/account/sso/test" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "issuer": "https://acme.okta.com" }' ``` ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "success": true } ``` > [!WARNING] > > This endpoint always returns `200`. Read the `success` field - a failure comes back as `{ "success": false, "error": "..." }`. ## Manage connections > [accordion] List connections > > Returns every SSO connection in your current workspace. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl "https://developer.encrata.com/api/account/sso/connections" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > [accordion] Update a connection > > Send the connection `id` and the fields to change. Leave `client_secret` empty to keep the stored one. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X PUT "https://developer.encrata.com/api/account/sso/connections" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{ > "id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f", > "issuer": "https://acme.okta.com", > "client_id": "0oa1b2c3d4", > "email_domain": "acme.com", > "enforce_sso": true, > "active": true > }' > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "status": "updated" } > ``` > > > [!NOTE] > > > > Changing `email_domain` resets `domain_verified` to `false`. You will need to verify the new domain again. > [accordion] Delete a connection > > Pass the connection id as the `id` query parameter. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X DELETE "https://developer.encrata.com/api/account/sso/connections?id=c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "status": "deleted" } > ``` ## Next steps * [Workspaces and teams](/guides/workspaces): Manage members and roles inside your workspace. * [Authentication](/authentication): How API keys and bearer auth work. # Use cases Source: https://docs.encrata.com/guides/use-cases Real jobs you can solve with Encrata email and malware lookups, each with the fields to check and a copy-paste recipe. This page maps common product jobs to the Encrata lookup that solves them. Each use case lists the fields to check and a runnable recipe. All recipes authenticate with `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. > [card] [Email](#email) > > Validate signups, screen for fraud, clean lists, enrich contacts, check cold-email compliance, and personalize greetings. > [card] [Malware](#malware) > > Check links, files, QR codes, barcodes, and images before anyone trusts them. ## Email Email use cases run on the Email lookups. Pick the job, then call the lookup in the last column. | Job | Lookup | Check first | | - | - | - | | [Validate an email at a decision point](#validate-an-email-at-a-decision-point) | Email Validity | `status`, `disposable`, `did_you_mean` | | [Screen signups for fraud](#screen-signups-for-fraud) | Email Validity + Email Breaches | `disposable`, `status`, `breached` | | [Clean a list in bulk](#clean-a-list-in-bulk) | Email Validity (bulk job) | `status` | | [Enrich a signup into a profile](#enrich-a-signup-into-a-profile) | Email Identity | `person` | | [Check cold-email compliance before outreach](#check-cold-email-compliance-before-outreach) | Email Compliance | `recommendation_code`, `confidence`, `checking` | | [Personalize a greeting by gender](#personalize-a-greeting-by-gender) | Email Gender | `gender`, `probability` | ### Validate an email at a decision point Block fake, mistyped, and disposable addresses the moment a user enters one. Every account, listing, or recovery address then starts out working. | Field | What it tells you | | - | - | | `status` | Whether the address can receive mail. Accept only `valid`. | | `disposable` | `true` for throwaway inbox providers. | | `did_you_mean` | A suggested fix for a likely typo, such as `gmial.com`. | ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def check_email(email: str): r = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers=HEADERS, json={"email": email}, ).json() if r.get("did_you_mean"): return "suggest", r["did_you_mean"] # likely typo, e.g. gmial.com if r.get("disposable") or r.get("status") != "valid": return "reject", None return "accept", None ``` > [!NOTE] > > This one pattern powers **signup validation**, **seller verification**, > **recovery checks**, and **bounce reduction**. Only the decision point > changes. For bounce reduction, run it before you add an address to a send. See [Email Validity](/api-reference/endpoint/validate-email) for every field. ### Screen signups for fraud Stop disposable and throwaway addresses before they reach your product. Add an Email Breaches check for a fuller risk picture. | Field | What it tells you | | - | - | | `disposable` | `true` for throwaway inbox providers. Block these. | | `status` | `risky` addresses need a second look. | | `breached` | Whether the address appears in known breaches. A real, long-lived address usually does. | ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def signup_risk(email: str) -> str: v = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers=HEADERS, json={"email": email}, ).json() if v.get("disposable") or v.get("status") == "risky": return "block" b = requests.post( "https://developer.encrata.com/api/lookup/email/breaches", headers=HEADERS, json={"email": email}, ).json() # A brand-new address with zero breach history can signal a throwaway. return "review" if not b.get("breached") else "allow" ``` See [Email Breaches](/api-reference/endpoint/check-breaches) for every field. ### Clean a list in bulk Remove invalid and dead addresses before an outbound campaign. Submit the whole list as one bulk job and keep the rows where `status` is `valid`. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/jobs/bulk" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "type=validity" \ -F "download_link=true" \ -F "file=@list.csv" ``` When the job finishes, download only the deliverable rows: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -L "https://developer.encrata.com/api/jobs/exports/download?kind=validity&id=JOB_ID&format=csv&filter=valid" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -o clean.csv ``` > [!NOTE] > > The same job powers **list cleaning** and ongoing **CRM hygiene**. Run it on > your own schedule to keep records clean as your database grows. See > [Bulk operations](/guides/bulk-operations) for webhook delivery and downloads. ### Enrich a signup into a profile Turn a new user's email into a full contact record: name, company, role, and social profiles. All fields live under `person`. | Field | What it tells you | | - | - | | `person.first_name`, `person.last_name` | The person's name. | | `person.company`, `person.job_role` | Where they work and what they do. | | `person.socials` | Social profile links, such as `linkedin`. | ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} person = requests.post( "https://developer.encrata.com/api/lookup/email/identity", headers=HEADERS, json={"email": "jane@acme.com"}, ).json()["person"] crm.create_contact( name=f"{person.get('first_name', '')} {person.get('last_name', '')}".strip(), company=person.get("company"), title=person.get("job_role"), linkedin=person.get("socials", {}).get("linkedin"), ) ``` See [Email Identity](/api-reference/endpoint/email-identity) for every field. ### Check cold-email compliance before outreach Find out which country's cold-email law applies to a prospect before you send. Sales tools and outbound platforms use this to hold sends that need consent and to show reps the rule behind the decision. | Field | What it tells you | | - | - | | `recommendation_code` | The machine-readable verdict, from `prohibited` and `consent_required` (strictest) to `safe_to_send`. Branch on this. | | `confidence` | `confident`, `medium`, or `unknown`. With `unknown`, no country is set and the restrictive default applies. | | `checking` | `true` while a deeper check runs. Send the same request again to get the settled verdict. | | `main_laws`, `main_restrictions` | The laws and rules to show your team. | ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} HOLD = {"prohibited", "consent_required", "exception_required", "case_by_case"} def can_cold_email(email: str): r = requests.post( "https://developer.encrata.com/api/lookup/email/compliance", headers=HEADERS, json={"email": email}, ).json()["result"] if r.get("checking"): return "retry", r["recommendation"] # provisional; repeats are free if r["recommendation_code"] in HOLD: return "hold", r["recommendation"] # also covers confidence "unknown" return "send", r["recommendation"] ``` > [!NOTE] > > Treat `confidence: unknown` as an answer, not an error. The response is still > `200` with a restrictive recommendation. Repeating a check for the same > address within 6 months costs no credits, so polling a provisional verdict is > free. See [Email Compliance](/api-reference/endpoint/email-compliance) for every field. ### Personalize a greeting by gender Pick a salutation or segment a list from the name in the address, such as `jane.doe@`. Use the prediction only when `probability` is high, and fall back to a neutral greeting otherwise. | Field | What it tells you | | - | - | | `gender` | `male`, `female`, or `unknown` when the name can't be resolved. | | `probability` | Confidence in the verdict, from `0` to `100`. | | `name` | The name the prediction was made from. | | `country` | The likely country for the name, as an ISO code. Can be `null` or the string `"NULL"`. | ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def greeting(email: str, last_name: str) -> str: g = requests.post( "https://developer.encrata.com/api/lookup/email/gender", headers=HEADERS, json={"email": email}, ).json() title = {"male": "Mr.", "female": "Ms."}.get(g["gender"]) if title and g["probability"] >= 90: return f"Dear {title} {last_name}," return "Hi there," # unknown or low confidence ``` > [!NOTE] > > Role addresses such as `info@` return `unknown` and are still billed. To label > a whole list, submit a bulk job with `type=gender`. See > [Bulk operations](/guides/bulk-operations). See [Email Gender](/api-reference/endpoint/email-gender) for every field. ## Malware Malware use cases run on one endpoint, `POST /api/lookup/malware/scan`. Set `kind` to choose what you scan. Each recipe shows the same cURL request as its API reference page, plus a Python version. Upload images and files as `multipart/form-data` in a `file` field. Every scan returns a `verdict` of `clean`, `suspicious`, `malicious`, or `unknown`. | Job | `kind` | Check first | | - | - | - | | [Check a link before someone clicks it](#check-a-link-before-someone-clicks-it) | `url` | `verdict`, `category`, `final_url` | | [Scan an uploaded file or attachment](#scan-an-uploaded-file-or-attachment) | `file` | `verdict`, `file_type`, `signals` | | [Find out where a QR code really leads](#find-out-where-a-qr-code-really-leads) | `qr` | `codes[].verdict`, `codes[].final_url` | | [Check a barcode before it enters your system](#check-a-barcode-before-it-enters-your-system) | `bar` | `verdict`, `codes[].raw` | | [Catch phishing sent as a picture](#catch-phishing-sent-as-a-picture) | `image` | `verdict`, `ocr_urls`, `url_scans` | | [Check a photo for location leaks and hidden data](#check-a-photo-for-location-leaks-and-hidden-data) | `image` | `metadata.gps`, `appended_data`, `steganography` | > [!TIP] > > Each scan costs **1 credit**. Scanning the same `kind` and content again > doesn't charge you twice, so a link shared in several places costs 1 credit. ### Check a link before someone clicks it Scan every link in an inbound email, chat message, or support ticket before it reaches a person. Email gateways, chat bots, and browser extensions use this to quarantine phishing in seconds. | Field | What it tells you | | - | - | | `verdict`, `category` | The outcome, such as `malicious` and `phishing`. | | `final_url`, `redirect_hops` | Where the link really lands after every redirect. | | `domain.age_days`, `domain.risky_tld` | How new the domain is. A days-old domain on a risky TLD is a strong phishing signal. | | `page` | What the landing page contains, including forms and password fields. | | `threat_intel`, `iocs` | Reputation results and indicators to send to your security team. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "kind": "url", "url": "http://testsafebrowsing.appspot.com/s/phishing.html" }' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json"} def check_link(url: str) -> str: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, json={"kind": "url", "url": url}, ).json()["result"] if r["verdict"] == "malicious": return "quarantine" # attach r["iocs"] to the security ticket if r["verdict"] in ("suspicious", "unknown"): return "review" return "allow" ``` > [!NOTE] > > Page analysis is static. Encrata doesn't run the page's scripts, so content > that appears only after JavaScript runs isn't analyzed. Private and internal > addresses are never fetched and return `unknown`. See [URL Scan](/api-reference/endpoint/url-scan) for every field. ### Scan an uploaded file or attachment Scan every file a user uploads before a person opens it: chat attachments, email attachments, CVs, claim documents, and identity documents. A rejected file never reaches your team. | Field | What it tells you | | - | - | | `verdict` | Accept only `clean`. | | `file_type` | What the file really is. A `refund_invoice.pdf` that is a Windows executable is a red flag. | | `signals` | Antivirus and rule matches behind the verdict. | | `sha256` | The file hash. Add it to your block list to reject re-uploads. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=file" \ -F "file=@document.pdf" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} def scan_upload(path: str) -> str: with open(path, "rb") as f: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "file"}, files={"file": f}, ).json()["result"] if r["verdict"] == "clean": return "accept" if r["verdict"] == "malicious": blocklist.add(r["sha256"]) return "reject" ``` For files already in storage, send a short-lived download link in `source_url` instead of uploading the file. Files can be up to **100 MiB**. ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=file" \ -F "source_url=https://files.example.com/signed/invoice.pdf" \ -F "filename=invoice.pdf" ``` See [File Scan](/api-reference/endpoint/file-scan) for every field. ### Find out where a QR code really leads Scan a photo of a QR code to see its real destination before anyone pays or logs in. Use it to catch fake stickers placed over real codes on parking meters, posters, menus, and payment terminals. One photo can hold several codes. Each code gets its own verdict, so a real code and a fake sticker next to it are reported separately. | Field | What it tells you | | - | - | | `codes[].verdict` | The verdict for each code in the photo. | | `codes[].raw`, `codes[].final_url` | What the code contains and where it lands after redirects. | | `codes[].payload_type` | What kind of content the code holds, such as `url`, `wifi`, or `text`. | | `codes[].position` | Where the code sits in the photo, in pixels. Use it to locate a fake sticker. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=qr" \ -F "file=@qr-code.png" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} def check_qr_photo(path: str) -> str: with open(path, "rb") as f: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "qr"}, files={"file": f}, ).json()["result"] if "codes" not in r: return "retake" # verdict is unknown: no code could be read flagged = [c for c in r["codes"] if c["verdict"] != "clean"] for c in flagged: print(c["raw"], c.get("final_url"), c["position"]) return "flag" if flagged else "ok" ``` > [!NOTE] > > The scan also reads Data Matrix and Aztec codes, and redacts secrets such as Wi-Fi > passwords as `REDACTED`. See [QR Code Scan](/api-reference/endpoint/qr-code-scan) for every field. ### Check a barcode before it enters your system Scan a photo of a shipping label, product code, or ticket before its value reaches your database. Many barcode readers type the decoded value straight into the connected system. A crafted barcode can carry control characters, SQL injection, or script payloads. | Field | What it tells you | | - | - | | `verdict` | Write the value to your system only when this is `clean`. | | `codes[].raw` | The decoded value. | | `codes[].format` | The barcode type, such as `code_128` or `ean_13`. | | `codes[].signals` | Why a value was flagged. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=bar" \ -F "file=@barcode.png" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} def read_label(path: str): with open(path, "rb") as f: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "bar"}, files={"file": f}, ).json()["result"] if r["verdict"] != "clean" or "codes" not in r: return None # hold the item, don't write the value return r["codes"][0]["raw"] ``` > [!NOTE] > > Barcode Scan takes an image of the barcode, not an already-decoded value. > It reads Code 128/39/93, Codabar, ITF, EAN-8/13, and UPC-A/E. See [Barcode Scan](/api-reference/endpoint/barcode-scan) for every field. ### Catch phishing sent as a picture Scan image attachments that carry no clickable link, such as a screenshot of a fake invoice that says "Scan to view your document." Link scanners miss these. Image Scan reads the text with OCR, finds URLs in the text and in any embedded QR code, and scans up to three of those links. | Field | What it tells you | | - | - | | `verdict` | The worst outcome across the image and the links found in it. | | `ocr_text`, `ocr_urls` | The text read from the image and the URLs in it. | | `url_scans` | A full URL Scan result for each discovered link. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=image" \ -F "file=@screenshot.png" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} def scan_image_attachment(path: str) -> str: with open(path, "rb") as f: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "image"}, files={"file": f}, ).json()["result"] for link in r.get("url_scans", []): print(link["submitted_url"], link["verdict"]) return "quarantine" if r["verdict"] in ("malicious", "suspicious") else "deliver" ``` See [Image Scan](/api-reference/endpoint/image-scan) for every field. ### Check a photo for location leaks and hidden data Scan photos before you publish them or accept them from users. A phone photo can carry the exact GPS location where it was taken and the camera owner's name. An image can also hide a file appended after its end, or data hidden in its pixels. | Field | What it tells you | | - | - | | `metadata.gps` | `latitude` and `longitude` where the photo was taken. | | `metadata.owner`, `metadata.camera_model` | Who owns the camera and which device took the photo. | | `appended_data` | A file stored after the image ends, with its `type`, such as `zip`, and `size_bytes`. | | `steganography.suspected` | `true` when data is likely hidden inside the image. | | `hashes.dhash` | A perceptual hash to find near-duplicate images. | ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -F "kind=image" \ -F "file=@screenshot.png" ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests HEADERS = {"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} def check_photo(path: str) -> list[str]: with open(path, "rb") as f: r = requests.post( "https://developer.encrata.com/api/lookup/malware/scan", headers=HEADERS, data={"kind": "image"}, files={"file": f}, ).json()["result"] issues = [] gps = r.get("metadata", {}).get("gps") if gps: issues.append(f"location: {gps['latitude']}, {gps['longitude']}") # strip before publishing if r.get("appended_data"): issues.append(f"appended {r['appended_data']['type']} file") if r.get("steganography", {}).get("suspected"): issues.append("hidden data suspected") return issues ``` See [Malware Scan](/api-reference/endpoint/malware-scan#image-fields) for every image field. ## Next steps > [card] [Examples](/examples) > > A recipe for every individual lookup. > [card] [Bulk operations](/guides/bulk-operations) > > Run a lookup over a list of up to 1,000,000 rows. > [card] [All lookups](/lookups) > > Every lookup, its input, and its cost. # Workspaces and teams Source: https://docs.encrata.com/guides/workspaces Create a workspace, invite your team, and control access with roles. A workspace is the container for your API keys, usage, and team. Every account starts with one, and everything you do through the API runs inside it. This guide walks you through creating a workspace, bringing your team in, and giving each person the right level of access. ## Before you start **1. Get an API key** Every request needs a bearer key. Grab one from the [dashboard](https://app.encrata.com) or read [Authentication](/authentication). **2. Set your base URL** All calls in this guide go to `https://developer.encrata.com` with an `Authorization: Bearer enc_...` header. > [!NOTE] > > Workspace endpoints accept either a dashboard session or an `enc_` API key, so the same calls work from your app, the CLI, and an agent. ## Set up your workspace **1. Create a workspace** Send a name. The `slug` is optional and is generated from the name when you omit it. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/workspaces" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Data" }' ``` A `201` returns the new workspace. The creator is added as an active `admin` automatically. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "id": "b3f1c2a4-5d6e-4f70-8a1b-9c2d3e4f5a6b", "public_id": "wsp_7K4mQ9xT2vN8cR5p", "name": "Acme Data", "slug": "acme-data", "logo_url": null, "created_by": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff", "created_at": "2026-01-15T10:00:00Z" } ``` | Field | Type | Required | Description | | - | - | - | - | | `name` | string | Yes | Display name, 1-48 characters. Letters, numbers, spaces, apostrophes, and hyphens only. | | `slug` | string | No | URL-friendly identifier. Auto-generated from `name` if omitted. Must be unique. | | `logo_url` | string | No | URL of the workspace logo. | **2. Invite your team** Invite by email and set the role they land with. The role defaults to `readonly` when you omit it. The invitee gets an email with a link to accept. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/workspaces/members" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "email": "bob@acme.com", "role": "tech" }' ``` A `201` returns the pending membership. ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "id": "7a0b1c2d-3e4f-4051-8b6c-8d9e0f1a2b3c", "workspace_id": "b3f1c2a4-5d6e-4f70-8a1b-9c2d3e4f5a6b", "user_id": null, "email": "bob@acme.com", "role": "tech", "status": "pending", "invited_at": "2026-01-16T09:30:00Z", "joined_at": null } ``` | Field | Type | Required | Description | | - | - | - | - | | `email` | string | Yes | Email address to invite. | | `role` | string | No | `admin`, `tech`, or `readonly`. Defaults to `readonly`. | > [!NOTE] > > Only an `admin` can invite. Inviting an address that already has a pending invite re-sends it, rate-limited to once per minute. **3. Accept the invite** The invited person signs in with the invited email, then posts the token from their invitation link. ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/workspaces/accept" \ -H "Authorization: Bearer enc_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d" \ -H "Content-Type: application/json" \ -d '{ "token": "b7f3...invite-token" }' ``` ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "message": "Invite accepted" } ``` > [!WARNING] > > The signed-in account must match the invited email. An invite for `bob@acme.com` can only be accepted by the account that owns that address. ## Choose a role for each member Every member holds one role: `admin`, `tech`, or `readonly`. You set it when you invite someone, and an `admin` can change it later. Give each person the lowest role that covers their work. * **`admin`** runs the workspace. Admins manage settings and members, and can delete the workspace. The workspace creator starts here. * **`tech`** builds with the API. Tech members run lookups, manage API keys, build webhooks, handle files, and buy credits. They cannot manage workspace settings or members. * **`readonly`** observes. Read-only members run lookups and view files and webhooks. They cannot create, change, or delete anything. ### What each role can do | Feature | `admin` | `tech` | `readonly` | | - | :-: | :-: | :-: | | Run lookups, manage API keys, and use AI Chat | ✓ | ✓ | ✓ | | Upload, delete, and share files | ✓ | ✓ | ✗ | | Browse, preview, and download files | ✓ | ✓ | ✓ | | Create, edit, delete, and test webhooks | ✓ | ✓ | ✗ | | View webhooks and their logs | ✓ | ✓ | ✓ | | Buy credits, manage the card, and set auto top-up | ✓ | ✓ | ✗ | | View credit usage | ✓ | ✓ | ✓ | | Edit workspace name, slug, and logo | ✓ | ✗ | ✗ | | Invite and manage members | ✓ | ✗ | ✗ | | Delete the workspace | ✓ | ✗ | ✗ | | Edit your profile, leave the workspace, and log out | ✓ | ✓ | ✓ | | Delete your account | ✓ | ✗ | ✗ | > [!NOTE] > > An account that doesn't belong to any workspace yet has `admin` access. > [!NOTE] > > There is no separate `owner` role. The person who creates a workspace is added as an `admin` and cannot be removed or leave while they are the last admin. ## Manage members > [accordion] List members > > Returns every member of your current workspace. Pass `?workspace_id=` to read a specific workspace you belong to. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl "https://developer.encrata.com/api/workspaces/members" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > [ > { > "id": "6f9a1b2c-3d4e-4f50-8a6b-7c8d9e0f1a2b", > "workspace_id": "b3f1c2a4-5d6e-4f70-8a1b-9c2d3e4f5a6b", > "user_id": "a1b2c3d4-e5f6-4711-8899-aabbccddeeff", > "email": "alice@acme.com", > "role": "admin", > "status": "active", > "invited_at": "2026-01-15T10:00:00Z", > "joined_at": "2026-01-15T10:00:00Z", > "name": "Alice" > } > ] > ``` > [accordion] Change a member's role > > Pass the member `id` (from the list response), not the user id. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X PUT "https://developer.encrata.com/api/workspaces/members" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{ "member_id": "7a0b1c2d-3e4f-4051-8b6c-8d9e0f1a2b3c", "role": "admin" }' > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "Role updated" } > ``` > > | Field | Type | Required | Description | > | - | - | - | - | > | `member_id` | string | Yes | Member id to update. | > | `role` | string | Yes | New role: `admin`, `tech`, or `readonly`. | > > > [!NOTE] > > > > You cannot demote the last remaining admin. Promote someone else first. > [accordion] Remove a member > > Pass the member id as the `id` query parameter. Admin only. To remove yourself, use **Leave a workspace** instead. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X DELETE "https://developer.encrata.com/api/workspaces/members?id=7a0b1c2d-3e4f-4051-8b6c-8d9e0f1a2b3c" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "Member removed" } > ``` > [accordion] Leave a workspace > > Leaving requires an OTP code for security. Check whether you can leave with a `GET`, then confirm with a `POST` and the code. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > # 1. Check you're allowed to leave > curl "https://developer.encrata.com/api/workspaces/leave" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > > # 2. Confirm with the verification code > curl -X POST "https://developer.encrata.com/api/workspaces/leave" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{ "code": "123456" }' > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "You have left the workspace" } > ``` > > > [!WARNING] > > > > You cannot leave if you are the only member or the last admin. ## Manage workspaces > [accordion] List your workspaces > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl "https://developer.encrata.com/api/workspaces" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > Returns every workspace you belong to. > [accordion] Switch your active workspace > > Use `PUT`, not `POST`. This sets which workspace subsequent calls run against. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X PUT "https://developer.encrata.com/api/workspaces/switch" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{ "workspace_id": "b3f1c2a4-5d6e-4f70-8a1b-9c2d3e4f5a6b" }' > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "Workspace switched" } > ``` > [accordion] Update workspace settings > > Updates your current workspace when `workspace_id` is omitted. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X PUT "https://developer.encrata.com/api/workspaces" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ > -H "Content-Type: application/json" \ > -d '{ "name": "Acme Data Team", "logo_url": "https://acme.com/logo.png" }' > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "Workspace updated" } > ``` > > | Field | Type | Required | Description | > | - | - | - | - | > | `name` | string | Yes | New workspace name, 1-48 characters. | > | `slug` | string | No | New slug. Must be unique. | > | `logo_url` | string | No | Logo URL. | > | `workspace_id` | string | No | Workspace to update. Defaults to your current workspace. | > [accordion] Delete a workspace > > Deletes your current workspace and all of its data. Admin only. > > ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} > curl -X DELETE "https://developer.encrata.com/api/workspaces" \ > -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" > ``` > > ```json theme={"theme":{"light":"github-light","dark":"vesper"}} > { "message": "Workspace deleted" } > ``` > > > [!WARNING] > > > > This permanently deletes the workspace, its members, and API keys. It cannot be undone. ## Next steps * [Authentication](/authentication): Create and manage the API keys your workspace uses. * [Bulk operations](/guides/bulk-operations): Process large batches inside your workspace. * [API reference](/api-reference/overview): Full endpoint details and response fields. # Handle a leaked API key Source: https://docs.encrata.com/handle-leaked-key What to do the moment an Encrata API key is exposed, and how to limit the damage next time. Treat any key that lands in a commit, a ticket, a log, or client-side code as compromised. An `enc_` key can spend your account's credits, so act fast. ## Contain it now **1. Permanently delete the exposed key** Delete it from the dashboard's API Keys page, or call `DELETE /api/account/keys?id={id}&permanent=true`. See [Revoke or delete API key](/api-reference/endpoint/revoke-key). **2. Issue a replacement** Create a new key from the [dashboard or the API](/authentication), store it in your secret manager, and deploy it. **3. Check what it did** Review the key's usage with [`list-keys`](/api-reference/endpoint/list-keys). `credits_used` and `last_used_at` show whether it was abused before deletion. > [!WARNING] > > **Known issue:** Revocation is not final. A revoked key can be enabled again, > and its secret can still be revealed. Revoked and disabled keys both appear as > `is_active: false`. Permanently delete a leaked key. ## Limit the blast radius next time > [card] [Cap each key's spend](/authentication#set-a-credit-limit) > > Set a per-key credit limit so a leaked key stops at a ceiling instead of draining your balance. > [card] [One key per service](/authentication) > > Name keys by where they run (`production-backend`) so you can delete one without disrupting the rest. > [card] Keep keys out of code > > Store keys in environment variables or a secret manager, never in source control or client-side code. > [card] [Watch for abnormal spend](/webhooks) > > Subscribe to the `credits.low` and `credits.exhausted` webhooks to catch a runaway key early. ## Next steps * [API keys & authentication](/authentication): Create, rotate, and cap keys. * [Credits](/credits): How spend and free repeats work. # CrewAI Source: https://docs.encrata.com/integrations/crewai Use Encrata as a tool in your CrewAI agents for email intelligence. ## Overview [CrewAI](https://www.crewai.com) is a framework for orchestrating autonomous AI agents that collaborate on tasks. You can give your crew access to Encrata for email enrichment, validation, and breach checking. ## Installation ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} pip install crewai requests ``` ## Define Encrata tools ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests from crewai.tools import tool ENCRATA_API_KEY = "enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" BASE_URL = "https://developer.encrata.com/api/lookup/email" HEADERS = { "Authorization": f"Bearer {ENCRATA_API_KEY}", "Content-Type": "application/json", } @tool("Lookup Email") def lookup_email(email: str) -> dict: """Look up detailed intelligence about a person by their email address. Returns name, company, job role, industry, location, and social profiles. Costs 1,000 credits.""" resp = requests.post( f"{BASE_URL}/identity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() @tool("Validate Email") def validate_email(email: str) -> dict: """Validate whether an email address is deliverable, invalid, or disposable. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/validity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() @tool("Check Breaches") def check_breaches(email: str) -> dict: """Check if an email has been exposed in known data breaches. Returns breach count, affected services, and exposed data types. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/breaches", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() ``` ## Create agents and tasks ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from crewai import Agent, Task, Crew researcher = Agent( role="Lead Researcher", goal="Gather detailed intelligence on people from their email addresses", backstory="You are a seasoned research analyst specializing in " "contact intelligence and due diligence.", tools=[lookup_email, validate_email, check_breaches], verbose=True, ) analyst = Agent( role="Intelligence Analyst", goal="Analyze and summarize findings into actionable briefs", backstory="You synthesize raw data into clear, structured reports.", verbose=True, ) research_task = Task( description="Look up the following email and gather all available intelligence: {email}", expected_output="Full enrichment data including name, company, role, socials, and breach exposure.", agent=researcher, ) report_task = Task( description="Write a concise intelligence brief based on the research findings.", expected_output="A structured summary with key facts, risk indicators, and recommendations.", agent=analyst, ) crew = Crew( agents=[researcher, analyst], tasks=[research_task, report_task], verbose=True, ) result = crew.kickoff(inputs={"email": "satya@microsoft.com"}) print(result) ``` ## Bulk research example ```python theme={"theme":{"light":"github-light","dark":"vesper"}} emails = [ "satya@microsoft.com", "tim@apple.com", "sundar@google.com", ] for email in emails: result = crew.kickoff(inputs={"email": email}) print(f"\n--- {email} ---") print(result) ``` ## Next steps * [API reference](/api-reference/overview): Full request and response schemas for every endpoint. * [Field glossary](/api-reference/fields): Every field an enrichment can return. * [Examples](/examples): Copy-paste recipes for each lookup. * [Credits](/credits): What each lookup costs. # Haystack Source: https://docs.encrata.com/integrations/haystack Use Encrata as a component in your Haystack pipelines for email intelligence. ## Overview [Haystack](https://haystack.deepset.ai) is an open-source framework for building production-ready LLM applications and RAG pipelines. You can integrate Encrata as a custom component to enrich emails inline within your pipelines. ## Installation ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} pip install haystack-ai requests ``` ## Create an Encrata component ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests from typing import List, Optional from haystack import component ENCRATA_API_KEY = "enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" BASE_URL = "https://developer.encrata.com/api/lookup/email" HEADERS = { "Authorization": f"Bearer {ENCRATA_API_KEY}", "Content-Type": "application/json", } @component class EncrataEmailLookup: """Looks up detailed intelligence about people by their email addresses.""" @component.output_types(results=List[dict]) def run(self, emails: List[str]): results = [] for email in emails: resp = requests.post( f"{BASE_URL}/identity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() results.append(resp.json()) return {"results": results} @component class EncrataEmailValidator: """Validates whether email addresses are deliverable.""" @component.output_types(results=List[dict]) def run(self, emails: List[str]): results = [] for email in emails: resp = requests.post( f"{BASE_URL}/validity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() results.append(resp.json()) return {"results": results} @component class EncrataBreachChecker: """Checks emails against known data breaches.""" @component.output_types(results=List[dict]) def run(self, emails: List[str]): results = [] for email in emails: resp = requests.post( f"{BASE_URL}/breaches", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() results.append(resp.json()) return {"results": results} ``` ## Use in a pipeline ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from haystack import Pipeline pipeline = Pipeline() pipeline.add_component("enricher", EncrataEmailLookup()) result = pipeline.run({"enricher": {"emails": ["satya@microsoft.com"]}}) print(result["enricher"]["results"][0]) ``` ## Enrichment + LLM summary pipeline ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from haystack import Pipeline from haystack.components.generators import OpenAIGenerator from haystack.components.builders import PromptBuilder @component class FormatEnrichment: """Formats enrichment results into a prompt-friendly string.""" @component.output_types(text=str) def run(self, results: List[dict]): lines = [] for r in results: p = r.get("person", {}) lines.append(f"Name: {p.get('first_name', 'N/A')} {p.get('last_name', '')}".strip()) lines.append(f"Company: {p.get('company', 'N/A')}") lines.append(f"Role: {p.get('job_role', 'N/A')}") lines.append(f"Location: {p.get('current_location', 'N/A')}") lines.append(f"Industry: {p.get('industry', 'N/A')}") lines.append("") return {"text": "\n".join(lines)} template = """Based on this enrichment data, write a brief professional summary: {{ text }} Summary:""" pipeline = Pipeline() pipeline.add_component("enricher", EncrataEmailLookup()) pipeline.add_component("formatter", FormatEnrichment()) pipeline.add_component("prompt", PromptBuilder(template=template)) pipeline.add_component("llm", OpenAIGenerator(model="gpt-4o-mini")) pipeline.connect("enricher.results", "formatter.results") pipeline.connect("formatter.text", "prompt.text") pipeline.connect("prompt.prompt", "llm.prompt") result = pipeline.run({"enricher": {"emails": ["satya@microsoft.com"]}}) print(result["llm"]["replies"][0]) ``` ## Batch enrichment pipeline ```python theme={"theme":{"light":"github-light","dark":"vesper"}} emails = [ "satya@microsoft.com", "tim@apple.com", "sundar@google.com", ] pipeline = Pipeline() pipeline.add_component("enricher", EncrataEmailLookup()) result = pipeline.run({"enricher": {"emails": emails}}) for i, result_item in enumerate(result["enricher"]["results"]): p = result_item.get("person", {}) print(f"{emails[i]}: {p.get('first_name', 'N/A')} {p.get('company', 'N/A')}") ``` ## Next steps * [API reference](/api-reference/overview): Full request and response schemas for every endpoint. * [Field glossary](/api-reference/fields): Every field an enrichment can return. * [Examples](/examples): Copy-paste recipes for each lookup. * [Credits](/credits): What each lookup costs. # LangChain Source: https://docs.encrata.com/integrations/langchain Use Encrata as a tool in your LangChain agents for email intelligence. ## Overview [LangChain](https://python.langchain.com) is a framework for building applications powered by LLMs. You can add Encrata as a custom tool so your LangChain agents can enrich emails, validate deliverability, and check breach exposure on the fly. ## Installation ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} pip install langchain langchain-openai requests ``` ## Define Encrata tools ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests from langchain.tools import tool ENCRATA_API_KEY = "enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" BASE_URL = "https://developer.encrata.com/api/lookup/email" HEADERS = { "Authorization": f"Bearer {ENCRATA_API_KEY}", "Content-Type": "application/json", } @tool def lookup_email(email: str) -> dict: """Look up detailed intelligence about a person by their email address. Returns name, company, job role, industry, location, and social profiles. Costs 1,000 credits.""" resp = requests.post( f"{BASE_URL}/identity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() @tool def validate_email(email: str) -> dict: """Validate whether an email address is deliverable, invalid, or disposable. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/validity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() @tool def check_breaches(email: str) -> dict: """Check if an email has been exposed in known data breaches. Returns breach count, affected services, and exposed data types. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/breaches", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return resp.json() ``` ## Use with an agent ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from langchain_openai import ChatOpenAI from langchain.agents import AgentExecutor, create_tool_calling_agent from langchain_core.prompts import ChatPromptTemplate llm = ChatOpenAI(model="gpt-4o") tools = [lookup_email, validate_email, check_breaches] prompt = ChatPromptTemplate.from_messages([ ("system", "You are a research assistant with access to email intelligence tools."), ("human", "{input}"), ("placeholder", "{agent_scratchpad}"), ]) agent = create_tool_calling_agent(llm, tools, prompt) executor = AgentExecutor(agent=agent, tools=tools, verbose=True) result = executor.invoke({ "input": "Look up satya@microsoft.com and tell me about their role and company." }) print(result["output"]) ``` ## Next steps * [API reference](/api-reference/overview): Full request and response schemas for every endpoint. * [Field glossary](/api-reference/fields): Every field an enrichment can return. * [Examples](/examples): Copy-paste recipes for each lookup. * [Credits](/credits): What each lookup costs. # LlamaIndex Source: https://docs.encrata.com/integrations/llamaindex Use Encrata as a tool in your LlamaIndex agents for email intelligence. ## Overview [LlamaIndex](https://www.llamaindex.ai/) is a framework for building LLM-powered applications over your data. You can add Encrata as a custom tool so your LlamaIndex agents can enrich emails, validate deliverability, and check breach exposure. ## Installation ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} pip install llama-index requests ``` ## Define Encrata tools ```python theme={"theme":{"light":"github-light","dark":"vesper"}} import json import requests from llama_index.core.tools import FunctionTool ENCRATA_API_KEY = "enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" BASE_URL = "https://developer.encrata.com/api/lookup/email" HEADERS = { "Authorization": f"Bearer {ENCRATA_API_KEY}", "Content-Type": "application/json", } def lookup_email(email: str) -> str: """Look up detailed intelligence about a person by their email address. Returns name, company, job role, industry, location, and social profiles. Costs 1,000 credits.""" resp = requests.post( f"{BASE_URL}/identity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return json.dumps(resp.json(), indent=2) def validate_email(email: str) -> str: """Validate whether an email address is deliverable, invalid, or disposable. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/validity", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return json.dumps(resp.json(), indent=2) def check_breaches(email: str) -> str: """Check if an email has been exposed in known data breaches. Returns breach count, affected services, and exposed data types. Costs 1 credit; repeat lookups during the 6-month free-repeat window are free.""" resp = requests.post( f"{BASE_URL}/breaches", headers=HEADERS, json={"email": email}, ) resp.raise_for_status() return json.dumps(resp.json(), indent=2) lookup_tool = FunctionTool.from_defaults(fn=lookup_email) validate_tool = FunctionTool.from_defaults(fn=validate_email) breach_tool = FunctionTool.from_defaults(fn=check_breaches) ``` ## Use with a ReAct agent ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from llama_index.core.agent import ReActAgent from llama_index.llms.openai import OpenAI llm = OpenAI(model="gpt-4o") agent = ReActAgent.from_tools( [lookup_tool, validate_tool, breach_tool], llm=llm, verbose=True, system_prompt="You are a research assistant with access to email intelligence tools.", ) response = agent.chat("Look up satya@microsoft.com and summarize their profile.") print(response) ``` ## Use with a function calling agent ```python theme={"theme":{"light":"github-light","dark":"vesper"}} from llama_index.core.agent import FunctionCallingAgent from llama_index.llms.openai import OpenAI llm = OpenAI(model="gpt-4o") agent = FunctionCallingAgent.from_tools( [lookup_tool, validate_tool, breach_tool], llm=llm, verbose=True, ) response = agent.chat("Is satya@microsoft.com a valid email? Has it been in any breaches?") print(response) ``` ## Batch research example ```python theme={"theme":{"light":"github-light","dark":"vesper"}} emails = [ "satya@microsoft.com", "tim@apple.com", "sundar@google.com", ] for email in emails: response = agent.chat(f"Look up {email} and give me a one-line summary.") print(f"{email}: {response}") ``` ## Next steps * [API reference](/api-reference/overview): Full request and response schemas for every endpoint. * [Field glossary](/api-reference/fields): Every field an enrichment can return. * [Examples](/examples): Copy-paste recipes for each lookup. * [Credits](/credits): What each lookup costs. # Introduction Source: https://docs.encrata.com/introduction Use one REST API to enrich email data and inspect breaches, exposed credentials, and suspicious content. Encrata is a REST API for developers and AI agents that need structured identity, deliverability, compliance, and breach data. To get started, you'll need: 1. [An Encrata account](https://app.encrata.com/signup) 2. [An API key](/authentication) Then, you'll be ready to: * **Validate email addresses:** check whether an address is deliverable before you send * **Enrich people:** turn an email address into a person and company profile * **Assess compliance:** identify the cold-email laws and restrictions that may apply * **Investigate exposure:** check email addresses, passwords, repositories, and collected text for leaked credentials * **Scan suspicious content:** inspect URLs, QR codes, barcodes, images, and files for threats * **Process lists:** run supported lookups across large CSV, TXT, or XLSX files ## Quickstart > [card] [Quickstart](/quickstart) > > Make your first API request in under two minutes. > [card] [Authentication](/authentication) > > Create an API key and authenticate your requests. > [card] [CLI](/cli) > > Run lookups from your terminal without writing code. ## How the API works | Part | What to expect | | - | - | | **Base URL** | `https://developer.encrata.com` | | **Authentication** | Send `Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` with each protected request. | | **Requests** | Lookups use `POST` with a JSON body and `Content-Type: application/json`. | | **Responses** | Responses are JSON. Use the HTTP status code before reading the response body. | | **Billing** | Successful lookups deduct credits according to the lookup's pricing model. | | **Free repeats** | Most repeated lookups of the same input cost `0` credits during the [6-month free-repeat window](/credits#free-repeat-window). | > [!NOTE] > > The default rate limit is 200 requests per minute per account. All API keys on > the account share the same limit. See [Rate limits](/rate-limits) for response > headers and retry guidance. ## Choose a lookup Start with the lowest-cost lookup that answers your question. Validate an address before paying to enrich it. Use the breach check when you only need a yes-or-no answer. | You want to know | Request | Cost | | - | - | - | | Whether an email address will bounce | `POST /api/lookup/email/validity` | 1 credit | | Whether an email address has appeared in a breach | `POST /api/lookup/email/breaches/check` | 1 credit | | Which breaches exposed an email address | `POST /api/lookup/email/breaches` | 1 credit | | Who is behind an email address | `POST /api/lookup/email/identity` | 1,000 credits | | The likely gender and country behind an email address | `POST /api/lookup/email/gender` | 1 credit | | Which cold-email rules may apply | `POST /api/lookup/email/compliance` | 1 credit | | Whether a password has appeared in a breach | `POST /api/lookup/email/password/breaches` | 1 credit | | Whether a public GitHub repository contains leaked secrets | `POST /api/lookup/breaches/github` | 1 credit per leak; clean scans are free | | Whether collected text contains exposed credentials | `POST /api/lookup/breaches/exposed-keys` | 1 credit per finding; clean scans are free | | Whether a URL, code, image, or file contains threats | `POST /api/lookup/malware/scan` | 1 credit | > [!TIP] > > Check your balance with `GET /api/account/credits` before an Email Identity > lookup or a large bulk job. See [Credits](/credits) for billing details. ## Explore > [card] [Lookups](/lookups) > > Compare each lookup and decide which one fits your task. > [card] [API reference](/api-reference/overview) > > Review endpoints, request bodies, response fields, and errors. > [card] [Bulk operations](/guides/bulk-operations) > > Process long lists with asynchronous jobs and webhooks. > [card] [Credits](/credits) > > Understand lookup costs, free repeats, and balance checks. > [card] [Agent authentication](/auth-md/for-agents) > > Connect an AI agent without exposing an API key in chat. > [card] [Errors](/errors) > > Handle status codes, retries, and rate limits. # Lookups Source: https://docs.encrata.com/lookups Choose an Encrata lookup for email intelligence, breach detection, exposed credentials, or malware scanning. Encrata provides focused lookups for email intelligence, breach detection, exposed credentials, and suspicious content. Choose the lookup that answers your question so you request only the data you need. ## Enrich and verify > [card] [Email Validity](/api-reference/endpoint/validate-email) > > Is this address safe to send to? Returns valid, invalid, catch-all, or risky. > [card] [Email Identity](/api-reference/endpoint/email-identity) > > Who is behind this email? A full person profile: name, role, company, socials. > [card] [Email Gender](/api-reference/endpoint/email-gender) > > Predict likely gender and country to personalize outreach. > [card] [Email Compliance](/api-reference/endpoint/email-compliance) > > May you cold-email this address, and under whose law? ## Detect risk and breaches > [card] [Email Breaches](/api-reference/endpoint/check-breaches) > > Where has this email leaked, and what data was exposed? > [card] [Password Breaches](/api-reference/endpoint/password-breaches) > > Has this password appeared in a breach? Checked privately with k-anonymity. > [card] [GitHub Leaks](/api-reference/endpoint/github-leaks) > > Scan a public repo for exposed secrets, keys, and tokens. > [card] [Exposed API Keys](/api-reference/endpoint/exposed-api-keys) > > Scan collected text for credentials and check whether supported keys are live. ## Scan suspicious content All five scan types use `POST /api/lookup/malware/scan`. Set `kind` to choose the scanner. > [card] [URL scan](/api-reference/endpoint/url-scan) > > Inspect redirects, hosting, page signals, downloads, and threat intelligence. > [card] [QR code scan](/api-reference/endpoint/qr-code-scan) > > Decode QR, Data Matrix, and Aztec payloads and inspect their links. > [card] [Barcode scan](/api-reference/endpoint/barcode-scan) > > Decode common 1D barcode formats and assess their payloads. > [card] [Image scan](/api-reference/endpoint/image-scan) > > Check metadata, hidden content, embedded codes, OCR text, and discovered links. > [card] [File scan](/api-reference/endpoint/file-scan) > > Scan file bytes or a short-lived download URL for malware and rule matches. ## Compare at a glance | Lookup | Endpoint | Input | Cost | | - | - | - | - | | Email Validity | `POST /api/lookup/email/validity` | email | 1 credit | | Email Identity | `POST /api/lookup/email/identity` | email | 1,000 credits | | Email Gender | `POST /api/lookup/email/gender` | email | 1 credit | | Email Compliance | `POST /api/lookup/email/compliance` | email | 1 credit | | Email Breaches | `POST /api/lookup/email/breaches` | email | 1 credit | | Password Breaches | `POST /api/lookup/email/password/breaches` | password or SHA-1 | 1 credit | | GitHub Leaks | `POST /api/lookup/breaches/github` | repo URL | 1 per leak found | | Exposed API Keys | `POST /api/lookup/breaches/exposed-keys` | collected text | 1 per credential found | | URL Scan | `POST /api/lookup/malware/scan` | `kind: "url"` and URL | 1 credit | | QR Code Scan | `POST /api/lookup/malware/scan` | `kind: "qr"` and base64 image | 1 credit | | Barcode Scan | `POST /api/lookup/malware/scan` | `kind: "bar"` and base64 image | 1 credit | | Image Scan | `POST /api/lookup/malware/scan` | `kind: "image"` and base64 image | 1 credit | | File Scan | `POST /api/lookup/malware/scan` | `kind: "file"` and base64 content or URL | 1 credit | > [!NOTE] > > Most lookups are 1 credit with free repeats during the > [6-month free-repeat window](/credits#free-repeat-window). Email > Identity is a premium lookup at 1,000 credits. GitHub Leaks and Exposed API > Keys charge only for findings, so clean scans are free. Each malware scan > costs 1 credit. See [Credits](/credits) for the full breakdown. ## Not sure which to use? > [accordion] Clean a list before a campaign > > Start with **Email Validity** to drop undeliverable addresses, then > **Email Compliance** to confirm you may contact each one. > [accordion] Enrich a lead or user > > **Email Identity** returns the full person profile. Add **Email Gender** when > you only need a lightweight personalization signal. > [accordion] Assess account risk > > **Email Breaches** shows past exposure for an address. **Password Breaches** > guards sign-up and reset flows against leaked passwords. > [accordion] Catch secrets in your code > > **GitHub Leaks** scans a public repository for committed credentials. > [accordion] Find credentials in collected text > > **Exposed API Keys** scans text you already collected and can validate > whether supported credentials still work. > [accordion] Inspect a suspicious link or attachment > > **Malware Scan** checks URLs, QR codes, barcodes, images, and files through > one endpoint. ## Next steps * [Quickstart](/quickstart): Make your first lookup in under two minutes. * [All endpoints](/api-reference/overview): Full request and response schemas for every lookup. # Quickstart Source: https://docs.encrata.com/quickstart Get up and running with the Encrata API in under 2 minutes. ## 1. Get your API key Sign in to the [Encrata dashboard](https://app.encrata.com/login) and create a key from the **API Keys** page. Your key is shown once when it is created, so copy it and store it securely. Your key starts with `enc_` and is tied to your account. Keep it server-side and never commit it to source control. > [!NOTE] > > Already set up and want to manage keys from code? Use [`POST /api/account/keys`](/api-reference/endpoint/create-key) to create and rotate keys programmatically. ## 2. Validate your first email The fastest way to see the API work is the **Email Validity** endpoint. Send an address to `POST /api/lookup/email/validity` and Encrata tells you whether it is safe to send to - `valid`, `invalid`, `catch-all`, or `risky` - along with the reason, provider, and domain trust signals. It is the same check you would run to scrub a list before a campaign and cut bounces. Every request authenticates with your API key in the `Authorization` header: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}} curl -X POST "https://developer.encrata.com/api/lookup/email/validity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "satya@microsoft.com"}' ``` ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import requests resp = requests.post( "https://developer.encrata.com/api/lookup/email/validity", headers={"Authorization": "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={"email": "satya@microsoft.com"}, ) print(resp.json()) ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} const resp = await fetch("https://developer.encrata.com/api/lookup/email/validity", { method: "POST", headers: { Authorization: "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ email: "satya@microsoft.com" }), }); const data = await resp.json(); console.log(data); ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]string{"email": "satya@microsoft.com"}) req, _ := http.NewRequest("POST", "https://developer.encrata.com/api/lookup/email/validity", bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) fmt.Println(result) } ``` ## 3. Read the response A `200 OK` returns the verdict plus enrichment. The two fields you will branch on are `status` (the public verdict) and `reason` (the machine-readable cause): ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "email": "satya@microsoft.com", "status": "valid", "reason": "deliverable", "disposable": false, "confidence": "high", "role": false, "role_name": "", "did_you_mean": "", "domain": "microsoft.com", "provider": "microsoft", "free_provider": false, "mx": ["microsoft-com.mail.protection.outlook.com"], "domain_trust": { "grade": "A", "spf": true, "dmarc": true, "mta_sts": "enforce", "spf_record": "v=spf1 include:_spf.example.com -all", "dmarc_record": "v=DMARC1; p=reject" }, "domain_info": { "registrar": "Example Registrar", "created_at": "1995-08-14T00:00:00Z", "expires_at": "2027-08-13T00:00:00Z", "age_days": 11377, "nameservers": ["ns1.example.com"], "dnssec": true, "a": ["192.0.2.10"] }, "smtp": { "mx_host": "mx.example.com", "message": "Mailbox accepted", "catch_all": false, "greylisted": false }, "message": "Mailbox exists and accepts mail, safe to send.", "credits": 1, "cached": false } ``` > [!NOTE] > > Each validation costs **1 credit**. Repeat checks of the same address within the > [6-month free-repeat window](/credits#free-repeat-window) are free (`credits: 0`). See the full field > reference on the [Email Validity](/api-reference/endpoint/validate-email) page. ## Next steps You made your first lookup. Here is where to go next. * [Email Identity](/api-reference/endpoint/email-identity): Resolve an email into a full person profile. * [All endpoints](/api-reference/overview): Browse every lookup with request and response schemas. * [Bulk operations](/guides/bulk-operations): Look up thousands of emails in a single job. * [Webhooks](/webhooks): Get notified when your bulk runs finish. # Rate limits Source: https://docs.encrata.com/rate-limits How Encrata rate limits requests, the headers to watch, and how to retry cleanly. Encrata caps how many requests your account can make in a short window to keep the API fast and fair for everyone. This page explains the limit, the headers on lookup responses, what a rejection looks like, and how to handle it. ## How the limit works Each account is limited to **200 requests per minute** by default, on a rolling **1-minute** window. The limit is enforced **per account, not per API key**. All of an account's keys draw from the same budget, so creating extra keys does not raise your ceiling. It only helps you organize and revoke access. | | | | - | - | | **Limit** | 200 requests / minute (default) | | **Scope** | Per account (shared across all API keys) | | **Window** | Rolling 1 minute | | **On exceed** | `429 Too Many Requests` | > [!NOTE] > > Higher limits are available on some plans and on request. Contact support to > raise your account's limit. ## Response headers Lookup responses carry the current state of your limit, so you can pace requests without guessing. `/api/account/*` and `/api/health` responses do not carry rate-limit headers. 429 responses don't include `Retry-After`. | Header | Meaning | Example | | - | - | - | | `X-Ratelimit-Limit` | Maximum requests allowed per window | `200` | | `X-Ratelimit-Remaining` | Requests remaining in the current window | `173` | | `X-Ratelimit-Reset` | Seconds until the window resets | `32` | ## When you exceed the limit Over the limit, the API responds with `429 Too Many Requests` and this body: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "error": "Rate limit exceeded. Please try again later." } ``` Inspect the headers on any response with `curl -i`: ```bash theme={"theme":{"light":"github-light","dark":"vesper"}} curl -i -X POST "https://developer.encrata.com/api/lookup/email/validity" \ -H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{"email": "satya@microsoft.com"}' ``` A successful response reports the current limit state: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} HTTP/1.1 200 OK Content-Type: application/json X-Ratelimit-Limit: 200 X-Ratelimit-Remaining: 173 X-Ratelimit-Reset: 32 ``` Once the budget is spent, the same request returns a `429`. Use `X-Ratelimit-Reset` to time your retry: ```http theme={"theme":{"light":"github-light","dark":"vesper"}} HTTP/1.1 429 Too Many Requests Content-Type: application/json X-Ratelimit-Limit: 200 X-Ratelimit-Remaining: 0 X-Ratelimit-Reset: 12 {"error": "Rate limit exceeded. Please try again later."} ``` ## Retry safely When you get a `429`, wait `X-Ratelimit-Reset` seconds, then retry. If the header is missing, fall back to exponential backoff. Cap the number of attempts so a client never loops forever: ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import time import requests def lookup_with_retry(email, api_key, max_retries=3): url = "https://developer.encrata.com/api/lookup/email/validity" headers = {"Authorization": f"Bearer {api_key}"} for attempt in range(max_retries): resp = requests.post(url, headers=headers, json={"email": email}) if resp.status_code == 429: retry_after = int(resp.headers.get("X-Ratelimit-Reset", 2 ** attempt)) time.sleep(retry_after) continue return resp.json() raise Exception("Max retries exceeded") ``` ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vesper"}} async function lookupWithRetry(email, apiKey, maxRetries = 3) { const url = "https://developer.encrata.com/api/lookup/email/validity"; for (let attempt = 0; attempt < maxRetries; attempt++) { const resp = await fetch(url, { method: "POST", headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }, body: JSON.stringify({ email: email }), }); if (resp.status === 429) { const retryAfter = parseInt(resp.headers.get("X-Ratelimit-Reset") || 2 ** attempt, 10); await new Promise((r) => setTimeout(r, retryAfter * 1000)); continue; } return resp.json(); } throw new Error("Max retries exceeded"); } ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} func lookupWithRetry(email, apiKey string, maxRetries int) (map[string]interface{}, error) { url := "https://developer.encrata.com/api/lookup/email/validity" for attempt := 0; attempt < maxRetries; attempt++ { body, _ := json.Marshal(map[string]string{"email": email}) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body)) req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode == 429 { retryAfter, _ := strconv.Atoi(resp.Header.Get("X-Ratelimit-Reset")) if retryAfter == 0 { retryAfter = 1 << attempt } time.Sleep(time.Duration(retryAfter) * time.Second) continue } var result map[string]interface{} json.NewDecoder(resp.Body).Decode(&result) return result, nil } return nil, fmt.Errorf("max retries exceeded") } ``` ## Best practices > [card] Honor X-Ratelimit-Reset > > Wait the `X-Ratelimit-Reset` seconds before retrying, instead of a fixed delay. > [card] Spread requests > > Distribute calls evenly across the window rather than bursting. > [card] Use bulk endpoints > > For high-volume lookups, batch with bulk endpoints instead of single calls. > [card] Watch remaining > > Slow down when `X-Ratelimit-Remaining` gets low, before you hit `429`. ## Next steps * [Errors](/errors): Every status code and how to recover from it. * [Bulk operations](/guides/bulk-operations): Process large volumes without hitting per-request limits. # Webhooks Source: https://docs.encrata.com/webhooks Receive real-time notifications when events happen in your Encrata workspace. ## Overview Webhooks let you receive HTTP callbacks when specific events occur in your workspace like a lookup completing or an API key being created. Instead of polling the API, Encrata pushes event data directly to your server. ## How it works 1. You register a webhook URL on the dashboard (**Settings → Webhooks**) or with [`POST /api/webhooks`](/api-reference/endpoint/create-webhook). 2. When a subscribed event occurs, Encrata sends a `POST` request to your URL with a JSON payload. 3. Each delivery is signed with HMAC-SHA256 so you can verify it came from Encrata. ## Destination types Set `kind` when you create a webhook. The default, `generic`, is the only one your application can verify and parse. | Kind | Receives | Signed | | - | - | - | | `generic` | The raw `{event, data, created_at}` JSON envelope | Yes, `X-Encrata-Signature` | | `slack` | `{"text": "..."}` posted to a Slack incoming webhook | No | | `discord` | `{"content": "..."}` posted to a Discord webhook | No | | `telegram` | A Bot API `sendMessage` call | No | > [!NOTE] > > Chat destinations get a short human-readable summary, not the JSON envelope, and they carry no signature. Everything below about payloads and verification applies to `generic` webhooks. ## Supported events | Event | Trigger | | - | - | | `lookup.completed` | An email lookup finishes processing | | `bulk.completed` | A bulk job finishes processing | | `apikey.created` | A new API key is created | | `apikey.revoked` | An API key is revoked | | `credits.low` | Workspace credits drop below threshold | | `credits.exhausted` | Workspace credits are fully consumed | | `monitor.run.completed` | A monitor run finishes and detected at least one change | | `monitor.alert.high_value` | A monitor run surfaced one or more high-value alerts | ## Payload format Every webhook delivery sends a JSON payload in the following shape: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "event": "lookup.completed", "data": { "email": "satya@microsoft.com", "lookup_id": "lu_abc123" }, "created_at": "2026-05-02T12:00:00Z" } ``` A `bulk.completed` event reports the finished job. When the job was created with `download_link=true`, the payload also carries a `download_url` you can fetch with your API key to get the result file (see [Bulk Operations](/guides/bulk-operations)): ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "event": "bulk.completed", "data": { "job_id": "a1b2c3d4-0000-0000-0000-000000000000", "kind": "gender", "status": "completed", "processed": 5000, "total": 5000, "download_url": "https://developer.encrata.com/api/jobs/exports/download?kind=gender&id=a1b2c3d4-0000-0000-0000-000000000000&format=csv&filter=all" }, "created_at": "2026-05-02T12:00:00Z" } ``` A `monitor.run.completed` event fires when a monitor run detects at least one change. A `monitor.alert.high_value` event fires separately when a run surfaces high-value alerts, and carries the list under `alerts`: ```json theme={"theme":{"light":"github-light","dark":"vesper"}} { "event": "monitor.run.completed", "data": { "monitor_id": "m_abc123", "monitor_name": "Competitor hires", "run_id": "run_def456", "total_records": 100, "changes_detected": 3, "credits_used": 3 }, "created_at": "2026-05-02T12:00:00Z" } ``` ## Verifying signatures Each delivery to a `generic` endpoint includes these headers: | Header | Value | | - | - | | `X-Encrata-Signature` | HMAC-SHA256 hex digest of the raw request body, keyed with your webhook secret | | `X-Encrata-Event` | The event type in this delivery, for example `lookup.completed` | | `User-Agent` | `Encrata-Webhooks/1.0` | Compute the digest over the **raw bytes** of the body. Parsing and re-serializing the JSON changes the bytes and the signature will not match. Use the whole signing secret, including the `whsec_` prefix, as the HMAC key. To verify: ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}} import hmac, hashlib def verify_signature(payload: bytes, secret: str, signature: str) -> bool: expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature) ``` ```javascript Node.js theme={"theme":{"light":"github-light","dark":"vesper"}} const crypto = require("crypto"); function verifySignature(payload, secret, signature) { const expected = crypto .createHmac("sha256", secret) .update(payload) .digest("hex"); return crypto.timingSafeEqual( Buffer.from(expected), Buffer.from(signature) ); } ``` ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}} import ( "crypto/hmac" "crypto/sha256" "encoding/hex" ) func VerifySignature(payload []byte, secret, signature string) bool { mac := hmac.New(sha256.New, []byte(secret)) mac.Write(payload) expected := hex.EncodeToString(mac.Sum(nil)) return hmac.Equal([]byte(expected), []byte(signature)) } ``` > [!WARNING] > > Always verify signatures before processing webhook payloads. Never trust unverified requests. ## Replay and duplicates Webhook deliveries do not include a timestamp header or delivery ID header. Encrata can retry a delivery, so your handler must tolerate duplicate event payloads. Verify the signature, acknowledge quickly, and make downstream work idempotent using identifiers in the event data when available. ## Receiver example A complete endpoint that verifies the signature, acknowledges fast, then routes each event. It reads the raw body so the HMAC matches byte-for-byte. ```javascript Node.js (Express) theme={"theme":{"light":"github-light","dark":"vesper"}} const express = require("express"); const crypto = require("crypto"); const app = express(); const WEBHOOK_SECRET = process.env.ENCRATA_WEBHOOK_SECRET; app.post("/webhooks/encrata", express.raw({ type: "application/json" }), (req, res) => { const signature = req.headers["x-encrata-signature"] || ""; const expected = crypto .createHmac("sha256", WEBHOOK_SECRET) .update(req.body) .digest("hex"); if ( signature.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)) ) { return res.status(401).send("Invalid signature"); } // Acknowledge fast, then do the work. res.sendStatus(200); const { event, data } = JSON.parse(req.body); switch (event) { case "lookup.completed": console.log(`Lookup ready for ${data.email}`); break; case "bulk.completed": // data.download_url is present when the job was created with download_link=true console.log(`Bulk ${data.kind} job ${data.job_id} finished: ${data.processed}/${data.total}`); break; case "apikey.created": case "apikey.revoked": console.log(`API key event: ${event}`); break; case "credits.low": console.warn("Workspace credits are running low."); break; case "credits.exhausted": console.error("Workspace credits exhausted. Top up to resume lookups."); break; case "monitor.run.completed": console.log(`Monitor ${data.monitor_name}: ${data.changes_detected} change(s) detected`); break; case "monitor.alert.high_value": console.warn(`Monitor ${data.monitor_name}: ${data.alert_count} high-value alert(s)`); break; } }); app.listen(3000); ``` ## Delivery and retries * Webhook URLs must use HTTPS and must resolve to a public address. Private, loopback, and link-local addresses are rejected at creation. * Encrata waits **10 seconds** for each attempt. Return a `2xx` status before then, and do your slow work after acknowledging. * A delivery gets **4 attempts** in total. | Attempt | Delay before it runs | | - | - | | 1 | Immediate | | 2 | 30 seconds | | 3 | 2 minutes | | 4 | 10 minutes | If your endpoint returns a `Retry-After` header asking for longer, Encrata honours it up to 15 minutes. After the fourth attempt the delivery is marked `failed` and is not retried. Check what actually happened with [list deliveries](/api-reference/endpoint/webhook-deliveries). ## Managing webhooks Manage webhooks from the dashboard (**Settings → Webhooks**) or through the API: | Action | Method | Endpoint | Role | | - | - | - | - | | [List webhooks](/api-reference/endpoint/webhook) | `GET` | `/api/webhooks` | Any | | [Get webhook](/api-reference/endpoint/get-webhook) | `GET` | `/api/webhooks/{id}` | Any (secret returned to `admin` only) | | [Create webhook](/api-reference/endpoint/create-webhook) | `POST` | `/api/webhooks` | `admin`, `tech` | | [Update webhook](/api-reference/endpoint/update-webhook) | `PUT` | `/api/webhooks` | `admin`, `tech` | | [Delete webhook](/api-reference/endpoint/delete-webhook) | `DELETE` | `/api/webhooks/{id}` | `admin`, `tech` | | [Test webhook](/api-reference/endpoint/test-webhook) | `POST` | `/api/webhooks/test` | `admin`, `tech` | | [List deliveries](/api-reference/endpoint/webhook-deliveries) | `GET` | `/api/webhooks/deliveries?webhook_id={id}` | Any | > [!NOTE] > > Your signing secret is returned when you create a `generic` webhook. A workspace admin can read it again with [`GET /api/webhooks/{id}`](/api-reference/endpoint/get-webhook). It is never included in the list response. ## Next steps * [Create a webhook](/api-reference/endpoint/create-webhook): Register an endpoint and get its signing secret. * [Test your endpoint](/api-reference/endpoint/test-webhook): Send a synthetic event and read the response. * [Debug deliveries](/api-reference/endpoint/webhook-deliveries): Inspect the last 50 attempts for any webhook. * [Bulk operations](/guides/bulk-operations): Use `bulk.completed` to collect finished jobs.