Status: Current controls + next hardening
Normal application routes use Clerk-backed authentication.
The Vapi tool endpoint is a special server-to-server boundary because the request originates from Vapi rather than a browser session.
It therefore checks:
This separates caller authentication from document authorization.
The token binds:
pdfId + userId + expiresAt
to a server-generated signature.
The tool route verifies the signature and expiry before using document identity. A caller-supplied pdfId is not treated as the authority for document access.
The normal deletion route verifies the user and ownership, removes application records/segments, and deletes the associated Blob asset.
The orphan cleanup route is narrower and scopes deletion to the current user's Blob namespace. It exists specifically for the case where a Blob object was created before database metadata was successfully persisted.