Skip to main content

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:

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

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

Authentication failures return HTTP 401 with the code UNAUTHORIZED. The message field describes the specific cause.

Missing API Key

Status Code: 401 Unauthorized

Invalid API Key

Status Code: 401 Unauthorized

Disabled API Key

Status Code: 401 Unauthorized

Environment Variables

Store your API key securely using environment variables: