CourseLayer Logo

Quick Reference

Quick reference guide for CourseLayer API

Quick Reference

A quick overview of all available API endpoints.

Authentication

MethodEndpointDescriptionAuth Required
POST/api/loginLogin user and get access tokenNo
POST/api/logoutLogout from all devicesYes
POST/api/v1/registerRegister new userNo
GET/api/v1/email/verify-resendResend verification emailYes
POST/api/v1/forgot-passwordRequest password resetNo
POST/api/v1/reset-passwordReset password with tokenNo

User Management

MethodEndpointDescriptionAuth Required
GET/api/v1/userGet current user infoYes

Courses

MethodEndpointDescriptionAuth Required
GET/api/v1/searchSearch all coursesNo
GET/api/v1/sales-page/{id}Get course sales pageNo
GET/api/v1/my-coursesGet user's purchased coursesYes
GET/api/v1/my-courses/{id}Get course content/curriculumYes
POST/api/v1/lecture/{id}Update lecture progressYes

Checkout

MethodEndpointDescriptionAuth Required
POST/api/v1/checkoutProcess course purchaseYes

Response Status Codes


Common Request Headers

Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/json

Common Query Parameters

Prop

Type


Rate Limiting

API requests are rate-limited to prevent abuse. Current limits:

  • Authenticated requests: 1000 requests per hour
  • Unauthenticated requests: 100 requests per hour

When you exceed the rate limit, you'll receive a 429 Too Many Requests response:

{
  "status": "ERROR",
  "message": "Rate limit exceeded. Please try again later.",
  "retry_after": 3600
}

Pagination

All list endpoints return paginated results with the following structure:

{
  "data": [...],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 150,
    "last_page": 10,
    "from": 1,
    "to": 15
  },
  "links": {
    "first": "https://api.courselayer.com/api/v1/search?page=1",
    "last": "https://api.courselayer.com/api/v1/search?page=10",
    "prev": null,
    "next": "https://api.courselayer.com/api/v1/search?page=2"
  }
}

Code Examples

// Login
const response = await fetch('https://api.courselayer.com/api/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: '[email protected]',
    password: 'password123'
  })
});

const { access_token } = await response.json();

// Get user info
const userResponse = await fetch('https://api.courselayer.com/api/v1/user', {
  headers: {
    'Authorization': `Bearer ${access_token}`
  }
});

const user = await userResponse.json();
console.log(user);
import requests

# Login
response = requests.post(
    'https://api.courselayer.com/api/login',
    json={
        'email': '[email protected]',
        'password': 'password123'
    }
)

access_token = response.json()['access_token']

# Get user info
user_response = requests.get(
    'https://api.courselayer.com/api/v1/user',
    headers={'Authorization': f'Bearer {access_token}'}
)

user = user_response.json()
print(user)
# Login
curl -X POST https://api.courselayer.com/api/login \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"password123"}'

# Get user info
curl -X GET https://api.courselayer.com/api/v1/user \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Postman Collection

Download our Postman Collection to quickly test all endpoints.

Import Instructions

Download Collection

Download the Postman collection JSON file from the link above.

Import to Postman

Open Postman and click "Import" in the top left corner.

Configure Environment

Set up environment variables for base_url and access_token.

Start Testing

All endpoints are pre-configured with example requests.