Upload a file
POST/file
Upload a file to the Object Store.
Request
Query Parameters
When true, bypass the digest check and always write the file. Returns changed=true regardless of whether the content differs from the existing object.
- multipart/form-data
Body
required
The file to upload.
The name of the file in the Object Store.
Possible values: [raw, template]
Default value: raw
How the file should be treated during deploy. "raw" writes bytes as-is; "template" renders with Go text/template and agent facts.
The file content.
Responses
- 201
- 400
- 401
- 403
- 409
- 500
File uploaded successfully.
- application/json
- Schema
- Example (from schema)
Schema
The name of the uploaded file.
SHA-256 hash of the file content.
File size in bytes.
Whether the file content changed. False when the Object Store already held an object with the same SHA-256 digest.
How the file should be treated during deploy (raw or template).
{
"name": "nginx.conf",
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size": 1024,
"changed": true,
"content_type": "raw"
}
Invalid request payload.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Unauthorized - API key required
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Forbidden - Insufficient permissions
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
File already exists with different content. Use ?force=true to overwrite.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Error uploading file.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}