Upload file
Creates or updates a file in a workspace.
Requirements:
- The
ref_idmust be a workspace ID - Requires a client ID header
File content options:
- Inline as binary data
- Via storage hints (storage_backend, storage_uri, sha1, size)
Parameters:
mode- specifies file permissionsmtime- sets the modification time
Validation: Reserved paths containing ‘.diversion’ are rejected.
Returns:
202 Acceptedon success204 No Contentif no change was made
Documentation Index
Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
This API uses OAuth 2 with the implicit grant flow
Headers
The unique id of the client making this request
Path Parameters
The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.
3 - 128"example_id"
An ID of a workspace, branch or commit.
3 - 128"example_id"
A path to a file inside the repository.
"/path/to/file"
Query Parameters
An optional storage type for async upload. One of: 1 - EFS, 2 - S3
1, 2 An optional storage uri to be sent along storage_backend. Coupled with storage_backend, a uri to storage location
"repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
The file mode (as Unix mode)
16877, 33188, 33261, 40960 The file's modification time in seconds since epoch
Blob size in bytes
A sha1 hexdigest
Body
Blob binary contents, if the file is a blob and if alternative storage solution was not used.
The body is of type file.
Response
File created or updated

