Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/natureloved/DeadMan-Vault/llms.txt

Use this file to discover all available pages before exploring further.

Updates the status field of an existing vault record and stamps the updated_at timestamp to the current time. This endpoint is the primary mechanism by which the keeper cron job advances a vault through its lifecycle — from active to warning, warning to grace_period, grace_period to triggered, and finally triggered to claimed once all beneficiaries have collected their allocations. Direct calls from client applications are generally unnecessary; the keeper manages these transitions automatically.

Endpoint

PATCH /api/vaults/{id}

Request Parameters

Path Parameters

id
string
required
The UUID of the vault whose status should be updated (e.g. a3f2c891-4b7e-4d3a-9c12-8f1e2d3a4b5c).

Request Body

status
string
The new lifecycle status for the vault. Omitting this field passes undefined to the database update, which may silently clear the status column. Always provide an explicit value. Expected values:
ValueMeaning
fundingVault created; awaiting owner’s USDCx transfer to keeper address.
activeVault funded and heartbeat deadline is counting down normally.
warningHeartbeat deadline is approaching; owner notification has been sent.
grace_periodDeadline has passed; vault is in grace period before triggering.
triggeredKeeper has initiated the distribution; beneficiaries can claim.
claimedAll beneficiary claims have been processed.

Response

Returns 200 OK with a JSON object confirming the update.
success
boolean
Always true when the update succeeds.
This endpoint does not validate the status transition. Any value from the allowed set can be written regardless of the current status. The keeper cron is responsible for advancing states in the correct sequence.
When the keeper advances a vault from activewarninggrace_periodtriggered, each step is a separate PATCH request to this endpoint. The updated_at field is set server-side to new Date().toISOString() on every call — no client-supplied timestamp is needed or accepted.

Example Request

curl -X PATCH "https://your-app.vercel.app/api/vaults/a3f2c891-4b7e-4d3a-9c12-8f1e2d3a4b5c" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "warning"
  }'

Example Response

{
  "success": true
}

Error Responses

StatusErrorDescription
500Supabase error messageThe database update failed — the error message from Supabase is returned verbatim.
500Server misconfigured: missing Supabase env varsRequired server-side environment variables (NEXT_PUBLIC_SUPABASE_URL or SUPABASE_SERVICE_ROLE_KEY) are absent.

Build docs developers (and LLMs) love