Quick Reference
Quick reference guide for CourseLayer API
Quick Reference
A quick overview of all available API endpoints.
Authentication
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/login | Login user and get access token | No |
| POST | /api/logout | Logout from all devices | Yes |
| POST | /api/v1/register | Register new user | No |
| GET | /api/v1/email/verify-resend | Resend verification email | Yes |
| POST | /api/v1/forgot-password | Request password reset | No |
| POST | /api/v1/reset-password | Reset password with token | No |
User Management
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/v1/user | Get current user info | Yes |
Courses
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /api/v1/search | Search all courses | No |
| GET | /api/v1/sales-page/{id} | Get course sales page | No |
| GET | /api/v1/my-courses | Get user's purchased courses | Yes |
| GET | /api/v1/my-courses/{id} | Get course content/curriculum | Yes |
| POST | /api/v1/lecture/{id} | Update lecture progress | Yes |
Checkout
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/v1/checkout | Process course purchase | Yes |
Response Status Codes
Common Request Headers
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Accept: application/jsonCommon 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.