API Reference
Quanta API Reference
Section titled “Quanta API Reference”Complete REST API documentation for integrating with Quanta programmatically.
Authentication
Section titled “Authentication”All API requests require authentication via API key.
Getting Your API Key
Section titled “Getting Your API Key”- Log in to Quanta
- Go to Settings → API Keys
- Click Generate New Key
- Copy your key
- Store securely (never share)
API Key Formats
Section titled “API Key Formats”Header-based (Recommended)
Authorization: Bearer YOUR_API_KEYQuery Parameter
GET /api/students?api_key=YOUR_API_KEYExample Request
Section titled “Example Request”curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.quanta.com/v1/studentsBase URL
Section titled “Base URL”https://api.quanta.com/v1Response Format
Section titled “Response Format”All responses return JSON:
Success Response
Section titled “Success Response”{ "success": true, "data": { "id": "student-123", "name": "Sarah Ahmed" }, "meta": { "timestamp": "2024-07-23T10:30:00Z" }}Error Response
Section titled “Error Response”{ "success": false, "error": { "code": "INVALID_REQUEST", "message": "Missing required field: name" }, "meta": { "timestamp": "2024-07-23T10:30:00Z" }}Endpoints
Section titled “Endpoints”Students
Section titled “Students”List Students
Section titled “List Students”Get all students in your account.
GET /studentsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Results per page (default: 20, max: 100) |
offset | integer | Pagination offset (default: 0) |
status | string | Filter by status (active, inactive, graduated) |
sort | string | Sort field (name, created_at, enrollment_date) |
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.quanta.com/v1/students?limit=20&status=active"Response
{ "success": true, "data": [ { "id": "student-123", "name": "Sarah Ahmed", "email": "sarah@example.com", "phone": "555-0101", "status": "active", "enrollment_date": "2024-07-01", "tier": "lite" } ], "meta": { "total": 150, "limit": 20, "offset": 0 }}Get Student
Section titled “Get Student”Retrieve single student by ID.
GET /students/{student_id}Example
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.quanta.com/v1/students/student-123"Create Student
Section titled “Create Student”Add new student.
POST /studentsRequest Body
{ "name": "John Smith", "email": "john@example.com", "phone": "555-0102", "enrollment_date": "2024-07-23"}Response
{ "success": true, "data": { "id": "student-456", "name": "John Smith", "email": "john@example.com", "phone": "555-0102", "status": "active", "enrollment_date": "2024-07-23", "tier": "free" }}Update Student
Section titled “Update Student”Modify existing student.
PUT /students/{student_id}Request Body
{ "name": "John Smith Jr.", "phone": "555-0199", "status": "inactive"}Delete Student
Section titled “Delete Student”Remove student from system.
DELETE /students/{student_id}Sessions
Section titled “Sessions”List Sessions
Section titled “List Sessions”Get all sessions.
GET /sessionsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
student_id | string | Filter by student |
start_date | date | Start date (YYYY-MM-DD) |
end_date | date | End date (YYYY-MM-DD) |
status | string | Filter by status |
Example
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.quanta.com/v1/sessions?student_id=student-123&status=completed"Create Session
Section titled “Create Session”Log new session.
POST /sessionsRequest Body
{ "student_id": "student-123", "date": "2024-07-23", "time": "15:00", "duration": 60, "status": "completed", "notes": "Covered algebra basics"}Response
{ "success": true, "data": { "id": "session-789", "student_id": "student-123", "date": "2024-07-23", "time": "15:00", "duration": 60, "status": "completed", "notes": "Covered algebra basics", "created_at": "2024-07-23T15:30:00Z" }}Payments
Section titled “Payments”List Payments
Section titled “List Payments”Get all payments.
GET /paymentsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
student_id | string | Filter by student |
status | string | Filter by status (pending, completed, failed, refunded) |
date_from | date | Start date (YYYY-MM-DD) |
date_to | date | End date (YYYY-MM-DD) |
Record Payment
Section titled “Record Payment”Process payment.
POST /paymentsRequest Body
{ "student_id": "student-123", "amount": 50.00, "method": "card", "date": "2024-07-23", "reference": "INV-2024-0451"}Response
{ "success": true, "data": { "id": "payment-456", "student_id": "student-123", "amount": 50.00, "method": "card", "status": "completed", "date": "2024-07-23", "reference": "INV-2024-0451" }}Error Codes
Section titled “Error Codes”| Code | Status | Meaning |
|---|---|---|
INVALID_REQUEST | 400 | Invalid request parameters |
UNAUTHORIZED | 401 | Missing or invalid API key |
FORBIDDEN | 403 | Insufficient permissions |
NOT_FOUND | 404 | Resource not found |
CONFLICT | 409 | Resource already exists |
RATE_LIMITED | 429 | Too many requests |
INTERNAL_ERROR | 500 | Server error |
Rate Limits
Section titled “Rate Limits”API rate limits vary by tier:
| Tier | Requests/Minute | Requests/Day |
|---|---|---|
| Free | 30 | 1,000 |
| Lite | 100 | 10,000 |
| Pro | 500 | 100,000 |
| Max | Unlimited | Unlimited |
Pagination
Section titled “Pagination”List endpoints support pagination:
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.quanta.com/v1/students?limit=20&offset=40"Response includes:
{ "meta": { "total": 150, "limit": 20, "offset": 40, "has_more": true }}Webhooks
Section titled “Webhooks”Receive real-time updates about events:
Supported Events
Section titled “Supported Events”student.created- New student addedstudent.updated- Student information changedsession.completed- Session finishedpayment.processed- Payment recorded
Setting Up Webhooks
Section titled “Setting Up Webhooks”- Go to Settings → Webhooks
- Click Add Webhook
- Enter endpoint URL
- Select events
- Save
Webhook Payload
Section titled “Webhook Payload”{ "event": "session.completed", "timestamp": "2024-07-23T15:30:00Z", "data": { "id": "session-789", "student_id": "student-123", "duration": 60, "status": "completed" }}Code Examples
Section titled “Code Examples”Python
Section titled “Python”import requests
api_key = "YOUR_API_KEY"headers = {"Authorization": f"Bearer {api_key}"}
# Get studentsresponse = requests.get( "https://api.quanta.com/v1/students", headers=headers)students = response.json()["data"]
# Create sessionsession_data = { "student_id": "student-123", "date": "2024-07-23", "duration": 60, "status": "completed"}response = requests.post( "https://api.quanta.com/v1/sessions", json=session_data, headers=headers)JavaScript
Section titled “JavaScript”const apiKey = "YOUR_API_KEY";const headers = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json"};
// Get studentsconst response = await fetch( "https://api.quanta.com/v1/students", { headers });const students = (await response.json()).data;
// Create sessionconst sessionData = { student_id: "student-123", date: "2024-07-23", duration: 60, status: "completed"};const createResponse = await fetch( "https://api.quanta.com/v1/sessions", { method: "POST", headers, body: JSON.stringify(sessionData) });Support
Section titled “Support”- Documentation - See Integration Guide
- Issues - Report at github.com/quanta/api-issues
- Status Page - api.quanta.com/status
Next: Learn about Integrations or view Advanced Topics