Skip to Content
API and MCPResources

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.

WayUse it forLimits
Upload, then attachAny record: client, job, visit, request, estimate, invoice, or a custom object record.50 MB per file, listed content types only.
Direct multipart uploadA 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:

FieldDescription
upload_idPass this in step 3. Valid for 24 hours.
upload_urlWhere to send the bytes. Valid for 15 minutes; see expires_at.
upload_methodAlways PUT.
upload_headersHeaders to send with the PUT: Content-Type and Content-Length.
expires_atWhen upload_url stops working.
max_sizeThe size limit in bytes.

2. Send the bytes

curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/jpeg" \
  --data-binary @site-photo.jpg

The 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

KindTypes
Imagesimage/jpeg, image/png, image/gif, image/webp, image/heic, image/heif, image/svg+xml
Documentsapplication/pdf, text/plain, text/csv, application/json, Word, Excel and PowerPoint (.doc, .docx, .xls, .xlsx, .ppt, .pptx)
Archivesapplication/zip
Audioaudio/mpeg, audio/mp4, audio/wav, audio/x-wav, audio/webm, audio/ogg
Videovideo/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.

FieldDescription
idFile ID.
fileNameThe file's name.
contentTypeThe file's content type.
sizeSize in bytes.
object, recordIdThe record the file is attached to.
download_urlA signed link to download the file. Valid for one hour.
download_url_expires_atWhen download_url stops working.
createdAt, updatedAtISO-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"
RouteWhere the file goes
POST /api/v1/clients/{id}/filesThe client's drive. Add a folderId form field to place it in one of that client's folders.
POST /api/v1/jobs/{id}/filesThe 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

RouteScope
POST /api/v1/filesfiles:write
GET /api/v1/objects/{slug}/{id}/filesfiles:read
POST /api/v1/objects/{slug}/{id}/filesfiles:write
GET, POST /api/v1/clients/{id}/filesclients:read, clients:write
GET, POST /api/v1/jobs/{id}/filesjobs: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

POST/api/v1/files

Authorization

ApiKeyAuth
AuthorizationBearer <token>

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

Idempotency-Key?string

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}
GET/api/v1/objects/{slug}/{id}/files

Authorization

ApiKeyAuth
AuthorizationBearer <token>

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

slug*string
id*string

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}
POST/api/v1/objects/{slug}/{id}/files

Authorization

ApiKeyAuth
AuthorizationBearer <token>

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

slug*string
id*string

Header Parameters

Idempotency-Key?string

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}
GET/api/v1/clients/{id}/files

Authorization

BearerAuth
AuthorizationBearer <token>

JWT from POST /api/auth/login (response.data.token). Tokens do not expire.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/clients/665f1c2ab3e4d5f6a7b8c9d0/files"
{}
POST/api/v1/clients/{id}/files

Authorization

BearerAuth
AuthorizationBearer <token>

JWT from POST /api/auth/login (response.data.token). Tokens do not expire.

In: header

Path Parameters

id*string

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\"  ]"
{}
GET/api/v1/jobs/{id}/files

Authorization

BearerAuth
AuthorizationBearer <token>

JWT from POST /api/auth/login (response.data.token). Tokens do not expire.

In: header

Path Parameters

id*string

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/api/v1/jobs/665f1c2ab3e4d5f6a7b8c9d0/files"
{}
POST/api/v1/jobs/{id}/files

Authorization

BearerAuth
AuthorizationBearer <token>

JWT from POST /api/auth/login (response.data.token). Tokens do not expire.

In: header

Path Parameters

id*string

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\"  ]"
{}

On this page