Back to Home

API Documentation

Complete reference for the FiveHost API. All endpoints require authentication via the X-API-Key header unless otherwise noted.

Authentication

POST/api/auth/register

Register a new user account with a purchase key.

Request Body

ParameterTypeRequiredDescription
usernamestringYesUnique username
emailstringYesValid email address
purchaseKeystringYesValid purchase key

Response

{
  "success": true,
  "apiKey": "fh_xxxxx",
  "username": "johndoe",
  "expiresAt": "2024-12-31T23:59:59Z",
  "maxUploads": 1000
}
POST/api/validate

Validate an API key and get user information.

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

File Operations

POST/api/upload

Upload a file. Requires multipart/form-data.

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key

Form Data

FieldTypeRequiredDescription
fileFileYesFile to upload

Response

{
  "success": true,
  "embedUrl": "https://example.com/u/abc123",
  "rawUrl": "https://example.com/raw/abc123",
  "flippedId": "abc123",
  "filename": "image.png",
  "filesize": 12345
}
GET/api/uploads

List all uploads for the authenticated user with pagination.

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber50Items per page (max 100)

Response

{
  "uploads": [
    {
      "flipped_id": "abc123",
      "filename": "image.png",
      "filesize": 12345,
      "mimetype": "image/png",
      "created_at": "2024-01-01T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 100,
    "totalPages": 2
  }
}
DELETE/api/delete

Delete an uploaded file.

Request Body

ParameterTypeRequiredDescription
flippedIdstringYesThe flipped ID of the file

Embed Configuration

GET/api/embed-config

Get current embed configuration settings.

PATCH/api/embed-config

Update embed configuration settings.

Request Body

ParameterTypeRequiredDescription
embedColorstringNoHex color code (e.g., #3b82f6)
embedTitleFormatstringNoTitle format. Use {username} and {filename} placeholders

File Access

GET/u/{flippedId}

View file embed page with metadata and preview.

GET/raw/{flippedId}

Get raw file content for direct download or embedding.