All API resources
API reference

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

GET/api/public/v1/entities/{entityId}/files

SDK: 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

  • searchstring

    Part of the file name, matched in any case

  • limitinteger

    Most files to return

    Default: 20

Responses

200 Successful response

  • dataarray of objectsrequired
    Show 5 child attributes
    • idstringrequired
    • namestringrequired
    • contentTypestringrequired
    • sizenumberrequired
    • createdAtstringrequired
  • metaobject
    Show 1 child attribute
    • countnumberrequired
  • 400 Invalid query parameters
  • 401 Invalid or missing API key
  • 404 Entity not found or not accessible
Node SDK
const { data } = await prosaic.files.list(entityId);
curl
curl https://app.prosaic.works/api/public/v1/entities/$ENTITY_ID/files \
  -H "Authorization: Bearer $PROSAIC_API_KEY"

Upload a file

POST/api/public/v1/entities/{entityId}/files/upload

SDK: 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)required

    The 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

  • successbooleanrequired
  • fileobjectrequired
    Show 6 child attributes
    • idstringrequired
    • filenamestringrequired
    • namestringrequired
    • contentTypestringrequired
    • sizenumberrequired
    • createdAtstringrequired
  • 400 Bad request - validation failed
  • 401 Unauthorized - Invalid or missing API key
  • 403 Forbidden - No access to the specified entity
  • 500 Internal server error - Upload failed
Node SDK
const result = await prosaic.files.upload(entityId, file);
curl
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"