Database reference
The exact tables and columns the Knowledge Docs API reads and writes.
Identity mapping
Libraries, documents, and assignments all use UUID primary keys as their public identifier — there is no separate numeric id exposed for any of them. knowledge_article_shares has no synthetic id at all: it is a pure pivot table keyed on (knowledge_article_id, shared_with_user_id), so a document can only be shared with a given user once (re-sharing updates the existing row).
Pending invites live elsewhere
An invite sent to an email with no existing account is not stored in knowledge_article_shares at all — it goes into a separate pending-invites table (shared with the Agents module's own email-sharing) keyed by shareable type/id/email, and converts into a real knowledge_article_shares row automatically the moment that email registers under the document's organization.