POST /rest/v1.1/projects/{project_id}/uploads
Creating an Upload is the first step in associating a file to a resource in Procore. Creating an Upload can be seen as fetching instruction on how to post your file directly to Procore's storage service.
The instructions contain three properties: a UUID to reference the Upload, a URL which has to be used to post the file, and fields which need to be posted together with the file.
To upload the file you must POST to the URL in the url property with a multipart/form-data body (see RFC 2388). Make sure to include all the names and values from fields without altering them. The URL and fields necessary to complete the upload may vary between companies and may also change over time so none of these may be hard-coded. Finally add a field named file with the actual file data.
Uploads are associated to the Company that owns the project so they can use company specific upload settings. The currently authenticated user will become the owner of the Upload and only that user can use the Upload in subsequent requests.
You will have to initiate the upload within one hour or you can expect a 403 Forbidden response. Other errors are usually clearly explained in the response body.
For an example of how to associate a finalized upload to another resource in Procore see the Photos resource. An Upload will have to be associated to another resource within a week or it will be automatically deleted from Procore servers.
Note that there is also a variant of this API endpoint that works using a Company ID.
Servers
- https://api.procore.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
project_id |
Integer | Yes |
Unique identifier for the project. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Procore-Company-Id |
Integer | Yes |
Unique company identifier associated with the Procore User Account. |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
size |
Integer | No |
File size in bytes |
response_filename |
String | Yes |
By setting a filename you ensure that the storage service knows the filename of the upload. Files are often downloaded directly from the storage service and without the filename they will save on the end users' device without a readable name or extension. |
attachment_content_disposition |
Boolean | No |
The content type set through this parameter will be used by the storage system during download, similar to the response_filename. When set to true, the file will be downloaded as an attachment. Otherwise, the file content will be rendered inline in the browser. |
segments[] |
Array | No |
Upload segments |
segments[].md5 |
String | No |
MD5 checksum of the file segment |
segments[].size |
Integer | Yes |
Segment file size in bytes |
segments[].etag |
String | No |
Entity tag. Hash of S3 object |
segments[].sha256 |
String | Yes |
SHA-256 hash of the file segment |
response_content_type |
String | No |
The content-type set through this parameter will be used by the storage service during download just like the response_filename. Setting this value is less important because HTTP clients and operating systems are generally well equipped to determine file types. Setting this parameter is optional and should only be included when you are certain it's correct or when you want to force a content-type other than what the filename extension suggests. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.