Auth & Basic Usage

Learn how to authenticate with the easyCDN HTTP API and make your first requests using curl, JavaScript, or any HTTP client.

Authentication

The easyCDN HTTP API uses Bearer token authentication. You'll need to include your secret API key in the Authorization header for every request.

Base URL

All API requests should be made to:

text
https://api.easycdn.co

Getting Your API Key

  1. Log in to your easyCDN dashboard
  2. Navigate to API Settings
  3. Copy your Secret Key
  4. Store it securely in your environment variables

Authentication Header

Include your API key in the Authorization header with the Bearer prefix:

text
Authorization: Bearer YOUR_SECRET_KEY

Content Type

Most API endpoints expect JSON data, so include the Content-Type header:

text
Content-Type: application/json

Example Request

bash
curl -X GET https://api.easycdn.co/health \
  -H "Authorization: Bearer ${EASYCDN_SECRET_KEY}"

Security Best Practice

Never expose your secret API key in client-side code or version control. Always use environment variables and make API calls from your server.

Basic Usage

The easyCDN HTTP API provides direct endpoints for managing your assets. Here are common usage patterns and examples.

Making Your First Request

Start with a simple health check to verify your setup:

bash
curl -X GET https://api.easycdn.co/health \
  -H "Authorization: Bearer ${EASYCDN_SECRET_KEY}"

This should return a JSON response with "status": "ok" if everything is working correctly.

Common Usage Patterns

The easyCDN API follows RESTful conventions and is designed for:

  • Asset Management- Upload, persist, and delete files
  • Project Operations- Create and manage projects
  • Analytics & Stats- Access usage metrics and insights