Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
title: VITNA API (Phase 1) Alerts API
version: 1.1.0
description: 'The compliance evidence layer for AI agents. Pre-flight compliance checks agents call before they act (consent, breach reportability, EU AI Act classification, cross-border), and audit-grade, signed records of what they did. Phase 1 surface covers region routing labels (one database region is in use today), DPIA/ROPA generation, Data Subject Rights (scoped: answerable only for events linked to a subject via principal_ref at ingest, from the point linkage begins; earlier events are permanently unattributable and cannot be linked retroactively), consent lifecycle, Sahamati AA integration, breach notification, and INR/Razorpay billing for DPDP-IN owners (switched off pending merchant onboarding). Also includes one-command agent self-provisioning (/api/setup, mints a restricted trial key with no signup), a destructive-action safety pre-flight (/api/preflight/action-check), scoped engagement sessions with signed evidence bundles (/api/engagement/*), and account claim by a person, from the claim link (/claim).'
contact:
name: COSTRINITY
email: dpo@costrinity.xyz
url: https://www.costrinity.xyz/
license:
name: Proprietary
url: https://vitna.costrinity.xyz/terms
servers:
- url: https://vitna.costrinity.xyz
description: Production
- url: https://vigil-staging.vercel.app
description: Staging (preview branch)
tags:
- name: Alerts
paths:
/api/alerts:
get:
summary: List an agent's alert rules
description: 'With an API key (x-vitna-key, x-vigil-key, x-api-key or Authorization: Bearer, a restricted trial key included, even beside a session cookie) only that key''s own agent''s rules can be read (since 2026-11-01; another agent''s answer 403 session_required), and each rule has notify_email_set and notify_webhook_set (true or false) in place of notify_email and notify_webhook. The signed-in owner sees both, for any agent on the account.'
tags:
- Alerts
security:
- Session: []
- ApiKey: []
- Bearer: []
parameters:
- name: agent_id
in: query
required: true
schema:
type: string
format: uuid
- name: owner_id
in: query
schema:
type: string
format: uuid
responses:
'200':
description: Rules
'401':
description: Auth required
'403':
description: 'session_required: an agent''s API key asked for another agent''s rules'
'404':
description: Agent not found
operationId: getApiAlerts
x-operation-id-source: derived
post:
summary: Create an alert rule (cost_exceeded, error_rate, no_activity, anomaly_risk)
description: 'Recipients are the owner''s. With an API key (x-vitna-key, x-vigil-key, x-api-key or Authorization: Bearer, a restricted trial key included, even beside a session cookie) a request with a non-empty notify_email or notify_webhook is refused 403 session_required and nothing is stored; a key may create a rule without them, and such a rule records when it fires but sends nothing. notify_webhook must be a public https URL (the SSRF rules notification-prefs uses). Since 2026-11-01 notify_email is a switch, stored as ''account'': a fired rule emails only the owner''s confirmed account address, and no typed address is stored or used.'
tags:
- Alerts
security:
- Session: []
- ApiKey: []
- Bearer: []
responses:
'201':
description: Created
'400':
description: Missing fields, unknown condition_type, or notify_webhook not a public https URL
'403':
description: 'session_required: an API key sent a recipient'
operationId: postApiAlerts
x-operation-id-source: derived
delete:
summary: Delete an alert rule
description: 'Signed-in owner only. With an API key (x-vitna-key, x-vigil-key, x-api-key or Authorization: Bearer, a restricted trial key included, even beside a session cookie) every rule is refused 403 session_required before the rule is looked up, and nothing is deleted: deleting a rule silences it, whoever it sends to, and a rule on another agent is that agent''s oversight. A key can still create a rule. No route edits a rule, so nothing lets a key raise a threshold or switch a rule off. Before 2026-10-05 a key could delete a rule that had no recipient.'
tags:
- Alerts
security:
- Session: []
parameters:
- name: id
in: query
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Deleted
'401':
description: 'forbidden: no signed-in session'
'403':
description: 'session_required: the request carried an API key'
'404':
description: Not found
operationId: deleteApiAlerts
x-operation-id-source: derived
components:
securitySchemes:
ApiKey:
type: apiKey
in: header
name: x-vigil-key
description: 'Per-agent API key. Format: vitna_<64-char-hex>; legacy vigil_ keys remain valid. Send on /api/ingest.'
Bearer:
type: http
scheme: bearer
bearerFormat: vitna_<key> (legacy vigil_<key> accepted)
description: 'Same key as x-vigil-key, sent as `Authorization: Bearer <key>`.'
Session:
type: apiKey
in: cookie
name: vigil_session
description: 'Operator dashboard session cookie. Set by a sign-in: the second step of a password sign-in (/api/auth/verify-pin), or, for an address whose mail Google handles (Gmail or a Google Workspace domain) while VITNA''s mail cannot reach Gmail, the password alone (/api/owners); GitHub; a passkey; or a claim.'
CronSecret:
type: http
scheme: bearer
description: Bearer ${CRON_SECRET}. Only the Vercel cron infrastructure should hold this.