app.engagement_document_tokens
TableRow level security on
Signing links for engagement documents (Section 4.4.6): a person without an account opens the document with the link and its access code and signs it. Only SHA-256 hashes of the token and code are stored; both are shown once. Written only by the token RPCs.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.engagement_documents on insert; never accepted from the caller and never changed.References app.organizations.id |
| engagement_document_id | uuid | No | Document the link signs.References app.engagement_documents.id |
| recipient_email | text | No | Email the link was sent to, lower case. A person who signs in with this email, confirmed, may claim the link. |
| token_hash | bytea | No | SHA-256 of the token. Never readable by signed-in callers. |
| access_code_hash | bytea | No | SHA-256 of the token, a colon and the 6-digit access code. Never readable by signed-in callers. |
| expires_at | timestamp with time zone | No | When the link stops working. |
| used_at | timestamp with time zone | Yes | When the document was signed through the link. |
| signer_name | text | Yes | Full name the signer typed when signing. |
| revoked_at | timestamp with time zone | Yes | When the link was revoked; issuing a new link for the document revokes the old ones. |
| failed_attempts | smallint | No | Wrong access codes entered; the link locks at 5. |
| claimed_by | uuid | Yes | Person who claimed the link by signing in with its email.References app.people.id |
| claimed_at | timestamp with time zone | Yes | When it was claimed. |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |