Skip to content

app.share_links

TableRow level security on

Links that open one version of a file without an account (Section 8.6): Public files may have a link without an expiry, Internal links need an expiry, Confidential links need an expiry, an access code and the recipient's email, and Restricted files never get one. The token and the code are returned once and stored only as hashes. Created through app.create_share_link, opened through api_public.open_share_link, revoked through app.revoke_share_link.

Primary key: id

Columns of app.share_links
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.attachments on insert; never accepted from the caller and never changed.References app.organizations.id
attachment_iduuidNoFile the link shares.References app.attachments.id
attachment_version_iduuidYesClean version the link opens, set by the database from the file's current version when the link is created.References app.attachment_versions.id
classificationapp.data_classificationNoClassification of the file when the link was created, set by the database. An open is refused once the file is raised to Restricted, or to Confidential when the link has no code.
token_hashbyteaNoSHA-256 of the link token, set by the database. The token is shown once and never stored.
access_code_requiredbooleanNoTrue when the link asks for a 6-digit access code. Always true for a Confidential file.
access_code_hashbyteaYesSHA-256 of the token, a colon and the access code, set by the database. Never readable by signed-in callers.
recipient_emailtextYesWho the link was made for, lowercased. Required for a Confidential file: the watermark names this address.
notetextYesWhat the link is for, as its creator described it.
expires_attimestamp with time zoneYesWhen the link stops opening: at most 90 days ahead, 30 for a Confidential file. NULL only for a Public file.
failed_attemptssmallintNoWrong access codes entered; the link locks at 5.
open_countintegerNoHow many times the link was opened successfully.
last_opened_attimestamp with time zoneYesWhen the link was last opened successfully.
revoked_attimestamp with time zoneYesWhen the link was revoked; a revoked link never opens again.
revoked_byuuidYesPerson who revoked the link.References app.people.id
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.