sxbin API Documentation

Authentication

All API requests require an API key to be sent in the X-API-Key header.

Endpoints

Upload File

POST /api/upload/file
Headers: 
  X-API-Key: your_api_key
Body: multipart/form-data
  file: (binary)
    

Returns: JSON with file URL and deletion URL

Upload Pastebin

POST /api/upload/pastebin
Headers:
  X-API-Key: your_api_key
  Content-Type: application/json
Body:
{
  "content": "Your pastebin content here"
}
    

Returns: JSON with pastebin URL and deletion URL

Shorten URL

POST /api/shorten
Headers:
  X-API-Key: your_api_key
  Content-Type: application/json
Body:
{
  "url": "https://example.com/your-long-url-here"
}
    

Returns: JSON with shortened URL and deletion URL

Error Handling

All errors are returned as JSON with an "error" field describing the issue.