Base URL

All API requests are made to:

https://api.vslstats.com/v1

All requests and responses use JSON. Set the Content-Type: application/json and Accept: application/json headers on all requests.

Authentication

The VSLStats API uses Bearer token authentication. Generate an API key from your account settings:

  1. Go to Settings → API Keys.
  2. Click Generate New Key. Give it a descriptive label (e.g., "Zapier integration" or "Custom dashboard").
  3. Copy the key immediately - it's only shown once for security. Store it in your password manager or secrets vault.
  4. Include the key in every request as an Authorization header.
# Example: authenticated request using curl
curl -X GET https://api.vslstats.com/v1/projects \
  -H "Authorization: Bearer vsl_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Accept: application/json"
Security: Never expose your API key in client-side JavaScript or public repositories. Use environment variables or a secrets manager. If a key is compromised, revoke it immediately from Settings → API Keys and generate a new one.

Your First Request

List all projects in your workspace:

GET /v1/projects

// Response
{
  "data": [
    {
      "id": "proj_abc123",
      "name": "Main VSL - Product Launch",
      "created_at": "2025-08-01T10:00:00Z",
      "video_count": 3
    }
  ],
  "meta": { "total": 1, "page": 1 }
}

Available Endpoints

Projects

Videos

Analytics

Analytics endpoints accept start_date and end_date query parameters (ISO 8601 format) to filter by date range.

Conversions

Webhooks

VSLStats can send webhook notifications to your server when key events occur. This allows real-time integrations - for example, triggering a CRM update when a video is completed.

Registering a Webhook

POST /v1/webhooks
{
  "url": "https://yourdomain.com/vslstats-webhook",
  "events": ["video.play", "video.complete", "conversion.created"]
}

Available Webhook Events

Verifying Webhook Signatures

Each webhook payload includes an X-VSLStats-Signature header - an HMAC-SHA256 signature of the raw request body using your webhook secret. Always verify this signature before processing the payload.

# Python example
import hmac, hashlib

def verify_signature(payload_body, secret, signature_header):
    expected = hmac.new(
        secret.encode(), payload_body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature_header)

Rate Limits

The API enforces the following rate limits per API key:

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (Unix timestamp when the window resets).

If you exceed the rate limit, you'll receive a 429 Too Many Requests response. Implement exponential backoff in your client to handle this gracefully.

Need higher limits? Agency plan users can request elevated rate limits by contacting support@vslstats.com with your use case. Custom limits are available for high-volume integrations.

SDKs & Libraries

Official SDKs are in development for Node.js and Python. In the meantime, the API is straightforward to use with any HTTP client. Full OpenAPI / Swagger documentation is available at https://api.vslstats.com/v1/docs for auto-generating client code in your language of choice.