How do I upload documents through the API?
| Request | What it does |
|---|---|
GET /folders | Every folder, with its path. |
POST /folders | Make a folder: name, and parent_id to put it inside another. |
GET /documents | Your documents. ?folder_id= for one folder, or ?folder_id=root for those outside any folder. |
GET /documents/{id} | One document, with how investors read it. |
POST /documents | Upload a document. |
POST /documents/{id}/versions | Upload a new version of it. |
DELETE /documents/{id} | Delete it. Investors lose access at once. |
Uploads are sent as a form (multipart/form-data), not JSON:
curl https://galley.1936ai.com/api/v1/documents \
-H "Authorization: Bearer $GALLEY_API_KEY" \
-F "file=@deck.pdf" \
-F "name=Pitch deck" \
-F "folder_id=…"
Only file is needed: the name is the file's own if you leave it out, and you can add a description. The same files and sizes are allowed as in Galley (see which files can I upload?), and investors with access to the folder see the document at once. A new version takes file and a note on what changed.
Each document has id, name, description, folder_id, content_type, size_bytes, version, key_document, created_at, updated_at, and stats: investors' opens (days they opened it), investors_opened, seconds and downloads.