API Reference

The 5sync API is a RESTful interface for managing your files, links, and account programmatically. All requests are made to the following base URL:

Base URL
https://5sync.com/v1

All responses are returned as JSON. Authentication is required for every request.

Authentication

Authenticate by including your API key in the Authorization header as a Bearer token. API keys start with the prefix sk_5s_.

Authorization Header
Authorization: Bearer sk_5s_...

You can generate and manage API keys from Settings → Developer → API Keys in your 5sync dashboard. Keep your keys secret and never expose them in client-side code.

Rate Limits

API rate limits depend on your plan. Limits are applied per API key on a rolling one-hour window.

Plan Requests / Hour
Starter 60
Plus 600
Business 6,000

Rate limit status is returned in every response via headers:

  • X-RateLimit-Limit — Maximum requests per hour
  • X-RateLimit-Remaining — Requests remaining in current window
  • X-RateLimit-Reset — Unix timestamp when window resets

When you exceed the limit, the API returns 429 Too Many Requests:

429 Response
{ "error": { "type": "rate_limit_exceeded", "message": "Rate limit exceeded. Try again in 42 seconds." } }

PUT /v1/files

Upload a single file. For files larger than 100 MB, use the Multipart Upload endpoint instead.

Parameter Type Required Description
file File required The file to upload (multipart/form-data)
path string optional Destination path (e.g. /documents)
encrypt boolean optional Enable encryption. Default: true
Example Request
curl -X PUT https://5sync.com/v1/files \ -H "Authorization: Bearer sk_5s_..." \ -F "file=@report.pdf" \ -F "path=/documents" \ -F "encrypt=true"
Response — 201 Created
{ "id": "f_8kx2m", "name": "report.pdf", "size": 1048576, "encrypted": true, "created": "2025-02-10T14:22:00Z" }

POST /v1/files/multipart

Upload large files in chunks using a three-step process: initialize, upload parts, then complete.

Step 1 — Initialize

POST /v1/files/multipart/init

Parameter Type Required Description
filename string required Name of the file being uploaded
size integer required Total file size in bytes
parts integer required Number of chunks to split the upload into
Response — 200 OK
{ "upload_id": "up_abc", "chunk_size": 5242880, "expires": "2025-02-10T15:22:00Z" }

Step 2 — Upload Part

PUT /v1/files/multipart/:upload_id/:part

Send the binary data for each chunk. The :part parameter is a zero-based index.

Response — 200 OK
{ "part": 0, "received": true }

Step 3 — Complete

POST /v1/files/multipart/:upload_id/complete

Once all parts are uploaded, finalize the multipart upload. The response returns the full file object.

Response — 201 Created
{ "id": "f_8kx2m", "name": "report.pdf", "size": 1048576, "encrypted": true, "created": "2025-02-10T14:22:00Z" }

GET /v1/files/:id

Retrieve metadata for a single file, or download the file contents.

Parameter Type Required Description
download boolean optional If true, returns the file binary instead of metadata
Example Request
curl https://5sync.com/v1/files/f_8kx2m \ -H "Authorization: Bearer sk_5s_..."
Response — 200 OK
{ "id": "f_8kx2m", "name": "report.pdf", "size": 1048576, "mime_type": "application/pdf", "path": "/documents", "encrypted": true, "versions": 3, "created": "2025-02-10T14:22:00Z", "modified": "2025-02-11T09:15:00Z" }

GET /v1/files

List files in your account with optional filtering, pagination, and sorting.

Parameter Type Required Description
path string optional Filter by directory path
page integer optional Page number (default: 1)
limit integer optional Items per page, max 100 (default: 20)
order_by string optional Sort field: name, created, size
Response — 200 OK
{ "items": [...], "total": 87, "page": 1, "limit": 20 }

DELETE /v1/files/:id

Permanently delete a file. This action cannot be undone.

Example Request
curl -X DELETE https://5sync.com/v1/files/f_8kx2m \ -H "Authorization: Bearer sk_5s_..."
Response — 200 OK
{ "deleted": true }

GET /v1/changes

Retrieve a feed of file events (created, modified, deleted) since a given timestamp. Useful for building sync clients.

Parameter Type Required Description
since string required ISO 8601 timestamp to fetch changes from
path string optional Filter changes to a specific directory path
Example Request
curl "https://5sync.com/v1/changes?since=2025-02-10T00:00:00Z" \ -H "Authorization: Bearer sk_5s_..."
Response — 200 OK
{ "events": [ { "id": "f_8kx2m", "action": "created", "timestamp": "2025-02-10T14:22:00Z" }, { "id": "f_9yz3n", "action": "modified", "timestamp": "2025-02-10T14:35:00Z" } ], "cursor": "c_next123", "has_more": false }

Errors

The API uses standard HTTP status codes. All error responses follow a consistent format:

Error Format
{ "error": { "type": "unauthorized", "message": "Invalid or expired API key." } }
Status Type Description
400 bad_request The request was malformed or missing required parameters
401 unauthorized Invalid or missing API key
403 forbidden API key does not have permission for this action
404 not_found The requested resource does not exist
429 rate_limit_exceeded Too many requests — see Rate Limits
500 internal_error Unexpected server error — please retry or contact support