Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
Write file on a lease
Writes one file in the lease, at most 16 MiB, creating parent directories.
Writes one file in the lease, at most 16 MiB, creating parent directories.
- Path
POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:writeFile - Scope
sandboxes:exec - Effect
write— a successful call changes state. - Collection leases
#Request
| Field | Type | What it is |
|---|---|---|
name | string | The name of the lease. Required. |
path | string | The absolute path in the guest. Required. |
content | bytes | The file's bytes. Required. |
mode | int32 | The file mode bits; default 0644. |
append | bool | Append content to the file (created when absent) instead of replacing it, so a file larger than one call uploads in chunks. |
#Response
| Field | Type | What it is |
|---|---|---|
size_bytes | int64 | Bytes written. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_STATE— The Resource is in a state that forbids the call.IDEMPOTENCY_KEY_REUSED— An Idempotency-Key was reused with another body.IDEMPOTENCY_IN_PROGRESS— The first call with this Idempotency-Key is still running.
Every error arrives in the body Errors describes.
#Examples
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:writeFile" \
-H "Authorization: Bearer $SYLPHX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"…","path":"…"}'