{"name":"Folio ZIP Collections API","version":"1","guides":{"llms":"https://folio.aicd.io/llms.txt","agentSkill":"https://folio.aicd.io/SKILL.md"},"capabilityRoutes":{"collection":"https://folio.aicd.io/folder/<token>/","document":"https://folio.aicd.io/folder/<token>/<url-encoded-path>","selection":"https://folio.aicd.io/folder/<token>/<url-encoded-path>?s=L<start>:L<end>","note":"A document URL opens that file but grants access to the entire collection."},"authentication":{"upload":"Uploads require a Folio account authenticated with Better Auth. Browser users sign in at /auth/sign-in; agents send X-Folio-Auth-Token: <Folio API key>.","capability":"After import, use Authorization: Bearer <capabilityToken> for collection reads, edits, diffs, and export. Replacements require both the capability bearer and X-Folio-Auth-Token."},"endpoints":[{"method":"POST","path":"/api/import","contentType":"multipart/form-data","limits":{"files":50,"expandedBytes":10485760,"archiveBytes":12582912,"expiryDays":{"default":7,"maximum":30}},"fields":{"archive":"ZIP file (required)","title":"string (optional)","expiresInDays":"integer from 1 to 30 (optional, defaults to 7)"},"returns":["capability token","share URL","collection metadata"]},{"method":"GET","path":"/api/collection","returns":"collection metadata, fixed expiration time, and changed flags"},{"method":"PATCH","path":"/api/collection","body":"{ title: string }","returns":"renamed collection metadata; expiry is immutable after upload"},{"method":"GET","path":"/api/file?path=<path>","returns":"current file bytes"},{"method":"PUT","path":"/api/file?path=<path>","body":"replacement text/Markdown/HTML bytes"},{"method":"GET","path":"/api/original?path=<path>","returns":"original uploaded file bytes"},{"method":"GET","path":"/api/diff","returns":"files modified from the uploaded baseline"},{"method":"GET","path":"/api/export","returns":"current edited collection as ZIP"},{"method":"GET","path":"/api/library","returns":"the signed-in user's projects and recent folio links"},{"method":"POST","path":"/api/library/projects","body":"{ name: string }","returns":"a new virtual project folder"},{"method":"PATCH","path":"/api/library/recents","body":"{ collectionId: string, projectId: string | null }","returns":"updated project assignment"}],"example":"curl -H \"X-Folio-Auth-Token: $FOLIO_AUTH_TOKEN\" -F archive=@plans.zip https://folio.aicd.io/api/import"}