Authentication

The Cronhost API uses API key authentication. All requests must include a valid API key in the request headers.

API Key Header

Include your API key in the x-api-key header:

x-api-key: your-api-key-here

Getting Your API Key

  1. Log in to your Cronhost dashboard
  2. Navigate to Settings
  3. Create a new API key or copy an existing one

Example Request

curl -X GET "https://cronho.st/api/v1/schedules" \
  -H "x-api-key: your-api-key-here" \
  -H "Content-Type: application/json"

Security Best Practices

  • Never expose API keys in client-side code, public repositories, or logs
  • Use environment variables to store API keys in your applications
  • Rotate keys regularly for enhanced security
  • Use different keys for different environments (development, staging, production)
  • Revoke unused keys from your dashboard

Error Responses

Missing API Key

{
  "error": {
    "message": "API key is required",
    "code": "MISSING_API_KEY"
  }
}

Status Code: 401 Unauthorized

Invalid API Key

{
  "error": {
    "message": "Invalid API key",
    "code": "INVALID_API_KEY"
  }
}

Status Code: 401 Unauthorized

Expired API Key

{
  "error": {
    "message": "API key has expired",
    "code": "EXPIRED_API_KEY"
  }
}

Status Code: 401 Unauthorized

Environment Variables

Store your API key securely using environment variables:

CRONHOST_API_KEY=your-api-key-here