API Reference

API Getting Started

Learn how to integrate with the Caring CourseForge API for programmatic access

The Caring CourseForge API allows you to programmatically create, update, and manage courses, students, and analytics. This guide will get you started with the API.

ℹ️
Feature Availability:

API access is available on Professional and Enterprise plans.View pricing

API Overview

Base URL:https://courseforge.caringai.app/api/v1
Protocol:HTTPS only
Authentication:API Key (Header-based)
Response Format:JSON
Rate Limits:1,000 req/hr (Professional), 10,000 req/hr (Enterprise)

Getting API Credentials

Step-by-Step

  1. Upgrade to Professional or Enterprise plan
  2. Log into your Caring CourseForge account
  3. Navigate to Settings → API Keys
  4. Click "Create API Key"
  5. Give your key a descriptive name (e.g., "Production Server")
  6. Select environment (Production, Development, or Staging)
  7. Click "Create API Key"
  8. Copy and securely store your API key immediately (shown only once!)

Your API key will have the format: cf_prod_abcd1234...

⚠️
Security Warning:

Never commit API keys to version control. Use environment variables and secret management tools. Rotate keys regularly and immediately revoke compromised keys.

Making Your First Request

Example: List Your Courses

Use your API key in the Authorization header with Bearer prefix:

curl https://courseforge.caringai.app/api/v1/courses \
  -H "Authorization: Bearer cf_prod_YOUR_API_KEY" \
  -H "Content-Type: application/json"

Alternatively, you can use the X-API-Key header:

curl https://courseforge.caringai.app/api/v1/courses \
  -H "X-API-Key: cf_prod_YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

{
  "data": [
    {
      "id": "course_abc123",
      "title": "Introduction to Python",
      "description": "Learn Python basics...",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-10-10T14:22:00Z",
      "published": true,
      "enrollment_count": 247
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 15,
    "total_pages": 1
  }
}

Available Endpoints

Courses

GET /courses - List all courses
POST /courses - Create a new course
GET /courses/:id - Get course details
PUT /courses/:id - Update a course
DELETE /courses/:id - Delete a course

Modules & Lessons

GET /courses/:id/modules - List modules
POST /courses/:id/modules - Create module
GET /modules/:id/lessons - List lessons
POST /modules/:id/lessons - Create lesson

Students

GET /students - List students
POST /students - Create student
GET /students/:id/progress - Get progress
POST /enrollments - Enroll student in course

Analytics

GET /courses/:id/analytics - Course analytics
GET /students/:id/analytics - Student analytics
GET /analytics/quiz-results - Quiz performance

SDK Libraries

Official SDKs for popular languages:

JavaScript/Node.js

npm install @caringcourseforge/sdk

Python

pip install caringcourseforge

PHP

composer require caringcourseforge/sdk

Error Handling

Standard Error Response

{
  "error": {
    "code": "resource_not_found",
    "message": "Course with ID 'xyz' not found",
    "details": {},
    "request_id": "req_abc123"
  }
}
HTTP Status Codes:
  • 200 OK - Request successful
  • 201 Created - Resource created
  • 400 Bad Request - Invalid parameters
  • 401 Unauthorized - Invalid or missing API key
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource doesn't exist
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Server Error - Internal server error

Best Practices

API Usage Guidelines:
  • Use pagination for large result sets
  • Implement exponential backoff for retries
  • Cache responses when appropriate
  • Use webhooks instead of polling for real-time updates
  • Version your API integrations
  • Monitor your rate limit usage
  • Handle errors gracefully

What's Next?