Skip to Content
HelvetlyDocs
API referenceClients

Upload files to a client

Needs a token with the write:clients scope. Authentication

Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.

POST
/api/v1/clients/{id}/files

Attaches 1 to 10 files (up to 20 MB each; PDF, PNG, JPEG, WebP, Excel, Word, CSV or text, checked from the bytes) sent as multipart/form-data in files[]. The SHA-256 of the bytes is compared workspace-wide: a file already in Documents is linked to the client instead of stored again (the original name, uploader and id are returned, so retrying is safe); a file that is already an expense receipt, or two identical files in one batch, are refused with 409 duplicate_file (details existing_id, existing_name, resource when you may see it). Nothing is stored when any file is refused. Other errors: 413 payload_too_large, 422 validation_failed on files (none, too many, too large, unsupported type), 404 unknown client. 201 returns the files in upload order.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token, hvt_…, with scopes such as read:* or write:invoices

Path Parameters

id*string

The client's id.

Request Body

multipart/form-data
  1. body
files[]*array<>

1 to 10 files of up to 20 MB each: PDF, PNG, JPEG, WebP, Excel, Word, CSV or text. The type is checked from the bytes, not the name.

Response Body

Created

application/json
  1. response
data*array<>
Example Request
curl -X POST 'https://app.helvetly.com/api/v1/clients/string/files' \  -F 'files[]=[  "string"]'
Example Response
{  "data": [    {      "id": "string",      "name": "string",      "size": 0,      "content_type": "string",      "created_at": "2019-08-24T14:15:22Z",      "uploaded_by": {        "id": "string",        "name": "string"      }    }  ]}