API Documentation

The YuuCDN REST API lets you programmatically manage your files, folders, analytics, subscriptions and more. All endpoints are prefixed with:

text
https://api.yuucdn.org/api/v4
Base URL note: The base URL above is read from NEXT_PUBLIC_API_URL. In production it points to your deployed API server.

Authentication

Every request must include your API key in the X-Api-Key header. You can retrieve or regenerate your API key from the API Keys page in your dashboard.

Header

http
X-Api-Key: YOUR_API_KEY

curl Example

bash
curl -H "X-Api-Key: YOUR_API_KEY" \
  https://api.yuucdn.org/api/v4/files
Keep your key secret. Never expose your API key in client-side code or public repositories. Regenerate it immediately if you suspect it has been compromised.

Response Format

All responses follow a consistent JSON envelope. Paginated endpoints include a meta field.

json
{
  "success": true,
  "data": "...",
  "message": "OK",
  "meta": {
    "page": 1,
    "page_size": 20,
    "total_pages": 5,
    "total_items": 92
  },
  "timestamp": "2026-04-01T10:00:00+07:00",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "...",
    "details": []
  }
}
FieldTypeDescription
successbooleantrue on success, false on error
dataany | nullThe response payload
messagestringHuman-readable status message
metaobject?Pagination info (page, page_size, total_pages, total_items). Present on list endpoints.
timestampstringISO 8601 server timestamp
errorobject?Present on error responses: code, message, details

Files

Manage files: list, upload, move, and delete.

Folders

Create, read, update, and delete folders to organise your files.

Dashboard

Aggregate statistics for the authenticated user.

Roles

Retrieve available subscription plans (roles).

Subscriptions

View your active subscription and subscription history.

Transactions

Create and manage payment transactions.

Analytics

CDN request statistics and per-request logs for your files.