API Documentation

Getting Started

This guide will help you get up and running with the CLE Engine API in minutes.

Prerequisites

Before you begin, you'll need:

  1. An API key (sign up at cle-engine.com)
  2. A tool to make HTTP requests (cURL, Postman, or your preferred programming language)

Step 1: Get Your API Key

  1. Create an account at cle-engine.com
  2. Navigate to Settings > API Keys
  3. Click Create New Key
  4. Copy your API key (format: cle_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

Important: Your API key is shown only once. Store it securely and never expose it in client-side code or public repositories.

Step 2: Make Your First Request

Test your API key with a simple health check:

curl -X GET \
  https://api.cle-engine.com/health

Expected response:

{
  "status": "ok"
}

Step 3: Calculate a CLE Deadline

Now let's make an authenticated request to calculate a CLE deadline:

curl -X POST \
  https://api.cle-engine.com/v1/compute \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cle_your_api_key_here" \
  -d '{
    "jurisdiction": "CA",
    "profession": "lawyer",
    "last_name": "Smith"
  }'

Expected response:

{
  "due_date": "2026-03-30",
  "cycle_start": null,
  "cycle_end": "2026-03-29",
  "credits_required": null,
  "reporting_group": "Group 3",
  "cle_required": true,
  "required_fields": ["last_name"],
  "missing_fields": [],
  "citations": [
    {
      "source_id": "ca_mcle_requirements",
      "url": "https://www.calbar.ca.gov/legal-professionals/maintaining-compliance/mcle/mcle-requirements"
    }
  ],
  "notes": "Compliance group assigned by last name."
}

Understanding the Response

FieldDescription
due_dateThe date by which CLE credits must be reported
cycle_startStart of the current compliance period
cycle_endEnd of the current compliance period
credits_requiredTotal credits required (when available)
reporting_groupThe attorney's assigned compliance group
cle_requiredWhether mandatory CLE applies (true, false, or null if unknown)
required_fieldsFields needed for accurate calculation
missing_fieldsRequired fields that were not provided
citationsOfficial sources supporting the calculation
notesHuman-readable explanation of the result

Step 4: Handle Missing Fields

Some jurisdictions require specific attorney information. If you omit required fields, the response will indicate what's missing:

curl -X POST \
  https://api.cle-engine.com/v1/compute \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cle_your_api_key_here" \
  -d '{
    "jurisdiction": "CA",
    "profession": "lawyer"
  }'

Response when last_name is missing:

{
  "due_date": null,
  "cycle_start": null,
  "cycle_end": null,
  "credits_required": null,
  "reporting_group": null,
  "cle_required": true,
  "required_fields": ["last_name"],
  "missing_fields": ["last_name"],
  "citations": [...],
  "notes": "Missing required fields for due date calculation: last_name."
}

Authentication

Header-Based Authentication

Include your API key in the X-API-Key header with every request:

X-API-Key: cle_your_api_key_here

API Key Format

Valid API keys follow this format:

  • Prefix: cle_
  • Length: 36 characters after prefix
  • Example: cle_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Security Best Practices

  1. Never expose your API key in client-side code, Git repositories, or logs
  2. Use environment variables to store your API key
  3. Rotate keys regularly through the dashboard
  4. Use separate keys for development and production

Example using environment variables:

# Set environment variable
export CLE_API_KEY="cle_your_api_key_here"

# Use in requests
curl -X POST \
  https://api.cle-engine.com/v1/compute \
  -H "X-API-Key: $CLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jurisdiction": "CA", "last_name": "Smith"}'

Next Steps