Skip to main content

Overview

The Solarecliente API uses API keys for authentication. You can generate and manage your API keys from the dashboard.
Keep your API keys secure and never share them publicly. Treat them like passwords.

Authentication Methods

API Key Authentication

Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY

Example Request

curl -X GET https://api.solarecliente.com/v1/clients \
  -H "Authorization: Bearer sk_live_abc123xyz789" \
  -H "Content-Type: application/json"

API Key Types

Test Keys

Used for development and testing. Prefix: sk_test_

Live Keys

Used for production. Prefix: sk_live_

Generating API Keys

  1. Log in to your Solarecliente dashboard
  2. Navigate to Settings > API Keys
  3. Click Generate New Key
  4. Select the key type (Test or Live)
  5. Assign appropriate permissions
  6. Copy and securely store your key
API keys are only displayed once upon creation. Make sure to save them securely.

API Key Permissions

You can configure granular permissions for each API key:

Security Best Practices

Rotate Keys Regularly

Update your API keys periodically for enhanced security

Use Environment Variables

Store keys in environment variables, never in code

Restrict Permissions

Grant only the minimum required permissions

Monitor Usage

Review API key usage logs regularly

Error Responses

Missing Authentication

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "No API key provided"
  }
}

Invalid API Key

{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid or has been revoked"
  }
}

Insufficient Permissions

{
  "success": false,
  "error": {
    "code": "FORBIDDEN",
    "message": "Your API key does not have permission to perform this action"
  }
}

Revoking API Keys

To revoke an API key:
  1. Go to Settings > API Keys
  2. Find the key you want to revoke
  3. Click Revoke
  4. Confirm the action
Revoking an API key immediately invalidates all requests using that key.

Build docs developers (and LLMs) love