Write a file
Create or overwrite a file on your server from text or base64 content. No multipart needed — just send JSON.
POST Endpoint
POST https://pushftp.com/api/write/{connectionId}Write a text file
curl -X POST https://pushftp.com/api/write/YOUR_CONNECTION_ID \
-H "Authorization: Bearer pftp_your_key" \
-H "Content-Type: application/json" \
-d '{
"path": "/config/settings.json",
"content": "{\"debug\": true, \"version\": 2}",
"encoding": "text"
}'Log in to see your real API key and connection IDs here.
pathrequiredFull remote path including filenamecontentrequiredFile contents as text or base64 stringencodingoptional"text" (default) or "base64"Write a binary file (base64)
curl -X POST https://pushftp.com/api/write/YOUR_CONNECTION_ID \
-H "Authorization: Bearer pftp_your_key" \
-H "Content-Type: application/json" \
-d '{
"path": "/images/logo.png",
"content": "iVBORw0KGgoAAAANSUhEUg...",
"encoding": "base64"
}'Log in to see your real API key and connection IDs here.
Response
{
"success": true,
"transfer": {
"id": "abc123",
"filename": "settings.json",
"path": "/config/settings.json",
"size": 32,
"durationMs": 180,
"connection": { "id": "xyz789", "name": "Production SFTP", "type": "sftp" }
}
}Notes
- Creates the file if it doesn't exist, overwrites if it does.
- For large files or actual file uploads, use the Upload endpoint instead.
- Counts as 1 action toward your monthly limit.