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
- Upgrade to Professional or Enterprise plan
- Log into your Caring CourseForge account
- Navigate to Settings → API Keys
- Click "Create API Key"
- Give your key a descriptive name (e.g., "Production Server")
- Select environment (Production, Development, or Staging)
- Click "Create API Key"
- 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 coursesPOST /courses
- Create a new courseGET /courses/:id
- Get course detailsPUT /courses/:id
- Update a courseDELETE /courses/:id
- Delete a courseModules & Lessons
GET /courses/:id/modules
- List modulesPOST /courses/:id/modules
- Create moduleGET /modules/:id/lessons
- List lessonsPOST /modules/:id/lessons
- Create lessonStudents
GET /students
- List studentsPOST /students
- Create studentGET /students/:id/progress
- Get progressPOST /enrollments
- Enroll student in courseAnalytics
GET /courses/:id/analytics
- Course analyticsGET /students/:id/analytics
- Student analyticsGET /analytics/quiz-results
- Quiz performanceSDK 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 successful201 Created
- Resource created400 Bad Request
- Invalid parameters401 Unauthorized
- Invalid or missing API key403 Forbidden
- Insufficient permissions404 Not Found
- Resource doesn't exist429 Too Many Requests
- Rate limit exceeded500 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