{"openapi":"3.1.0","info":{"title":"SecureVoice — customer integration contract","version":"2026-10-01","summary":"Inbound risk signals, outbound bank events, and a self-serve conformance checker.","description":"## What this API is\n\nSecureVoice sits DOWNSTREAM of a bank's fraud engine. It dials the customer to verify a suspicious transaction and reports what happened.\n\n## What it is not — read this before integrating\n\n- It does **not** terminate ISO 8583 or ISO 20022. If your core banking speaks only those, this is not a replacement for your authorisation switch; it is fed by it.\n- It does **not** approve or decline transactions. A 202 is an accepted verification attempt, not a decision. A staged freeze is not a blocked card.\n- It carries **no sub-100 ms authorisation SLA**, and cannot. The call is placed by a worker from a durable queue after a policy gate, an abuse gate and admission control. Do not put a card authorisation on this path.\n- It carries **no account numbers or balances**, in or out. The ingest schema is strict, so sending them is a 422.\n\n## Discovery\n\n- This document: `GET /openapi` (canonical; there is no second copy)\n- Webhook surface: `GET /asyncapi` (AsyncAPI 2026-10-01)\n- Contract, tiers and runbook: `docs/INTEGRATION-CONTRACT.md`\n- Self-serve conformance check: `POST /v1/conformance/run`\n\n## Versioning\n\nEnvelope version is `2026-10-01`. Within a version, no field is removed, renamed or retyped; new optional fields may appear, so a receiver MUST ignore unknown fields in an EVENT (unlike the ingest, which rejects them). A breaking change requires a new `schema_version`, published in this document alongside a migration note.","contact":{"name":"SecureVoice integration support","url":"https://securevoiceai.me"},"license":{"name":"Proprietary"}},"servers":[{"url":"https://voice.example.com","description":"Public deployment. The documented ingest path is /v1/interventions; the application path /api/v1/interventions is live and equivalent (next.config.ts rewrites the former onto the latter). Do not hardcode either — resolve it from this document."}],"tags":[{"name":"ingest","description":"Bank → SecureVoice. Risk signals that arm a verification call."},{"name":"conformance","description":"Self-serve grading of YOUR receiver against this contract."},{"name":"meta","description":"Machine-readable descriptions of this contract."}],"paths":{"/v1/interventions":{"post":{"operationId":"createIntervention","summary":"Submit a risk signal for verification-by-conversation","description":"The canonical bank-facing ingest. The bank's fraud engine POSTs a signed risk signal; SecureVoice runs a deterministic policy gate, an abuse gate and admission control, then places a verification call through the durable dial queue.\n\n**Scope boundary.** SecureVoice is DOWNSTREAM of the fraud engine. It does not terminate ISO 8583 or ISO 20022, it does not approve or decline anything, and it carries no sub-100 ms authorisation SLA. The 202 below means ACCEPTED FOR A VERIFICATION ATTEMPT, nothing else.\n\n**Latency.** The critical path is one database round-trip plus a queue enqueue; the carrier call is placed later by a worker. The response is not a \"customer contacted\" signal. Do not treat 202 as contact made, and do not build a sub-100ms authorisation path on this endpoint. See docs/INTEGRATION-CONTRACT.md.","tags":["ingest"],"security":[{"SvSignature":[]},{"ProducerKey":[]}],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"description":"The signed risk signal. Sign the EXACT bytes you transmit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskSignal"}}}},"responses":{"202":{"description":"Accepted. Also returned for a replay of an already-stored idempotency-key (see InterventionReplay202).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterventionReplay202"}}},"headers":{"X-Idempotent-Replay":{"description":"Present and \"true\" only on a replay.","schema":{"type":"string"}}}},"400":{"description":"The request could not be used as sent. Two causes: the body is not parseable JSON, or the mandatory `Idempotency-Key` header is absent or shorter than 8 characters. The `message` names which.\n\nRetryable: false. Remediation: Send a JSON object and a stable `Idempotency-Key` of at least 8 characters. Retries MUST reuse the same key — a fresh key per retry creates a second case and a second call.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"malformed_request","message":"The request could not be used as sent. Two causes: the body is not parseable JSON, or the mandatory `Idempotency-Key` header is absent or shorter than 8 characters. The `message` names which.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/malformed_request"}}}},"401":{"description":"No acceptable credential. Either a `Bearer svb_…` producer key that is unknown, revoked or expired, or an `SV-Signature` that is missing, malformed, outside the 300 s window, or a digest mismatch. Deliberately one code for all of them: distinguishing them turns the endpoint into an oracle for which secret you hold.\n\nRetryable: false. Remediation: Sign the EXACT bytes you transmit — capture the raw body, never a re-serialised object — and sync your clock to NTP. A digest mismatch with an apparently correct signature is almost always re-serialisation. Quote `requestId` from the body if you need to raise a ticket.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"unauthenticated","message":"No acceptable credential. Either a `Bearer svb_…` producer key that is unknown, revoked or expired, or an `SV-Signature` that is missing, malformed, outside the 300 s window, or a digest mismatch. Deliberately one code for all of them: distinguishing them turns the endpoint into an oracle for which secret you hold.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/unauthenticated"}}}},"409":{"description":"The signal was refused by a policy or a guardrail: the customer has opted out, the destination country is not allowed, the org is at its concurrency cap or spend ceiling, the destination is in cooldown, the velocity breaker has paused the org, or its subscription is paused. An empty prepaid balance is NOT this code — it is `payment_required` (402), because that is the one refusal the caller can clear by paying. The specific cause is the `gate_*` / `abuse_*` row whose literal appears in `message`.\n\nRetryable: false. Remediation: Do NOT blind-retry: most policy refusals (consent, geography) must never be retried. The cause is named in `message` and is the value to branch on after reading it. For the transient causes — cooldown, concurrency caps, spend ceiling — a delayed retry is correct.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"policy_precondition","message":"The signal was refused by a policy or a guardrail: the customer has opted out, the destination country is not allowed, the org is at its concurrency cap or spend ceiling, the destination is in cooldown, the velocity breaker has paused the org, or its subscription is paused. An empty prepaid balance is NOT this code — it is `payment_required` (402), because that is the one refusal the caller can clear by paying. The specific cause is the `gate_*` / `abuse_*` row whose literal appears in `message`.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/policy_precondition"}}}},"422":{"description":"Well-formed JSON that failed validation: a field bound was violated, an undeclared field was present (the schema is `.strict()`), or `callback_url` was refused by the outbound-URL policy. The `message` names the first offending field.\n\nRetryable: false. Remediation: Read `message`, fix the named field, re-send. Do not retry unchanged. NOTE: this ingest does not distinguish an unknown field from any other validation failure — `unknown_field` is emitted only by the legacy tool endpoints below. See `docs/INTEGRATION-CONTRACT.md` for the full field table.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"semantically_invalid","message":"Well-formed JSON that failed validation: a field bound was violated, an undeclared field was present (the schema is `.strict()`), or `callback_url` was refused by the outbound-URL policy. The `message` names the first offending field.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/semantically_invalid"}}}},"429":{"description":"The per-caller budget is spent. Carries `Retry-After` (the ingest computes it from the token bucket; the conformance endpoint clamps it into 1–3600 s).\n\nRetryable: true. Remediation: Honour `Retry-After` and retry with jitter. Never in a tight loop — it is your fraud engine's traffic pattern we are bounding.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. Present on rate_limited (429) and dependency_unavailable (503).","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"rate_limited","message":"The per-caller budget is spent. Carries `Retry-After` (the ingest computes it from the token bucket; the conformance endpoint clamps it into 1–3600 s).","retryable":true,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/rate_limited"}}}},"503":{"description":"A required dependency failed while the case was being armed: the database, the durable dial queue, or a voice-provider call. Also the class used when a typed gate refusal carried a 5xx status. Carries `Retry-After`.\n\nRetryable: true. Remediation: Retry with backoff. Because the idempotency key is stored only after a successful arm, a retried signal either creates one case or replays the stored one — never two. Quote `requestId` if it persists.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. Present on rate_limited (429) and dependency_unavailable (503).","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"dependency_unavailable","message":"A required dependency failed while the case was being armed: the database, the durable dial queue, or a voice-provider call. Also the class used when a typed gate refusal carried a 5xx status. Carries `Retry-After`.","retryable":true,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/dependency_unavailable"}}}}},"x-error-codes":["malformed_request","unauthenticated","policy_precondition","semantically_invalid","rate_limited","dependency_unavailable"],"x-error-causes":["consent_opted_out","consent_invalid","country_unparseable","country_not_allowed","transaction_repeat","do_not_call","outside_calling_hours","idempotent_request_in_flight","invalid_call_category","redaction_mismatch","prayer_time","spend_ceiling","credits_exhausted","subscription_paused","pilot_daily_cap_reached","pilot_signal_kind_out_of_scope","pilot_cap_misconfigured","invalid_e164","country_unresolvable","geo_allowlist_unconfigured","geo_allowlist_misconfigured","country_denied","destination_prefix_denied","demo_tier_requires_test_number","test_number_list_empty","org_auto_paused","velocity_new_prefix_burst","velocity_burst_rate","velocity_after_hours","destination_cooldown","org_concurrency_cap","global_concurrency_cap","guard_internal_error","malformed_url","not_https","credentials_in_url","blocked_port","blocked_hostname","dns_failed","no_addresses","private_address","redirect_blocked","too_many_redirects"]},"get":{"operationId":"describeInterventions","summary":"Producer discovery document","description":"The same discovery document the implementation serves at this path: endpoint, the two accepted auth schemes, the idempotency rule and the field list. Served for humans; this OpenAPI document is the machine-readable form.","tags":["ingest"],"security":[],"responses":{"200":{"description":"Discovery document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/api/interventions":{"post":{"operationId":"createInterventionRetired","summary":"RETIRED — returns 410 and arms nothing","description":"This endpoint used to be a second, ungated ingest. It is retired: it arms no call, creates no case, runs no policy or abuse gate and records no billing. It answers 410 with `endpoint_retired`, the successor path and the list of behavioural changes so a producer can migrate deliberately.\n\nThe authentication, rate-limit and callback-SSRF checks are retained so an unauthenticated caller still gets 401 rather than a map of the platform, and so the migration notice is the first thing a correctly authenticated producer sees.","tags":["ingest"],"security":[{"SvSignature":[]},{"ProducerKey":[]}],"responses":{"400":{"description":"The retired endpoint's 400: the body did not parse as JSON.\n\nRetryable: false. Remediation: Send a JSON object, and sign the same bytes you transmit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"},"example":{"error":"Invalid JSON body"}}}},"401":{"description":"The `Authorization: Bearer svb_…` key is unknown, revoked or expired.\n\nRetryable: false. Remediation: Mint a new key in the console. Revocation is immediate and deliberate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"},"example":{"error":"Invalid or revoked producer key"}}}},"410":{"description":"`POST /api/interventions` is retired and arms nothing: no policy gate, no abuse gate, no Case row, no billing, and the carrier call used to happen inside the request. It answers with the successor path and the list of behavioural changes so a producer can migrate deliberately rather than guess.\n\nRetryable: false. Remediation: Move to /v1/interventions: integer minor units, E.164 phone, required consent_record_id, required Idempotency-Key, and a /v1/interventions error envelope ({ code, message, retryable, requestId, docsUrl }) instead of { error }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"},"example":{"error":"`POST /api/interventions` is retired and arms nothing: no policy gate, no abuse gate, no Case row, no billing, and the carrier call used to happen inside the request. It answers with the successor path and the list of behavioural changes so a producer can migrate deliberately rather than guess.","code":"endpoint_retired","successor":"/v1/interventions"}}}},"422":{"description":"The retired endpoint's 422. NOTE it returns `{ error }` with NO `code` field even for a validation failure — the one place where a bank gets no machine-readable reason at all.\n\nRetryable: false. Remediation: Read the prose, then migrate to /v1/interventions for `code: semantically_invalid`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"},"example":{"error":"Invalid signal:"}}}},"429":{"description":"The retired endpoint's 429, with a `Retry-After` header and no code in the body.\n\nRetryable: true. Remediation: Honour Retry-After, then migrate: the canonical ingest returns `code: rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyError"},"example":{"error":"Rate limit exceeded; retry later."}}}}},"x-migration":["integer minor units for `amount`; `amountAed` is not accepted","E.164 `phone`; `customer.ref`/`customer.lang` nested objects are not accepted","`consent_record_id` is required (it was optional on the nested shape)","`Idempotency-Key` is required","`amount` must be an integer; the retired endpoint accepted a float `amountAed`","errors move from `{ error }` to `{ code, message, retryable, requestId, docsUrl }`"]}},"/v1/conformance/run":{"post":{"operationId":"runConformance","summary":"Grade a bank receiver against this contract","description":"Fires five signed probes at a receiver you nominate and grades the answers. Attach the returned report to your change record.\n\nGraded checks: signature_verified, idempotency_honoured, fast_2xx, replay_handled, rejects_malformed.\n\n**200 means the RUN succeeded, not that you passed** — read `score.verdict`. A failing grade is a successful run and a `non_conforming` verdict.\n\nRequires a producer key (`Authorization: Bearer svb_…`): an unauthenticated caller must not be able to make our deployment POST to an arbitrary URL.\n\nThe target is validated by SSRF verdict before anything is dialled; a blocked target returns 422 and issues zero probes.","tags":["conformance"],"security":[{"ProducerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConformanceRunRequest"}}}},"responses":{"200":{"description":"The run completed. Grade it in `score.verdict` — 200 means the RUN succeeded, not that the receiver passed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConformanceReport"}}}},"400":{"description":"The request could not be used as sent. Two causes: the body is not parseable JSON, or the mandatory `Idempotency-Key` header is absent or shorter than 8 characters. The `message` names which.\n\nRetryable: false. Remediation: Send a JSON object and a stable `Idempotency-Key` of at least 8 characters. Retries MUST reuse the same key — a fresh key per retry creates a second case and a second call.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"malformed_request","message":"The request could not be used as sent. Two causes: the body is not parseable JSON, or the mandatory `Idempotency-Key` header is absent or shorter than 8 characters. The `message` names which.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/malformed_request"}}}},"401":{"description":"No acceptable credential. Either a `Bearer svb_…` producer key that is unknown, revoked or expired, or an `SV-Signature` that is missing, malformed, outside the 300 s window, or a digest mismatch. Deliberately one code for all of them: distinguishing them turns the endpoint into an oracle for which secret you hold.\n\nRetryable: false. Remediation: Sign the EXACT bytes you transmit — capture the raw body, never a re-serialised object — and sync your clock to NTP. A digest mismatch with an apparently correct signature is almost always re-serialisation. Quote `requestId` from the body if you need to raise a ticket.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"unauthenticated","message":"No acceptable credential. Either a `Bearer svb_…` producer key that is unknown, revoked or expired, or an `SV-Signature` that is missing, malformed, outside the 300 s window, or a digest mismatch. Deliberately one code for all of them: distinguishing them turns the endpoint into an oracle for which secret you hold.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/unauthenticated"}}}},"422":{"description":"Well-formed JSON that failed validation: a field bound was violated, an undeclared field was present (the schema is `.strict()`), or `callback_url` was refused by the outbound-URL policy. The `message` names the first offending field.\n\nRetryable: false. Remediation: Read `message`, fix the named field, re-send. Do not retry unchanged. NOTE: this ingest does not distinguish an unknown field from any other validation failure — `unknown_field` is emitted only by the legacy tool endpoints below. See `docs/INTEGRATION-CONTRACT.md` for the full field table.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"semantically_invalid","message":"Well-formed JSON that failed validation: a field bound was violated, an undeclared field was present (the schema is `.strict()`), or `callback_url` was refused by the outbound-URL policy. The `message` names the first offending field.","retryable":false,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/semantically_invalid"}}}},"429":{"description":"The per-caller budget is spent. Carries `Retry-After` (the ingest computes it from the token bucket; the conformance endpoint clamps it into 1–3600 s).\n\nRetryable: true. Remediation: Honour `Retry-After` and retry with jitter. Never in a tight loop — it is your fraud engine's traffic pattern we are bounding.","headers":{"x-request-id":{"description":"Correlation id; equals the body's `requestId`.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait. Present on rate_limited (429) and dependency_unavailable (503).","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailureEnvelope"},"example":{"code":"rate_limited","message":"The per-caller budget is spent. Carries `Retry-After` (the ingest computes it from the token bucket; the conformance endpoint clamps it into 1–3600 s).","retryable":true,"requestId":"req_01HQ8Z7V3M9K2R4T6Y8W0X2B4D","docsUrl":"https://securevoiceai.me/docs/errors/rate_limited"}}}}}}},"/openapi":{"get":{"operationId":"getOpenApi","summary":"This document","description":"Generated from src/lib/contracts/schema.ts, which is transcribed from the real code paths. tests/contracts fails if the code and the contract diverge, so this document cannot quietly go stale.","tags":["meta"],"security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/asyncapi":{"get":{"operationId":"getAsyncApi","summary":"The outbound webhook surface, as AsyncAPI","description":"Everything SecureVoice POSTs to a bank: the envelope, the only emitted event type, the signature scheme and the retry ladder.","tags":["meta"],"security":[],"responses":{"200":{"description":"AsyncAPI 3.0 document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}}},"components":{"securitySchemes":{"SvSignature":{"type":"apiKey","in":"header","name":"SV-Signature","description":"**HMAC-SHA256** over `{t}.{raw_request_body}`.\n\nGrammar: `SV-Signature: t={unix_seconds},v1={hex64}` (inbound: `t={10 digits},v1={64 lowercase hex}`).\nSecret: `WEBHOOK_SECRET`, shared out of band.\nReplay window: 300s in both directions — a timestamp from the future is refused too.\nAccepted header names: sv-signature, SV-Signature, x-securevoice-signature.\nComparison: constant-time (timingSafeEqual / hmac.compare_digest).\n\nINBOUND sign the exact bytes you send (capture the raw body; re-serialising JSON changes the bytes and breaks the digest). OUTBOUND our body is already canonical.\n\nReference implementations: scripts/verify_sv_signature.ts (TypeScript / Bun); scripts/verify_sv_signature.py (Python 3); scripts/verify-signatures/SignatureVerifier.java (Java 8+); src/app/api/webhooks/receiver/route.ts (the hosted reference receiver)."},"ProducerKey":{"type":"http","scheme":"bearer","bearerFormat":"svb_producer_key","description":"**Alternative** to SvSignature, not an addition: if the `Authorization` header starts with `Bearer svb_` the signature check is skipped entirely.\n\nSource: src/lib/producer-keys.ts verifyProducerKey.\na producer key is org-scoped, so its orgId wins for tenancy over an org_id in the payload; it is revocable per team without rotating the global secret.\n\nPrefer a producer key over the shared secret for anything beyond a first integration: revocation is per team."}},"parameters":{"IdempotencyKey":{"name":"idempotency-key","in":"header","required":true,"description":"**Required.** At least 8 characters; longer is better.\n\nRetries of the same logical transaction MUST reuse the key. The platform hashes it with the caller id and stores the response for 24h: a replay returns the stored 202 with `duplicate: true` and the `X-Idempotent-Replay: true` header, and creates nothing — no second case, no second call, no second charge.\n\nA producer that mints a fresh key on every retry gets a fresh case each time. That is the most common integration bug on this endpoint.","schema":{"type":"string","minLength":8,"maxLength":255},"example":"idem-2026-10-02-FRAUD-08612"}},"schemas":{"RiskSignal":{"type":"object","properties":{"transaction_ref":{"type":"string","description":"The bank's own transaction reference. Stored on the Case and echoed in every outbound event; it is the join key between the bank's alert and the case. It is an opaque reference, NOT an account number.","minLength":3,"maxLength":64,"examples":["FRAUD-2026-08612"]},"risk_score":{"type":"number","description":"The fraud engine's score, normalised to 0“1. Used for queue priority (triage) and for the admission control decision. It is NOT a decision: SecureVoice never approves or declines on it.","minimum":0,"maximum":1,"examples":[0.94]},"language":{"type":"string","description":"BCP-47 language tag for the outbound call. The route comment names en, ar, hi; the value is passed to the voice provider, which is what bounds it in practice.","minLength":2,"maxLength":7,"examples":["ar"]},"phone":{"type":"string","description":"Destination in E.164 (+971501234567). Also the input to the geography control, so an invalid or non-routable number is refused before any carrier is contacted.","pattern":"^\\+[1-9]\\d{1,14}$","examples":["+971501234567"]},"currency":{"type":"string","description":"ISO-4217 alphabetic code for the minor units in `amount`.","pattern":"^[A-Z]{3}$","examples":["AED"]},"amount":{"type":"integer","description":"Transaction amount in MINOR UNITS (fils, cents) as an integer — 2500 means 25.00 AED. An integer is mandatory: a float here is a rounding bug waiting to happen, and money is not reconstructed from it downstream.","minimum":0,"examples":[2500]},"consent_record_id":{"type":"string","description":"The bank's consent record permitting outbound contact for this customer. Mandatory: without it the policy gate refuses the signal (consent_invalid). A customer who has opted out is refused with 409 consent_opted_out and is never dialled.","minLength":4,"maxLength":64,"examples":["CN-2026-04-1183"]},"merchant":{"type":"string","description":"Merchant descriptor, spoken to the customer in the call. Sanitised (sanitizeUntrusted) before it becomes a dynamic variable, and never an authorisation input.","maxLength":120,"examples":["Electronics World"]},"signal_kind":{"type":"string","description":"What kind of risk signal this is. Optional: when absent the call is worded for a card transaction. Insurers send `claim_payout` (a payout redirected to a new account) or `policy_change` (beneficiary / surrender request); both institution types may send `account_takeover`. Only changes how the case is described to the customer - the protective step is still a staged hold a human confirms.","enum":["card_transaction","claim_payout","policy_change","account_takeover"],"examples":["claim_payout"]},"call_category":{"type":"string","description":"WHY the institution is calling — the Dynamic Prompt Router's selector (src/lib/call-categories.ts). It picks the agent's system prompt and the backend preconditions: routine calls are refused outside the permitted calling window and for do-not-call numbers; the do-not-call registry blocks every non-critical category; a b2b call can only ever produce a recommendation for human sign-off. Absent reads as time_critical_fraud — the audited fraud-intervention behaviour — so legacy producers keep exactly the call they get today.","enum":["fact_finding","sensitive_case","b2b","routine","time_critical_fraud"],"examples":["time_critical_fraud"]},"ref_last4":{"type":"string","description":"Last four digits of the card, policy or account reference (named `ref_`, not `card_`: the inbound schema deliberately has no field that reads as an account identifier). Optional. Lets the customer recognise the fallback SMS, which deliberately carries NO merchant and NO amount. Exactly four digits - never a longer number: the platform must not hold a PAN.","pattern":"^\\d{4}$","examples":["4242"]},"callback_url":{"type":"string","description":"Optional per-signal HTTPS destination for post-call outcome delivery. Validated by SSRF verdict, not by string pattern: the name must RESOLVE to a public address, port 443 only, no credentials, and every redirect hop is re-validated. Private, loopback, link-local and cloud-metadata targets are refused with 422.","format":"uri","maxLength":300,"examples":["https://bank.example.com/hooks/securevoice"]},"org_id":{"type":"string","description":"Tenant scope for HMAC-authenticated producers. Ignored when a producer key is used — the key's orgId wins.","minLength":2,"maxLength":64,"examples":["bank-core-uae"]},"hearing_impaired":{"type":"boolean","description":"Deaf / hard-of-hearing flag for the customer. When true, voice is skipped ENTIRELY — no dial job is enqueued — and the case goes straight to the blind-ping SMS flow (YES / NO reply, 24h window). Absent reads as false, so every existing producer keeps byte-identical behavior.","examples":[true]}},"required":["transaction_ref","risk_score","language","phone","currency","amount","consent_record_id"],"additionalProperties":false,"title":"RiskSignal","description":"The inbound signal. STRICT: an undeclared field is rejected with 422, not ignored. Money is an integer in minor units; phone is E.164; currency is ISO-4217; language is BCP-47.","x-data-minimisation":{"sent":["transaction_ref — the bank's own opaque reference (never an account number)","case_ref — platform case reference, the join key","risk_score — 0“1, used for triage","language, currency, amount (minor units), merchant descriptor","phone — E.164, required to place the call; returned to the caller only redacted","consent_record_id — required for outbound contact","post-call verdict, duration, staged-freeze and handoff flags, audit reference"],"neverSent":["account numbers, IBANs, card PANs or track data","balances, available credit, or any account state","the transaction's counterparty bank account or settlement details","transcript content, verbatim or redacted","recording URLs or audio","date of birth, address, email, document numbers, or any other customer PII","the webhook secret or any signing material","the unmasked destination phone number (only a redacted form is echoed)"],"rationale":"SecureVoice is a verification-by-conversation surface, not a ledger. It never needs an account number to call someone, so it never accepts one: the ingest schema is .strict() and an unknown field is refused, which turns 'do not send PII' from a policy into a rejection."}},"InterventionQueued202":{"type":"object","properties":{"ok":{"type":"boolean","description":"Always true on 202.","examples":[true]},"caseRef":{"type":"string","description":"Case reference, SV-F-XXXXXX (Crockford-ish alphabet without I/L/O/U). The join key for every downstream stage and the handle to quote in a ticket.","examples":["SV-F-7K2M9Q"]},"transactionRef":{"type":"string","description":"Echo of the submitted transaction_ref, so a producer can correlate without state.","examples":["FRAUD-2026-08612"]},"status":{"type":"string","description":"`queued`, NOT `dialing`: the request handler enqueues a durable job and returns. A bank that sees `dialing` here would be told a carrier call exists before it does.","enum":["queued"],"examples":["queued"]},"jobId":{"type":"string","description":"Durable dial-job id. The worker claims this; a queue drain is visible by id."},"language":{"type":"string","description":"Echo of the submitted language.","examples":["ar"]},"riskScore":{"type":"number","description":"Echo of the submitted risk_score.","examples":[0.94]},"delivery":{"type":"object","description":"How the call was dispatched. Never a carrier call made inside the request."},"receivedAt":{"type":"string","description":"ISO-8601 instant the case was armed.","format":"date-time"}},"required":["ok","caseRef","transactionRef","status","jobId","language","riskScore","delivery","receivedAt"],"title":"InterventionQueued202","description":"Accepted and durably QUEUED. The call is placed by a worker, not by this request — see the latency notes in docs/INTEGRATION-CONTRACT.md."},"Delivery":{"type":"object","properties":{"channel":{"type":"string","description":"Dispatch mechanism.","enum":["queued"]},"provider":{"type":"string","description":"Voice provider.","enum":["elevenlabs"]},"to":{"type":"string","description":"Destination as REDACTED for the response and the log (digits except the last four replaced). The unmasked number never leaves the platform in a response body.","examples":["+9715*******67"]},"jobId":{"type":"string","description":"Durable dial-job id."},"jobState":{"type":"string","description":"Queue state at enqueue time (PENDING normally).","enum":["PENDING","CLAIMED","DONE","DEAD"]},"duplicate":{"type":"boolean","description":"True when the enqueue was rejected by the unique (case_id, attempt_no) index, i.e. this case was already queued. Same mechanism as the response-level replay marker, one layer down."}},"required":["channel","provider","to","jobId","jobState","duplicate"],"title":"Delivery"},"Degraded":{"type":"object","properties":{"band":{"type":"string","description":"Admission band at decision time.","enum":["NORMAL","CONSTRAINED","SHED"]},"reason":{"type":"string","description":"Why the voice channel was shed, in prose. Human-facing."},"fallback":{"type":"string","description":"The asynchronous channel the case degrades to.","enum":["sms","app_push"]},"expectedLoss":{"type":"integer","description":"Risk x amount, rounded. Drives triage priority. Not a currency amount and not a balance."}},"required":["band","reason","fallback","expectedLoss"],"title":"Degraded"},"InterventionDegraded202":{"type":"object","properties":{"ok":{"type":"boolean","description":"Always true — the signal was accepted.","examples":[true]},"caseRef":{"type":"string","description":"Case reference. The case exists and is auditable."},"transactionRef":{"type":"string","description":"Echo of transaction_ref."},"status":{"type":"string","description":"The voice channel was shed under load; the case degrades to an asynchronous channel instead of being dropped. A bank must treat this as ACCEPTED-but-not-voice, and must have its own asynchronous step for the cases it cannot afford to lose.","enum":["degraded_to_async"],"examples":["degraded_to_async"]},"degraded":{"type":"object","description":"The admission decision: band, reason, fallback channel, expected-loss score."},"receivedAt":{"type":"string","description":"ISO-8601 instant.","format":"date-time"}},"required":["ok","caseRef","transactionRef","status","degraded","receivedAt"],"title":"InterventionDegraded202","description":"Accepted, but the voice channel was shed under load and the case degrades to an asynchronous channel. Still a success: the case exists, is auditable, and did not need re-sending."},"InterventionAccepted202":{"title":"InterventionAccepted202","description":"The two accepted envelopes. `status` distinguishes them and is the only field a producer must branch on.","oneOf":[{"$ref":"#/components/schemas/InterventionQueued202"},{"$ref":"#/components/schemas/InterventionDegraded202"}],"x-admission-bands":["NORMAL","CONSTRAINED","SHED"]},"InterventionReplay202":{"title":"InterventionReplay202","description":"A replay of an already-stored idempotency-key response. Same status (202) and same envelope as the original, plus `duplicate: true` and the `X-Idempotent-Replay: true` header.\n\nThis is the idempotency contract working. Do not treat it as an error and do not send a different key to force a new case.","allOf":[{"$ref":"#/components/schemas/InterventionAccepted202"},{"type":"object","required":["duplicate"],"properties":{"duplicate":{"type":"boolean","const":true,"description":"Always true on a replay."}}}]},"Error":{"title":"ErrorCatalogEntry","type":"object","description":"One row of the typed error catalog, emitted verbatim at `x-error-catalog`.","required":["id","status","code","literal","surface","envelope","reachedFrom","retryable","meaning","remediation"],"properties":{"id":{"type":"string"},"status":{"type":"integer"},"code":{"type":["string","null"],"description":"The machine code as it appears in the `code` field, or null when the code field carries something else."},"literal":{"type":"string","description":"The verbatim string in the source that produces this code."},"surface":{"type":"string","enum":["http_body","http_message","audit_chain"],"description":"Where the code is observable. `http_message` means it appears inside `message` and is sanitised, so branch on `code` and read `envelopeCode` to see what that will be."},"envelope":{"type":"string","enum":["failure_envelope_v1","legacy_error_field"],"description":"Which body shape produces it. A producer's error handling must know whether `code` exists."},"reachedFrom":{"type":"array","items":{"type":"string"},"description":"The documented endpoints that can return it."},"envelopeCode":{"type":"string","description":"For http_message rows: what the `code` FIELD actually says."},"retryable":{"type":"boolean","description":"Whether the SAME request can succeed later for THIS cause. Not the same as the envelope's `retryable` field, which is fixed per code."},"meaning":{"type":"string"},"remediation":{"type":"string"}}},"FailureEnvelope":{"type":"object","description":"The `failure_envelope_v1` error body — every field always present, plus `x-request-id` and (where applicable) `Retry-After` headers.","required":["code","message","retryable","requestId","docsUrl"],"properties":{"code":{"type":"string","description":"Machine-readable code. Stable across messages; see `x-error-catalog` for every code with its meaning, retryability and remediation. Known values: db_capacity_shed, dependency_unavailable, internal_bug, intervention_refused_degraded, malformed_request, not_found, payload_too_large, payment_required, policy_precondition, rate_limited, reference_conflict, semantically_invalid, state_conflict, statement_timeout, transaction_contended, unauthenticated, unique_conflict.","enum":["db_capacity_shed","dependency_unavailable","internal_bug","intervention_refused_degraded","malformed_request","not_found","payload_too_large","payment_required","policy_precondition","rate_limited","reference_conflict","semantically_invalid","state_conflict","statement_timeout","transaction_contended","unauthenticated","unique_conflict"]},"message":{"type":"string","maxLength":400,"description":"Human-readable reason, sanitised and length-capped. MAY embed a cause (a policy-gate code, an outbound-URL verdict reason) — do NOT branch on the message text; branch on `code`."},"retryable":{"type":"boolean","description":"Whether an IMMEDIATE identical retry is worth making. Fixed per code, so `policy_precondition` is always false even for the transient causes (cooldown, caps, spend ceiling) where a DELAYED retry is correct — the cause is named in `message`."},"requestId":{"type":"string","description":"Correlation id, also sent as the `x-request-id` header. Quote it in a ticket; it is how support finds the audit record."},"docsUrl":{"type":"string","format":"uri","description":"Per-code documentation URL. Base is FAILURE_DOCS_BASE_URL, default https://securevoiceai.me/docs/errors."}}},"LegacyError":{"type":"object","description":"The legacy `{ error }` body. Returned by the RETIRED /api/interventions and the operator/agent-tool routes. `code` may be absent entirely.","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable reason. There may be NO `code` field at all — on this envelope, error handling must not assume one."},"code":{"type":"string","description":"Present only on some legacy refusals. Known legacy values: dependency_unavailable, endpoint_retired, invalid_payload, malformed_request, payment_required, policy_precondition, rate_limited, semantically_invalid, unauthenticated, unknown_field.","enum":["dependency_unavailable","endpoint_retired","invalid_payload","malformed_request","payment_required","policy_precondition","rate_limited","semantically_invalid","unauthenticated","unknown_field"]}}},"BankEventEnvelope":{"type":"object","properties":{"schema_version":{"type":"string","description":"Envelope version, currently \"2026-10-01\". A receiver must REJECT an unknown version rather than guess.","examples":["2026-10-01"]},"event_id":{"type":"string","description":"UUID v4, assigned before the row is written. THE DEDUPE KEY: a receiver must store it and drop a repeat. The same event_id is retried up to 6 times with byte-identical bodies, so duplicates are normal traffic, not an error."},"event_type":{"type":"string","description":"Dotted event name. The only type emitted today is `case.notified` (post-call verdict). Unknown types must be ignored, not treated as fatal.","examples":["case.notified"]},"case_ref":{"type":["string","null"],"description":"Case reference, or null for an event with no case. The join key to the bank's own alert.","examples":["SV-F-7K2M9Q"]},"org_id":{"type":["string","null"],"description":"Tenant scope, or null for the shared namespace.","examples":["bank-core-uae"]},"occurred_at":{"type":"string","description":"When the event happened, not when it was sent. For `case.notified` this is the post-call ingest instant, so a retry hours later does not look like a new event.","format":"date-time"},"data":{"$ref":"#/components/schemas/CaseNotifiedData"}},"required":["schema_version","event_id","event_type","case_ref","org_id","occurred_at","data"],"title":"BankEventEnvelope","description":"Canonical bank event. Built by buildBankEvent (src/lib/outbox.ts) and serialised with canonicalJson (sorted keys at every depth) — the bytes that are hashed are the bytes that are sent, so a receiver verifies against the body it already read and never re-serialises anything.\nRetries: up to 6 attempts on a ladder (1m, 5m, 30m, 120m, 180m, 720m) across roughly 21 hours, then DEAD plus a DeadLetter row replayable by an operator. Every retry carries the SAME event_id and byte-identical body, so duplicates are expected traffic. Retryable on network error, 408, 429 and 5xx; a 4xx from the receiver is treated as delivered-not-accepted and is not retried."},"CaseNotifiedData":{"type":"object","properties":{"state":{"type":"string","description":"Case state at publication.","enum":["NOTIFIED"]},"outcome":{"type":["string","null"],"description":"Post-call verdict as classified by the pipeline. A value here is EVIDENCE for the bank's fraud team, not an authorisation: the bank decides what to do with the case."},"duration_seconds":{"type":["number","null"],"description":"Call duration in seconds, or null if the provider reported none."},"freeze_staged":{"type":"boolean","description":"Whether a card freeze was STAGED. Staged is not blocked: a human specialist finalises it."},"freeze_reference":{"type":["string","null"],"description":"Reference for the staged freeze, when one exists."},"handoff_queued":{"type":"boolean","description":"Whether a fraud specialist was queued."},"handoff_specialist":{"type":["string","null"],"description":"Specialist queue or name, when queued."},"tool_calls_observed":{"type":"integer","description":"Count of agent tool invocations during the call."},"audit_ref":{"type":"string","description":"Reference the bank can quote in a ticket to pull the full, redacted audit chain through the signed case export. This is the pull-based evidence model: we push the verdict, the bank pulls evidence.","examples":["SV-F-7K2M9Q"]},"resolution_method":{"type":"string","description":"HOW the case reached NOTIFIED. ADDITIVE and optional: `state` is unchanged, so a receiver that ignores this field behaves exactly as before. Always emitted by this platform. `voice_call` = resolved on the call; `sms_reply_yes` / `sms_reply_no` = the customer answered the blind-ping SMS; `unreachable_no_reply` = voice failed, the SMS went out and nobody answered within 24h; `voice_failed_sms_unavailable` = voice failed and no SMS could be sent (number opted out, SMS not configured, invalid number or provider error). An SMS reply proves possession of the phone, not identity - treat `sms_reply_*` as evidence for your fraud team, not as an authorisation.","enum":["voice_call","sms_reply_yes","sms_reply_no","unreachable_no_reply","voice_failed_sms_unavailable"],"examples":["sms_reply_no"]},"customer_response":{"type":["string","null"],"description":"The customer's answer when it was given over SMS: `yes` (the activity was theirs) or `no` (it was not). `null` when the customer never answered or the case was resolved on the call - in that case the call's verdict is in `outcome`. ADDITIVE and optional.","enum":["yes","no"],"examples":["no"]},"evidence":{"type":"object","description":"A pointer, not the evidence. `transcript` is the literal string `withheld` and this is invariant, not a configuration."}},"required":["state","outcome","duration_seconds","freeze_staged","freeze_reference","handoff_queued","handoff_specialist","tool_calls_observed","audit_ref","evidence"],"title":"CaseNotifiedData","description":"`data` for event_type `case.notified` — the post-call verdict. This is EVIDENCE for the bank's fraud team, never an authorisation: `freeze_staged: true` means a reversible freeze was STAGED, and a human specialist finalises it."},"EvidencePointer":{"type":"object","properties":{"transcript":{"type":"string","description":"Always the literal `withheld`. No transcript content ever appears in an outbound event.","enum":["withheld"],"examples":["withheld"]},"note":{"type":"string","description":"Prose explanation of where the evidence lives."}},"required":["transcript","note"],"title":"EvidencePointer","description":"A pointer to evidence, not the evidence. `transcript` is invariantly `withheld`."},"ConformanceRunRequest":{"type":"object","required":["receiver_url","secret"],"additionalProperties":false,"description":"Self-serve conformance request. `secret` is the signing secret YOUR receiver verifies with — we sign the probes with it and never store it.","properties":{"receiver_url":{"type":"string","format":"uri","maxLength":300,"description":"Your public HTTPS receiver. Validated by SSRF verdict before anything is dialled: https only, port 443, no credentials in the URL, and every address it resolves to must be public. Redirect hops are re-validated."},"secret":{"type":"string","minLength":8,"description":"The shared signing secret for that receiver. Transmitted over TLS, never persisted, never echoed in the report."},"budget_ms":{"type":"integer","minimum":100,"maximum":10000,"default":2000,"description":"Latency budget for the `fast_2xx` check. Not a contractual SLA — it is YOUR receiver's budget, which we grade."}}},"ConformanceReport":{"type":"object","description":"A scored, attachable report. Safe to re-run: every probe carries a fresh event_id except the deliberate replay pair.","required":["report_version","run_id","generated_at","target","budget_ms","checks","score"],"properties":{"report_version":{"type":"string","const":"1.0"},"run_id":{"type":"string","description":"Unique per run; prefixes every probe event_id."},"generated_at":{"type":"string","format":"date-time"},"target":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"}},"description":"The receiver the probes were sent to. Never includes the secret."},"budget_ms":{"type":"integer"},"checks":{"type":"array","description":"One row per graded check: signature_verified, idempotency_honoured, fast_2xx, replay_handled, rejects_malformed.","items":{"$ref":"#/components/schemas/ConformanceCheck"}},"score":{"type":"object","required":["passed","total","percent","verdict"],"properties":{"passed":{"type":"integer"},"total":{"type":"integer"},"percent":{"type":"number"},"verdict":{"type":"string","enum":["conforming","non_conforming"]}}},"probes":{"type":"array","description":"Raw observation per probe. Carries status and latency, never the signature or the secret.","items":{"type":"object","properties":{"seq":{"type":"integer"},"kind":{"type":"string","enum":["valid_delivery","replay","tampered_signature","unsigned","malformed"]},"status":{"type":"integer"},"latency_ms":{"type":"integer"},"signed":{"type":"boolean"},"event_id":{"type":"string"},"duplicate_marker":{"type":["boolean","null"]},"event_id_echoed":{"type":"boolean"}}}}}},"ConformanceCheck":{"type":"object","required":["id","title","status","observed","requirement"],"properties":{"id":{"type":"string","enum":["signature_verified","idempotency_honoured","fast_2xx","replay_handled","rejects_malformed"]},"title":{"type":"string"},"status":{"type":"string","enum":["pass","fail"]},"observed":{"type":"string","description":"What we actually saw. No verdict without an observation."},"requirement":{"type":"string","enum":["Verify SV-Signature over the RAW request bytes before acting. A request with a tampered digest or no signature at all MUST be refused with a 4xx.","Key your dedupe store on event_id and acknowledge the event you accepted, by echoing event_id in the response body or in the `x-securevoice-event-id` header.","Return a 2xx for a well-formed delivery within the stated budget, then do the work asynchronously. A slow 2xx is a lost event, not a delayed one.","A redelivery of an event_id you have already applied MUST NOT be applied again. Mark the redelivery with `duplicate: true` in the response body, or the `X-Securevoice-Duplicate: true` header (aliases: `idempotent_replay`, `replayed`, `already_applied`).","A correctly SIGNED but schema-invalid payload MUST be refused with a 4xx, not acknowledged with a 2xx. Acknowledging what you cannot process loses it silently."],"description":"The normative sentence from CONFORMANCE_REQUIREMENTS this check grades against."}}}}},"x-error-catalog":[{"id":"malformed_request","status":400,"code":"malformed_request","literal":"malformed_request","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions","POST /v1/conformance/run"],"retryable":false,"meaning":"The request could not be used as sent. Two causes: the body is not parseable JSON, or the mandatory `Idempotency-Key` header is absent or shorter than 8 characters. The `message` names which.","remediation":"Send a JSON object and a stable `Idempotency-Key` of at least 8 characters. Retries MUST reuse the same key — a fresh key per retry creates a second case and a second call."},{"id":"unauthenticated","status":401,"code":"unauthenticated","literal":"unauthenticated","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions","POST /v1/conformance/run"],"retryable":false,"meaning":"No acceptable credential. Either a `Bearer svb_…` producer key that is unknown, revoked or expired, or an `SV-Signature` that is missing, malformed, outside the 300 s window, or a digest mismatch. Deliberately one code for all of them: distinguishing them turns the endpoint into an oracle for which secret you hold.","remediation":"Sign the EXACT bytes you transmit — capture the raw body, never a re-serialised object — and sync your clock to NTP. A digest mismatch with an apparently correct signature is almost always re-serialisation. Quote `requestId` from the body if you need to raise a ticket."},{"id":"semantically_invalid","status":422,"code":"semantically_invalid","literal":"semantically_invalid","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions","POST /v1/conformance/run"],"retryable":false,"meaning":"Well-formed JSON that failed validation: a field bound was violated, an undeclared field was present (the schema is `.strict()`), or `callback_url` was refused by the outbound-URL policy. The `message` names the first offending field.","remediation":"Read `message`, fix the named field, re-send. Do not retry unchanged. NOTE: this ingest does not distinguish an unknown field from any other validation failure — `unknown_field` is emitted only by the legacy tool endpoints below. See `docs/INTEGRATION-CONTRACT.md` for the full field table."},{"id":"payment_required","status":402,"code":"payment_required","literal":"payment_required","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"retryable":false,"meaning":"The signal was refused because the organisation's prepaid balance cannot cover the call. This is the ONLY refusal on this endpoint that the caller can resolve itself — every `policy_precondition` refusal is a decision about the customer that retrying cannot change, while an empty wallet is a decision about the account that a top-up changes immediately. The specific cause (`credits_exhausted`) appears in `message`.","remediation":"Top up the credits wallet, then re-send the signal. Do NOT retry unchanged: nothing becomes available on its own, and a retry loop against an unpaid account is the traffic a 402 exists to stop. The refused signal reserved nothing, so re-sending it after funding costs one call, not two."},{"id":"policy_precondition","status":409,"code":"policy_precondition","literal":"policy_precondition","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"retryable":false,"meaning":"The signal was refused by a policy or a guardrail: the customer has opted out, the destination country is not allowed, the org is at its concurrency cap or spend ceiling, the destination is in cooldown, the velocity breaker has paused the org, or its subscription is paused. An empty prepaid balance is NOT this code — it is `payment_required` (402), because that is the one refusal the caller can clear by paying. The specific cause is the `gate_*` / `abuse_*` row whose literal appears in `message`.","remediation":"Do NOT blind-retry: most policy refusals (consent, geography) must never be retried. The cause is named in `message` and is the value to branch on after reading it. For the transient causes — cooldown, concurrency caps, spend ceiling — a delayed retry is correct."},{"id":"rate_limited","status":429,"code":"rate_limited","literal":"rate_limited","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions","POST /v1/conformance/run"],"retryable":true,"meaning":"The per-caller budget is spent. Carries `Retry-After` (the ingest computes it from the token bucket; the conformance endpoint clamps it into 1–3600 s).","remediation":"Honour `Retry-After` and retry with jitter. Never in a tight loop — it is your fraud engine's traffic pattern we are bounding."},{"id":"dependency_unavailable","status":503,"code":"dependency_unavailable","literal":"dependency_unavailable","surface":"http_body","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"retryable":true,"meaning":"A required dependency failed while the case was being armed: the database, the durable dial queue, or a voice-provider call. Also the class used when a typed gate refusal carried a 5xx status. Carries `Retry-After`.","remediation":"Retry with backoff. Because the idempotency key is stored only after a successful arm, a retried signal either creates one case or replays the stored one — never two. Quote `requestId` if it persists."},{"id":"endpoint_retired","status":410,"code":"endpoint_retired","literal":"endpoint_retired","surface":"http_body","envelope":"legacy_error_field","reachedFrom":["POST /api/interventions"],"retryable":false,"meaning":"`POST /api/interventions` is retired and arms nothing: no policy gate, no abuse gate, no Case row, no billing, and the carrier call used to happen inside the request. It answers with the successor path and the list of behavioural changes so a producer can migrate deliberately rather than guess.","remediation":"Move to /v1/interventions: integer minor units, E.164 phone, required consent_record_id, required Idempotency-Key, and a /v1/interventions error envelope ({ code, message, retryable, requestId, docsUrl }) instead of { error }."},{"id":"invalid_payload","status":422,"code":"invalid_payload","literal":"invalid_payload","surface":"http_body","envelope":"legacy_error_field","reachedFrom":["POST /api/console/fire (operator)","POST /api/console/freeze/commit (operator)"],"retryable":false,"meaning":"Legacy `{ error, code }` validation refusal. Emitted by the OPERATOR console routes, not by the canonical ingest — the ingest uses `semantically_invalid`.","remediation":"This row is here so an operator-integration is not surprised. Bank integrations never see it."},{"id":"unknown_field","status":422,"code":"unknown_field","literal":"unknown_field","surface":"http_body","envelope":"legacy_error_field","reachedFrom":["POST /api/elevenlabs/tools/* (agent)"],"retryable":false,"meaning":"The payload carried a field that is not in the schema at all (schemaErrorCode maps Zod's `unrecognized_keys`). Emitted by the agent tool endpoints only; the canonical ingest reports an undeclared field as `semantically_invalid`.","remediation":"Remove the field. Do not send account numbers or anything you expect us to store but do not declare — the ingest schema is strict, and a field you invent will not be stored."},{"id":"gate_consent_opted_out","status":409,"code":null,"literal":"consent_opted_out","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The customer has withdrawn consent for outbound contact. The ingest answers 409 with `code: policy_precondition` and `consent_opted_out` as the reason. This is a legally meaningful refusal: the destination is never dialled, and no retry can turn it into an allowed call.","remediation":"Do not retry. Honour the opt-out and suppress further interventions for this customer; a retry here is a compliance violation, not a transient failure."},{"id":"gate_consent_invalid","status":409,"code":null,"literal":"consent_invalid","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"consent_record_id missing or malformed for the policy gate. The literal appears in `message` as `consent_invalid: …` when it survives sanitisation; the `code` field is always `policy_precondition`.","remediation":"Send a 4–64 character consent_record_id that exists for the customer."},{"id":"gate_country_unparseable","status":409,"code":null,"literal":"country_unparseable","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"No country could be derived from the E.164 number.","remediation":"Send a canonical E.164 number for a diallable country."},{"id":"gate_country_not_allowed","status":409,"code":null,"literal":"country_not_allowed","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The destination country is not on this org's allowlist. Raised by BOTH the policy gate and the abuse gate's geography control.","remediation":"Ask your SecureVoice contact to add the country to your org allowlist. It is a configuration change, not a payload change."},{"id":"gate_transaction_repeat","status":409,"code":null,"literal":"transaction_repeat","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"This `transaction_ref` already has a case, so a call has already been placed for it. Refused because a second call would tell the same fraud victim their card is frozen twice about one transaction. Checked independently of `Idempotency-Key`: a new key is a new signal as far as the key is concerned, and one transaction must still produce one call.","remediation":"Treat the original case as authoritative and read its outcome rather than re-sending. If you genuinely need a second intervention for the same transaction, use a distinct `transaction_ref` so the intent is visible in the ledger."},{"id":"gate_do_not_call","status":409,"code":null,"literal":"do_not_call","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The destination is on the do-not-call registry, so this call category may not place it. Registry honour is category-scoped by design: `routine`, `fact_finding`, `sensitive_case` and `b2b` are all blocked, while `time_critical_fraud` is not gated on it — a fraud verification is made in the customer's own interest and is already covered by the ingest consent requirement. Saying this loudly is the point: an operator who expects a call and sees this refusal needs to know the registry, not the queue, stopped it.","remediation":"Do not retry. If the customer has genuinely re-consented, remove the registry row (it is the source of truth) and re-send; the gate reads the registry at dial time precisely so a revoked entry takes effect immediately. A case refused this way is never silently re-categorised to slip past it."},{"id":"gate_outside_calling_hours","status":409,"code":null,"literal":"outside_calling_hours","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"A `routine` call may only be placed inside the permitted calling window, and this one is outside it. The ingest refuses; the dial worker does something better — it PARKS the job until the window opens, consuming no attempt, because a job accepted at 19:59 with a lead delay can lawfully be claimed at 20:01. So a bank sees this code only when it re-sends inside the blocked window, and a customer is never woken by a follow-up call.","remediation":"No action needed for a queued case — the worker resumes it when the window opens. Re-send only if you need a different call category; time-critical fraud verification is not window-gated."},{"id":"gate_idempotent_request_in_flight","status":409,"code":null,"literal":"idempotent_request_in_flight","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"A request with this `Idempotency-Key` is already being executed. The key is claimed atomically before any side effect, so a concurrent duplicate loses the claim and is refused here rather than placing a second call to the same customer. Seeing this means the FIRST request is still in progress, not that it failed.","remediation":"Retry the identical request with the SAME `Idempotency-Key` after a short delay. It will then receive the stored response with `X-Idempotent-Replay: true` instead of dialling again. Do NOT retry with a new key: a fresh key is a fresh signal and will place a second call, which is the exact toll-fraud failure this claim exists to prevent."},{"id":"gate_invalid_call_category","status":409,"code":null,"literal":"invalid_call_category","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"`call_category` is not one of the declared categories, so the compliance gate cannot decide which regulatory preconditions apply to the call and refuses to guess. The category is what turns the do-not-call registry, the calling window and the Salah window on or off, so an unrecognised value is not a loose label — it is an unclassifiable call.","remediation":"Send one of the documented `call_category` values. Do not retry the identical payload: it will be refused again for the same reason."},{"id":"gate_redaction_mismatch","status":409,"code":null,"literal":"redaction_mismatch","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The redaction backstop found the destination phone number still present inside the signal's `redacted_text`, so the payload would have been persisted unredacted. This is a data-protection refusal, not a capacity one: it names a producer-side redaction step that is missing or misconfigured, and nothing downstream can honour a privacy promise the inbound payload already broke.","remediation":"Fix the redaction in the sender before re-sending; the cause is upstream of this API. Retrying the same payload is refused again by design — the alternative is storing a customer's number in clear."},{"id":"gate_prayer_time","status":409,"code":null,"literal":"prayer_time","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"A non-critical intervention was paused inside the local Salah window. `time_critical_fraud` is exempt and is never refused this way, because a card verification that waits is the harm this product exists to prevent; a collections or routine call landing during prayer is an inconvenience the customer cannot politely opt out of. The envelope's `retryable` stays false because an immediate retry hits the same window; this row is `retryable: true` because a DELAYED retry after it closes is correct.","remediation":"Retry after the window closes, or let the dial worker park the job to the next permitted instant. Do not re-categorise the call as fraud to route around it — the exemption exists for genuine fraud, and the audit records the category."},{"id":"gate_spend_ceiling","status":409,"code":null,"literal":"spend_ceiling","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"The org's spend ceiling for the window has been reached.","remediation":"Retry after the window resets, or have the ceiling raised."},{"id":"gate_credits_exhausted","status":402,"code":null,"literal":"credits_exhausted","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"payment_required","retryable":false,"meaning":"No credits remain for this organisation, or the credit reservation was refused. Nothing was reserved and no call was placed — the refusal happens before any spend is committed, so a rejected signal costs nothing. This is the one gate refusal a caller can clear itself: top up the wallet and the same signal is diallable again.","remediation":"Top up the credits wallet (a prepaid pack, or resume the subscription). Retrying the identical signal with the SAME `Idempotency-Key` after funding will not re-dial — the key was released on refusal, so re-send it as a fresh request once the balance covers the call."},{"id":"gate_subscription_paused","status":409,"code":null,"literal":"subscription_paused","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"The organisation's Paddle subscription is PAUSED, so outbound intervention calls are not being placed. This is the tenant's own billing preference, not a fault and not a spend limit: `past_due` and `canceled` deliberately do NOT produce this code, and a paused tenant keeps product access and keeps their credits. Signals are refused at ingest, before any credit is reserved, so a refused signal costs nothing.","remediation":"Resume the subscription from the billing portal (or wait for the scheduled resume). Dialling resumes on the next signal — no re-send of the refused ones is required for anything that is still time-critical, and a paused fraud queue should be re-driven by the bank once calls are allowed again."},{"id":"gate_pilot_daily_cap_reached","status":409,"code":null,"literal":"pilot_daily_cap_reached","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"This deployment is running a pilot with a hard daily intervention cap, and the contracted volume for today has already been dispatched. The signal was refused at ingest: no case was created, no call was placed, no SMS was sent and no spend was committed. It is a decision about the pilot's agreed volume, not a fault and not a statement about the customer or the risk.","remediation":"Do not retry the same signal today — it will be refused identically. If the volume genuinely needs raising, the pilot owner raises the cap in the deployment configuration; the next signal after the platform's daily boundary is accepted again."},{"id":"gate_pilot_signal_kind_out_of_scope","status":409,"code":null,"literal":"pilot_signal_kind_out_of_scope","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"This deployment is running a pilot chartered for ONE alert type, and the signal carries another. The signal was refused at ingest: no case was created and no customer was contacted. The charter is what the institution agreed to, so a signal outside it is not dialled and not queued — the platform does not widen a pilot's scope on its own.","remediation":"Do not retry this signal during the pilot. Either narrow the producer to the chartered alert type, or have the pilot owner extend the charter in the deployment configuration (which is a scope change requiring a change record, not a config tweak)."},{"id":"gate_pilot_cap_misconfigured","status":409,"code":null,"literal":"pilot_cap_misconfigured","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"This deployment is running a pilot whose daily volume cap is not a usable number, so the platform refuses new pilot signals rather than running with no ceiling at all. The signal was refused at ingest: no case was created and no customer was contacted. This is a CONFIGURATION fault, not a statement about the pilot's volume and not a statement about the customer — which is why it is a different cause from `pilot_daily_cap_reached` rather than the same one with different words.","remediation":"The pilot owner fixes the cap in the deployment configuration (a positive whole number of interventions per day) and the platform resumes accepting signals. Retrying before the configuration is fixed will be refused identically."},{"id":"gate_invalid_e164","status":409,"code":null,"literal":"invalid_e164","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The destination is not canonical E.164 (abuse gate, input-shape control).","remediation":"Normalise to +<country><subscriber>, 2–16 digits."},{"id":"gate_country_unresolvable","status":409,"code":null,"literal":"country_unresolvable","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"Canonical number, but no country could be determined (abuse gate).","remediation":"Send a number whose country code is allocated."},{"id":"gate_geo_allowlist_unconfigured","status":409,"code":null,"literal":"geo_allowlist_unconfigured","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"No geography allowlist is configured for this org, so nothing is diallable. Fails closed.","remediation":"Operator action: configure the org's allowlist."},{"id":"gate_geo_allowlist_misconfigured","status":409,"code":null,"literal":"geo_allowlist_misconfigured","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The allowlist contains a wildcard, which is refused by design.","remediation":"Operator action: enumerate countries explicitly."},{"id":"gate_country_denied","status":409,"code":null,"literal":"country_denied","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The resolved country is on the denylist (abuse gate).","remediation":"Do not retry. Contact your SecureVoice owner if the denylist is wrong."},{"id":"gate_destination_prefix_denied","status":409,"code":null,"literal":"destination_prefix_denied","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The E.164 prefix is a shared-cost, premium or non-geographic service range (abuse gate).","remediation":"Send a geographic number."},{"id":"gate_demo_tier_requires_test_number","status":409,"code":null,"literal":"demo_tier_requires_test_number","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"The org resolved to the demo plan tier and the destination is not on the verified test-number list (abuse gate).","remediation":"On a demo tier, dial only numbers from your verified list. A production tier has no such restriction."},{"id":"gate_test_number_list_empty","status":409,"code":null,"literal":"test_number_list_empty","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":false,"meaning":"Demo tier with no verified test-number list configured. Fails closed (abuse gate).","remediation":"Operator action: configure the list."},{"id":"gate_org_auto_paused","status":409,"code":null,"literal":"org_auto_paused","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"The velocity breaker tripped for this org and no human has resumed it (abuse gate).","remediation":"A human must resume the org in the console. Retrying without that is pointless."},{"id":"gate_velocity_new_prefix_burst","status":409,"code":null,"literal":"velocity_new_prefix_burst","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"Too many previously-unseen destination prefixes inside the new-prefix window (abuse gate).","remediation":"Retry after the window. This is the toll-fraud control; do not work around it."},{"id":"gate_velocity_burst_rate","status":409,"code":null,"literal":"velocity_burst_rate","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"The attempt rate inside the burst window exceeded the threshold (abuse gate). The envelope's own `retryable` stays false because a cooldown is required; this row's `retryable: true` records that a DELAYED retry is the correct response.","remediation":"Retry with backoff once the burst window clears; this is the attempt-rate control."},{"id":"gate_velocity_after_hours","status":409,"code":null,"literal":"velocity_after_hours","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"Out-of-hours volume anomaly. A warn threshold — the abuse gate records the decision either way.","remediation":"Retry with backoff; if it persists, review your send schedule."},{"id":"gate_destination_cooldown","status":409,"code":null,"literal":"destination_cooldown","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"That destination was dialled too recently for this org (abuse gate). `code` is `policy_precondition`, whose envelope-level `retryable` is false — because an IMMEDIATE retry is wrong — while this row is `retryable: true`, because a DELAYED retry past the cooldown window is exactly right. The two flags answer different questions and this is the canonical example of why they must not be conflated.","remediation":"Retry after the cooldown window. Do not switch `transaction_ref` to evade it — the cooldown is per destination and per org, by design, and that is the toll-fraud control."},{"id":"gate_org_concurrency_cap","status":409,"code":null,"literal":"org_concurrency_cap","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"Simultaneous calls for this org are at the cap (abuse gate).","remediation":"Retry with jitter once a call in flight completes. This is a capacity ceiling, not a rejection of this case — the signal was otherwise admissible."},{"id":"gate_global_concurrency_cap","status":409,"code":null,"literal":"global_concurrency_cap","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"Simultaneous calls across all orgs are at the platform cap (abuse gate).","remediation":"Retry with jitter. A full platform is a capacity signal, not a case rejection."},{"id":"gate_internal_error","status":409,"code":null,"literal":"guard_internal_error","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"policy_precondition","retryable":true,"meaning":"An abuse control raised an unexpected error. Fails closed — and it is a bug in us.","remediation":"Retry; if it persists, quote `requestId` and the case reference to support."},{"id":"ssrf_malformed_url","status":422,"code":null,"literal":"malformed_url","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"callback_url is not a valid absolute URL.","remediation":"Send an absolute https URL."},{"id":"ssrf_not_https","status":422,"code":null,"literal":"not_https","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"Plaintext http is refused: a network attacker could rewrite a signed body.","remediation":"Use an https URL. There is no plaintext exception on this surface, because the body carries an HMAC that an on-path attacker could otherwise rewrite."},{"id":"ssrf_credentials_in_url","status":422,"code":null,"literal":"credentials_in_url","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"https://user:pass@host leaks a credential into logs and referrers.","remediation":"Put the credential in a header, not the URL."},{"id":"ssrf_blocked_port","status":422,"code":null,"literal":"blocked_port","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"Only port 443 is permitted for a customer-supplied URL.","remediation":"Terminate TLS on 443 and route internally."},{"id":"ssrf_blocked_hostname","status":422,"code":null,"literal":"blocked_hostname","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"An internal-only name (localhost, *.internal, *.corp, *.local, published metadata names) or a name that is not fully qualified.","remediation":"Use a publicly resolvable FQDN on the public internet. An internal name is refused even when it would resolve, because this endpoint would dial it from inside our network."},{"id":"ssrf_dns_failed","status":422,"code":null,"literal":"dns_failed","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":true,"meaning":"The hostname did not resolve at validation time.","remediation":"Retry; check the name."},{"id":"ssrf_no_addresses","status":422,"code":null,"literal":"no_addresses","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"The hostname resolved to zero addresses.","remediation":"Check the DNS record."},{"id":"ssrf_private_address","status":422,"code":null,"literal":"private_address","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"A resolved address is private, loopback, link-local, CGNAT, multicast or reserved — including every published cloud-metadata address. A host with ONE private answer is rejected even if the others are public, because the connection race is the attack.","remediation":"Point the callback at a genuinely public address."},{"id":"ssrf_redirect_blocked","status":422,"code":null,"literal":"redirect_blocked","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"A redirect hop left the validated target. Each hop is re-validated before it is dialled.","remediation":"Return 200 directly; do not redirect to another host."},{"id":"ssrf_too_many_redirects","status":422,"code":null,"literal":"too_many_redirects","surface":"http_message","envelope":"failure_envelope_v1","reachedFrom":["POST /v1/interventions"],"envelopeCode":"semantically_invalid","retryable":false,"meaning":"The redirect chain exceeded 5 hops, so the whole delivery was abandoned rather than followed further.","remediation":"Return the payload directly instead of redirecting; more than 5 hops is refused outright."}],"x-status-failures":[{"id":"retired_signature_rejected","status":401,"errorExample":"Signature verification failed: ","envelope":"legacy_error_field","meaning":"The retired endpoint's 401. The reason is appended in prose: missing header, malformed header, timestamp outside the 300 s window in either direction, or digest mismatch.","retryable":false,"remediation":"Sign the exact bytes you send, and sync your clock. Then migrate to /v1/interventions, which returns a machine code."},{"id":"retired_producer_key_rejected","status":401,"errorExample":"Invalid or revoked producer key","envelope":"legacy_error_field","meaning":"The `Authorization: Bearer svb_…` key is unknown, revoked or expired.","retryable":false,"remediation":"Mint a new key in the console. Revocation is immediate and deliberate."},{"id":"retired_rate_limited","status":429,"errorExample":"Rate limit exceeded; retry later.","envelope":"legacy_error_field","meaning":"The retired endpoint's 429, with a `Retry-After` header and no code in the body.","retryable":true,"remediation":"Honour Retry-After, then migrate: the canonical ingest returns `code: rate_limited`."},{"id":"retired_malformed_json","status":400,"errorExample":"Invalid JSON body","envelope":"legacy_error_field","meaning":"The retired endpoint's 400: the body did not parse as JSON.","retryable":false,"remediation":"Send a JSON object, and sign the same bytes you transmit."},{"id":"retired_invalid_signal","status":422,"errorExample":"Invalid signal: ","envelope":"legacy_error_field","meaning":"The retired endpoint's 422. NOTE it returns `{ error }` with NO `code` field even for a validation failure — the one place where a bank gets no machine-readable reason at all.","retryable":false,"remediation":"Read the prose, then migrate to /v1/interventions for `code: semantically_invalid`."},{"id":"receiver_unconfigured","status":503,"errorExample":"receiver_unconfigured","envelope":"legacy_error_field","meaning":"Our own hosted reference receiver has no BANK_WEBHOOK_SECRET, so it cannot verify anything. It is not your receiver.","retryable":false,"remediation":"Operator action: set BANK_WEBHOOK_SECRET. Nothing for a bank to do."}],"x-error-envelopes":{"failure_envelope_v1":{"required":["code","message","retryable","requestId","docsUrl"],"headers":["x-request-id","Retry-After (429 and 503 only)"],"source":"src/lib/failures/envelope.ts FailureEnvelope + makeFailure","usedBy":["POST /v1/interventions","POST /v1/conformance/run"]},"legacy_error_field":{"required":["error"],"code_may_be_absent":true,"source":"src/lib/api-errors.ts","usedBy":["POST /api/interventions","operator console routes","agent tool endpoints"],"note":"Retained only on the retired ingest and the internal surfaces. A migrating bank meets it for as long as it keeps calling /api/interventions."}},"x-aliases":{"/v1/interventions -> /api/v1/interventions":"next.config.ts rewrites()","/api/interventions":"410 Gone; retained for a clean migration notice"},"x-event-types":["case.notified"],"x-data-minimisation":{"sent":["transaction_ref — the bank's own opaque reference (never an account number)","case_ref — platform case reference, the join key","risk_score — 0“1, used for triage","language, currency, amount (minor units), merchant descriptor","phone — E.164, required to place the call; returned to the caller only redacted","consent_record_id — required for outbound contact","post-call verdict, duration, staged-freeze and handoff flags, audit reference"],"neverSent":["account numbers, IBANs, card PANs or track data","balances, available credit, or any account state","the transaction's counterparty bank account or settlement details","transcript content, verbatim or redacted","recording URLs or audio","date of birth, address, email, document numbers, or any other customer PII","the webhook secret or any signing material","the unmasked destination phone number (only a redacted form is echoed)"],"rationale":"SecureVoice is a verification-by-conversation surface, not a ledger. It never needs an account number to call someone, so it never accepts one: the ingest schema is .strict() and an unknown field is refused, which turns 'do not send PII' from a policy into a rejection."}}