Skip to content

API reference

https://api.vauchflow.com

Include your secret API key in every request:

Authorization: Bearer vf_sk_YOUR_KEY

Agent keys (vf_ak_*) authenticate via the same Authorization: Bearer header for REST endpoints. The MCP endpoint conventionally uses the X-API-Key: header instead — see AI agents for details.

HeaderDescription
Idempotency-KeySupply a unique string per write request to safely retry on network failures without double-creating resources.
Vauchflow-Dry-Run: truePreview an action without persisting it. The response is identical to the real response but includes "dry_run": true and "id": null. Supported on POST /v1/campaigns, PATCH /v1/campaigns/{id}, POST /v1/vouchers, POST /v1/customers, POST /v1/webhooks. Explicitly rejected (400) for POST /v1/vouchers/{code}/redeem, POST /v1/vouchers/bulk, and all DELETE endpoints.
Vauchflow-Agent-ContextVoluntary fingerprint header for AI agents. Format: agent=<id>;client=<name@version>;prompt_fp=<8hex>;conv=<id>. Maximum 512 bytes. See AI agents for allowed agent values and audit trail behaviour.
MethodPathDescription
POST/v1/vouchersCreate a single voucher
POST/v1/vouchers/bulkGenerate up to 50,000 codes (async)
GET/v1/vouchers/{code}Look up a voucher
POST/v1/vouchers/{code}/validateCheck eligibility — no redemption consumed
POST/v1/vouchers/{code}/redeemAtomically redeem
POST/v1/vouchers/{code}/rollbackReverse a redemption within 30 minutes
PATCH/v1/vouchers/{code}Update metadata or expiry
GET/v1/vouchersPaginated list with filters
MethodPathDescription
POST/v1/campaignsCreate a campaign with rules
GET/v1/campaignsList campaigns
GET/v1/campaigns/{id}Campaign detail + pool stats
PATCH/v1/campaigns/{id}Update name, end date, budget cap
POST/v1/campaigns/{id}/pausePause or resume
MethodPathDescription
POST/v1/customersRegister a customer reference (no PII required)
GET/v1/customers/{id}/redemptionsFull redemption history
DELETE/v1/customers/{id}GDPR right to erasure
GET/v1/customers/{id}/exportGDPR data portability (JSON or CSV)
MethodPathDescription
GET/v1/analytics/overviewTenant-level summary
GET/v1/analytics/campaigns/{id}Per-campaign metrics + time series
GET/v1/analytics/fraudVelocity anomalies and fraud alerts
GET/v1/reports/redemptionsExport full redemption log as CSV
MethodPathDescription
POST/v1/api-keysCreate a secret or publishable key
POST/v1/api-keys/agentCreate an agent key (vf_ak_*) — requires a secret key
GET/v1/api-keysList active keys
POST/v1/api-keys/{id}/rotateRotate a secret key (agent keys not supported — revoke and recreate)
DELETE/v1/api-keys/{id}Revoke
MethodPathDescription
POST/v1/mcpModel Context Protocol JSON-RPC 2.0 endpoint — see MCP server

‘Operator’ means a vf_sk_* secret key or a dashboard JWT with OWNER, ADMIN, or DEVELOPER role (for read endpoints) or OWNER/ADMIN only (for approve/reject). Agent keys (vf_ak_*) are limited to fetching their own queued entries by id.

MethodPathDescriptionCaller
GET/v1/agent-approvalsList pending agent actionsOperator only (SECRET_KEY or JWT OWNER/ADMIN/DEVELOPER)
GET/v1/agent-approvals/{id}Approval entry detailOperator or originating agent key
POST/v1/agent-approvals/{id}/approveApprove and replayOperator only (SECRET_KEY or JWT OWNER/ADMIN)
POST/v1/agent-approvals/{id}/rejectReject (final)Operator only (SECRET_KEY or JWT OWNER/ADMIN)
CodeMeaning
200Success
201Created
202Accepted (async job started)
204No content
400Invalid request
401Authentication failed
404Resource not found
409Already redeemed / duplicate
422Validation failed, idempotency-key mismatch, or unsupported operation (e.g. rotating an agent key)
429Rate limit exceeded — check Retry-After header