Skip to main content
Create a project file and read it back, using write preconditions to protect existing content. Use a project you can edit and set an API credential. Project files contain source and definitions. Use uploads for separately stored assets such as images and PDFs.

1. Create a project file

Create a file with PUT /projects/{project_reference}/files/{file_path}:
create-file.sh

2. Read and update the file

Read it with GET /projects/{project_reference}/files/{file_path}:
read-file.sh
For an update, pass the returned version_id as expected_version_id, or use the returned checksum as expected_checksum. A 409 response means the precondition no longer matches. Read the latest content before retrying.

Verify the result

Confirm that the returned path and content match the file you wrote. For branch work, use the same branch selector for the read and write operations.

Upload an asset

The upload endpoint returns a signed file_upload_url and required_headers. Send the file bytes to that URL with all returned headers. Creating the URL alone does not upload the file. Provide the actual byte length in the upload request’s size field. See the upload operation below for its complete request and response.

API references