API Documentation

Complete REST API reference for integrating VStorage into your applications.

API Status

This is API documentation for our planned VStorage API. The API endpoints shown here represent our intended functionality and will be available when we launch our full service. Currently, this is documentation only - the actual API endpoints are not yet live.

Base URL

https://api.vstorage.ch/v1

Authentication

All API requests require authentication using a Bearer token in the Authorization header.

curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.vstorage.ch/v1/files

API Key

Generate your API key from the dashboard settings.

Rate Limits

1000 requests per hour per API key.

GET

/files

Retrieve a list of files in your account.

curl -H "Authorization: Bearer YOUR_API_KEY" \
     "https://api.vstorage.ch/v1/files?limit=50&offset=0"

Query Parameters

Parameter Type Description
limit integer Number of files to return (max 100)
offset integer Number of files to skip
tags string Filter by tags (comma-separated)
POST

/files/upload

Upload a new file to your account.

curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -F "file=@document.pdf" \
     -F "name=My Document" \
     -F "tags=work,important" \
     https://api.vstorage.ch/v1/files/upload

Request Body (multipart/form-data)

Field Type Required Description
file file Yes The file to upload
name string No Custom name for the file
tags string No Comma-separated tags
GET

/files/{id}/download

Download a file by its ID.

curl -H "Authorization: Bearer YOUR_API_KEY" \
     "https://api.vstorage.ch/v1/files/123/download" \
     -o downloaded_file.pdf
POST

/files/{id}/share

Create a secure share link for a file.

curl -X POST \
     -H "Authorization: Bearer YOUR_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{
       "permissions": ["read"],
       "expires_at": "2024-12-31T23:59:59Z",
       "password": "optional_password"
     }' \
     https://api.vstorage.ch/v1/files/123/share

Request Body (JSON)

Field Type Required Description
permissions array Yes Array of permissions: ["read", "download"]
expires_at string No ISO 8601 timestamp when link expires
password string No Optional password protection

Response Examples

Success Response

{
  "success": true,
  "data": {
    "id": "123",
    "name": "document.pdf",
    "size": 1024000,
    "mime_type": "application/pdf",
    "created_at": "2024-01-15T10:30:00Z",
    "tags": ["work", "important"],
    "download_url": "https://api.vstorage.ch/v1/files/123/download"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid or expired",
    "details": {}
  }
}

Need an SDK?

We provide official SDKs for popular programming languages to make integration easier.