Skip to main content
POST
Create project file

Authorizations

Authorization
string
header
required

Authenticate with an API access token in the Authorization header: Authorization: Bearer <token>. Create a token from the API Access Tokens page in Contractors Cloud, under Integrations.

Path Parameters

projectId
integer
required

The id of the project.

Body

multipart/form-data

Multipart form fields for uploading a project file. Provide either file or url, not both. An uploaded image with no file_type_id is stored as a photo and accepts the photo-only fields below; any other upload is stored as a file and accepts the file-only fields below.

file
file

The file to upload. Required unless url is given. Max size 120 MB.

url
string<uri>

A URL to fetch and store the file from, instead of uploading it directly. Required when file is omitted.

file_type_id
integer | null

The id of the folder to file this upload into, from the file-type reference data (see List available options). File-only. Optional.

file_description_id
integer | null

The id of a company-configured description preset to apply. Photos and files. Optional.

caption
string

A short caption for the photo. Photo-only. Optional.

Maximum string length: 300
description
string

A longer description of the file. Photo-only. Optional.

is_cover_photo
boolean

Whether to make this photo the project's cover photo, clearing the flag from every other file on the project. Photo-only. Optional; defaults to false.

The type of record to link this file to. File-only. Optional. Allowed values: oppcon_id (contract), moid (material order), bille_id (bill), payment_id (payment), per_id (permit), woid (work order), vsid (vendor service), roofscope (RoofScope order), eagleview (EagleView order).

Available options:
oppcon_id,
moid,
bille_id,
payment_id,
per_id,
woid,
vsid,
roofscope,
eagleview

The id of the record to link this file to, matching related_to_type. Required when related_to_type is given. File-only.

is_sensitive
boolean

Whether to mark this file as financially sensitive, hiding it from users without financial visibility in your organization. File-only. Optional; defaults to false.

is_visible_on_customer_portal
boolean

Whether this file is visible to the customer through their customer portal. File-only. Optional.

Response

The created project file.

id
integer

The project file's unique identifier.

Example:

52130

tenant_id
integer

The id of your organization's account.

Example:

12

project_id
integer

The id of the project this file belongs to.

Example:

9103

created_by
integer | null

The id of the user who uploaded this file. Null if unknown.

Example:

1159

file_type_id
integer | null

The id of the folder this file is organized into, from the file-type reference data (see List available options). Null for photos and for files that aren't organized into any folder.

file_description_id
integer | null

The id of a company-configured description preset applied to this file. Null if none is set.

name
string

The file's name, including its extension.

Example:

"signed-contract.pdf"

mime_type
string

The file's MIME type.

Example:

"application/pdf"

size
integer

The file's size in bytes.

Example:

184320

caption
string | null

Caption text for the file. When not provided, it defaults to the file's description preset text, if one is set. Null otherwise.

description
string | null

A longer description of the file. Null if not set.

The type of record this file is linked to. See Create project file for the allowed values. Null if the file isn't linked to another record.

Example:

"oppcon_id"

The id of the linked record, matching related_to_type. Null if the file isn't linked to another record.

Example:

6203

is_sensitive
boolean

Whether this file is marked as financially sensitive. Sensitive files are hidden entirely from users without financial visibility in your organization.

Example:

false

is_visible_on_customer_portal
boolean

Whether this file is visible to the customer through their customer portal.

Example:

true

was_uploaded_from_vendor_portal
boolean

Whether this file was originally uploaded through the vendor portal rather than through Contractors Cloud directly.

Example:

false

is_visible_on_vendor_portal
boolean

Whether this file is visible on the vendor portal. Currently mirrors was_uploaded_from_vendor_portal — the two fields share the same underlying value.

Example:

false

is_cover_photo
boolean

Whether this file is the project's cover photo. Setting this to true automatically clears it from every other file on the project.

Example:

true

url
string | null

A permanent public link to the file's content. Null if the file content is unavailable.

Example:

"https://cdn.contractorscloud.com/projects/9103/files/signed-contract.pdf"

url_thumbnail
string | null

A permanent public link to a thumbnail image of the file. Only generated for photos; null for other files.

The display name of the linked record. Only included in the response when the request uses include=related; null if the file isn't linked to another record.

Example:

"Contract"

updated_at
string | null

Timestamp when the file was last updated, formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2025-02-11 10:10:00"