Files
Upload a file and attach it to a client, job or any other record, and list the files a record already has.
Files attached through the API appear in the same Files tabs your team uses in FieldCamp. There are two ways to add one.
| Way | Use it for | Limits |
|---|---|---|
| Upload, then attach | Any record: client, job, visit, request, estimate, invoice, or a custom object record. | 50 MB per file, listed content types only. |
| Direct multipart upload | A client's drive or a job's attachments, in one request. | 25 MB per file, 1–10 files per request. |
Upload, then attach
Three steps. Nothing is saved on the account until the last one.
POST /api/v1/files → PUT the bytes to upload_url → POST /api/v1/objects/{slug}/{id}/files
1. Start the upload
curl -X POST https://api.fieldcamp.ai/api/v1/files \
-H "Authorization: Bearer $FIELDCAMP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "site-photo.jpg",
"contentType": "image/jpeg",
"size": 482113
}'All three fields are required. size is the exact size in bytes.
The response:
| Field | Description |
|---|---|
upload_id | Pass this in step 3. Valid for 24 hours. |
upload_url | Where to send the bytes. Valid for 15 minutes; see expires_at. |
upload_method | Always PUT. |
upload_headers | Headers to send with the PUT: Content-Type and Content-Length. |
expires_at | When upload_url stops working. |
max_size | The size limit in bytes. |
2. Send the bytes
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: image/jpeg" \
--data-binary @site-photo.jpgThe URL accepts only the content type and size you declared in step 1. Do not send your API key to this URL.
3. Attach it to a record
curl -X POST https://api.fieldcamp.ai/api/v1/objects/job/$JOB_ID/files \
-H "Authorization: Bearer $FIELDCAMP_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "upload_id": "'"$UPLOAD_ID"'" }'{slug} is client, job, visit, request, estimate, invoice, or the
slug of a custom object. An optional
fileName in the body renames the file.
Attaching the same upload_id to the same record again returns the existing
file. Attaching it to a different record returns 409.
422 is returned when the upload_id is invalid or expired, when the bytes
have not been uploaded yet, or when the uploaded size differs from the size
you declared.
Accepted content types
| Kind | Types |
|---|---|
| Images | image/jpeg, image/png, image/gif, image/webp, image/heic, image/heif, image/svg+xml |
| Documents | application/pdf, text/plain, text/csv, application/json, Word, Excel and PowerPoint (.doc, .docx, .xls, .xlsx, .ppt, .pptx) |
| Archives | application/zip |
| Audio | audio/mpeg, audio/mp4, audio/wav, audio/x-wav, audio/webm, audio/ogg |
| Video | video/mp4, video/quicktime, video/webm |
Any other type returns 422.
List a record's files
GET /api/v1/objects/{slug}/{id}/files returns up to 500 files, newest first.
| Field | Description |
|---|---|
id | File ID. |
fileName | The file's name. |
contentType | The file's content type. |
size | Size in bytes. |
object, recordId | The record the file is attached to. |
download_url | A signed link to download the file. Valid for one hour. |
download_url_expires_at | When download_url stops working. |
createdAt, updatedAt | ISO-8601 timestamps. |
Call the list again for a fresh download_url when the old one has expired.
Direct multipart upload
Send multipart/form-data with one or more parts named files.
curl -X POST https://api.fieldcamp.ai/api/v1/jobs/$JOB_ID/files \
-H "Authorization: Bearer $FIELDCAMP_API_KEY" \
-F "files=@before.jpg" \
-F "files=@after.jpg"| Route | Where the file goes |
|---|---|
POST /api/v1/clients/{id}/files | The client's drive. Add a folderId form field to place it in one of that client's folders. |
POST /api/v1/jobs/{id}/files | The job's attachments. The file is stored in the client's drive, so the job must have a client. |
Each request takes 1 to 10 files of up to 25 MB each. An empty file is
refused. GET on the same paths lists the files, with id, fileName,
fileType, fileSize, folderId and createdAt. These lists carry no
download link; use GET /api/v1/objects/{slug}/{id}/files when you need one.
Scopes
| Route | Scope |
|---|---|
POST /api/v1/files | files:write |
GET /api/v1/objects/{slug}/{id}/files | files:read |
POST /api/v1/objects/{slug}/{id}/files | files:write |
GET, POST /api/v1/clients/{id}/files | clients:read, clients:write |
GET, POST /api/v1/jobs/{id}/files | jobs:read, jobs:write |
For a custom object record, the key also needs that object's own scope:
objects.<slug>:read to list and objects.<slug>:write to attach, or the
broader objects:read and objects:write.
Endpoints
/api/v1/filesAuthorization
ApiKeyAuth Public API key: Authorization: Bearer fc_live_… (or X-Api-Key). fc_test_… keys work only on sandbox accounts. Scoped keys work on /api/v1 only.
In: header
Header Parameters
Replays the stored response for 24 h per org; a different body with the same key → 409.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/files" \ -H "Content-Type: application/json" \ -d '{ "fileName": "string", "contentType": "string", "size": 52428800 }'{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/objects/{slug}/{id}/filesAuthorization
ApiKeyAuth Public API key: Authorization: Bearer fc_live_… (or X-Api-Key). fc_test_… keys work only on sandbox accounts. Scoped keys work on /api/v1 only.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/objects/string/string/files"{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/objects/{slug}/{id}/filesAuthorization
ApiKeyAuth Public API key: Authorization: Bearer fc_live_… (or X-Api-Key). fc_test_… keys work only on sandbox accounts. Scoped keys work on /api/v1 only.
In: header
Path Parameters
Header Parameters
Replays the stored response for 24 h per org; a different body with the same key → 409.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/objects/string/string/files" \ -H "Content-Type: application/json" \ -d '{ "upload_id": "string" }'{ "success": true, "code": "success.created", "message": "Client created successfully", "data": null}/api/v1/clients/{id}/filesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/clients/665f1c2ab3e4d5f6a7b8c9d0/files"{}/api/v1/clients/{id}/filesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/clients/665f1c2ab3e4d5f6a7b8c9d0/files" \ -F files="[ \"string\" ]"{}/api/v1/jobs/{id}/filesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/jobs/665f1c2ab3e4d5f6a7b8c9d0/files"{}/api/v1/jobs/{id}/filesAuthorization
BearerAuth JWT from POST /api/auth/login (response.data.token). Tokens do not expire.
In: header
Path Parameters
Request Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/jobs/665f1c2ab3e4d5f6a7b8c9d0/files" \ -F files="[ \"string\" ]"{}