All API resources
Files
Upload files and list them, to attach to journals.
Base URL https://app.prosaic.works/api/public/v1. Every request needs an API key or access token; see the overview.
List files
/api/public/v1/entities/{entityId}/filesSDK: prosaic.files.list(entityId, params)
Returns the entity's files, newest first: those filed under it or attached to it,
excluding deleted files. Use a file's id in fileIds when creating a journal
(POST /api/public/v1/entities/{entityId}/journals) or attaching files to one.
Requires API key authentication and entity access.
Path parameters
entityIdstringrequired
Query parameters
searchstringPart of the file name, matched in any case
limitintegerMost files to return
Default:
20
Responses
200 Successful response
dataarray of objectsrequiredShow 5 child attributesHide child attributes
idstringrequirednamestringrequiredcontentTypestringrequiredsizenumberrequiredcreatedAtstringrequired
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
400Invalid query parameters401Invalid or missing API key404Entity not found or not accessible
const { data } = await prosaic.files.list(entityId);curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/files \
-H "Authorization: Bearer $PROSAIC_API_KEY"Upload a file
/api/public/v1/entities/{entityId}/files/uploadSDK: prosaic.files.upload(entityId, file)
Uploads a file for an entity. Files must be validated against size (20MB) and type restrictions. Returns a fileId that can be used when creating or attaching to journals. Requires API key authentication and entity access.
Path parameters
entityIdstringrequired
Request body
multipart/form-data
filestring (binary)requiredThe file to upload (max 20MB). Accepted types — PDF, JPEG, PNG, GIF, WebP, CSV, plain text, Excel (XLS/XLSX), Word (DOC/DOCX), Outlook MSG.
Responses
201 Successful response
successbooleanrequiredfileobjectrequiredShow 6 child attributesHide child attributes
idstringrequiredfilenamestringrequirednamestringrequiredcontentTypestringrequiredsizenumberrequiredcreatedAtstringrequired
400Bad request - validation failed401Unauthorized - Invalid or missing API key403Forbidden - No access to the specified entity500Internal server error - Upload failed
const result = await prosaic.files.upload(entityId, file);curl -X POST https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/files/upload \
-H "Authorization: Bearer $PROSAIC_API_KEY" \
-F "file=@receipt.pdf"