# Where your data goes

The [Your data](/data) page answers one question per feature: **what you send, who else sees it, what we keep, for how long, and how to turn it off.**

It isn't marketing copy. The page is built from this server's live configuration, so it can't drift from what is actually deployed:

- If no AI provider is configured, no feature says "sent to an AI provider".
- If email isn't configured, it says no mail leaves the server.
- If you are signed in and acting in an organization, its [data policy](/docs/organizations) is applied. With AI reading off, the rows say nothing is sent.

The same data is available to your own systems at `GET /api/v1/data-flow`. Send your key (and `X-PhilForms-Org`) to see your organization's policy applied.

## The short version

- **What you type goes to our server to draw each preview and make the PDF.** A single fill is not kept. We keep values only where you ask us to: Saved details and drafts (encrypted), batch files (30 days by default), and certificates on your register. The table below lists every case.
- A photo placed in a PDF goes in as the picture alone: where it was taken, the phone and any video the camera attached stay behind.
- A signature or thumbmark image you preview stays in the server's memory for up to 30 minutes, so typing does not upload it again. It is not written to disk or the database.
- Nothing leaves our server except where a row names a third party. That means AI reading, scan help and custom-form refining (only when allowed and configured), and the URLs you set yourself: schedule sources, webhooks, embed and hook result webhooks. It also means the mail provider for sign-in and invitation mail, and the payment page.
- **Workflow webhooks are value-free.** They carry ids, the form, the unit, who acted, counts and issue codes. No values.
- Every filled PDF leaves a ledger line (document id, form, hashes, time) so anyone can [verify it](/docs/verify). That is a fingerprint, not your values.

## How long each thing is kept

| What | Kept | Delete it now |
|---|---|---|
| A PDF from `/engine/fill` | Not kept — sent to you once | Nothing to delete. Lost it? Send the same values again this month: free. |
| A batch ZIP and its `manifest.json` | 30 days (an organization sets 1–30 with `job_retention_day`) | `DELETE /api/v1/engine/jobs/{id}` |
| The job row (id, form, counts, status, times — no values) | Kept | Goes with the account |
| A ledger line per PDF (document id, form, SHA-256 of the PDF and of its values, time) | Kept: it is what `/verify` checks | Not deleted, so PDFs you handed out still verify. It holds no values. |
| A PDF in the vault | 5 years with the vault add-on, else your plan's retention (default 7 days) | `DELETE /api/v1/vault/{id}` |
| `Idempotency-Key` (key, body hash, document or job id) | 24 hours | — |
| Saved profiles and drafts (encrypted) | Until you delete them | `DELETE /api/v1/profiles/{id}`, `DELETE /api/v1/drafts/{id}` |
| Saved details **on this device** | Nothing on our server. Your browser keeps them until you remove them, clear it, or it evicts them. They do not sync. | **Profiles** on any form, or Help → Forget this browser |
| What you typed on a **custom form**, a certificate's payor block, a notary's office | This browser's own copy, for next time. A custom form's answers go when you download; the others stay until you clear them. They do not sync. With **Shared computer** on none is written: they last as long as the tab. | Help → Forget this browser |
| A form in your **outbox** | Nothing on our server until you are back online. Your browser keeps the values until they are sent, then the PDF until you download it. It is shown to and sent by the account that saved it. | Dismiss it in the banner, or Help → Forget this browser |
| A webhook endpoint's delivery log | The newest 200, none older than 30 days | Deleted with the endpoint |

`GET /api/v1/data-flow` gives the same, feature by feature, for this server's configuration.

## Bring your own AI key

Reading documents into a form (an ID card, a receipt, a letter) can run on **your own Anthropic or Gemini account**. Set the key on [Account → Security](/account?tab=security) for yourself, or on [Organization → Policy](/organization) for the whole organization (admins). Then:

- your documents go to **your** provider account, under your own agreement with them, and the read costs no PhilForms model credits;
- what is sent is the form's public field list (the same as `GET /api/v1/parameters/:id`) and your documents — **never PhilForms' form layout**;
- **scanning a filled paper copy never uses your key** — a scan sends field crops cut from our layout, so it reads on our server instead;
- the key is checked with your provider when you save it, stored encrypted, and never shown again — only the provider and its last 4 characters;
- in an organization, the organization's key is used (not a member's personal one), and the data policy still wins: with AI reading off, nothing is sent anywhere.

By API: `PUT /api/v1/ai-key { "provider": "anthropic" | "gemini", "key": "…", "model": "…" }`, `GET` (provider + last 4), `DELETE`.

## Export everything

Signed in, choose **Download everything we hold** on the Your data page, or call `GET /api/v1/account/export`. You get one JSON file with your account, your keys (prefixes only, never the secrets), organizations, saved profiles and drafts (decrypted), custom forms, schedules, webhooks, jobs and usage.

## Delete your account

On the Your data page, type your email to confirm. You must be signed in with your password: an API key can't delete an account. Deleting:

- removes saved values, custom forms, schedules, webhooks, sessions and memberships;
- revokes every key;
- keeps usage and ledger lines, but no longer linked to your name, so billing still adds up and PDFs you issued still verify.

If you own an organization that still has other members, remove them or delete the organization first.

From code: `DELETE /api/v1/account { "confirm_email": "you@example.com", "current_password": "…" }` with a signed-in session, plus `two_factor_code` when two-step sign-in is on. An account with no password (Google sign-in) leaves `current_password` out.
