Students API
Comprehensive API for managing student data, enrollment, and academic records.
API Endpoints
/students
Retrieve a list of all students with optional filtering and pagination
Parameters
Page number for pagination (default: 1)
Number of students per page (default: 20, max: 100)
Filter by class ID
Filter by status (active, inactive, graduated)
Search by name, email, or student ID
Response
Success Response (200)
{
"data": [
{
"id": 123,
"student_id": "STU001",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"date_of_birth": "2005-03-15",
"class_id": 456,
"class_name": "Grade 10A",
"status": "active",
"enrollment_date": "2023-09-01",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"parent": {
"id": 789,
"name": "Jane Doe",
"email": "jane.doe@example.com",
"phone": "+1234567891"
}
}
],
"pagination": {
"total": 150,
"page": 1,
"limit": 20,
"total_pages": 8
}
}/students
Create a new student record
Parameters
Unique student identifier
Student first name
Student last name
Student email address
Student phone number
Date of birth (YYYY-MM-DD)
Class ID for enrollment
Student address object
Parent/Guardian ID
Response
Success Response (201)
{
"id": 124,
"student_id": "STU002",
"first_name": "Jane",
"last_name": "Smith",
"email": "jane.smith@example.com",
"phone": "+1234567892",
"date_of_birth": "2005-07-20",
"class_id": 456,
"class_name": "Grade 10A",
"status": "active",
"enrollment_date": "2024-01-15",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}Error Response (400)
{
"error": "validation_error",
"message": "Invalid input data",
"details": {
"email": ["Email address is already in use"],
"student_id": ["Student ID must be unique"]
}
}/students/{id}
Retrieve detailed information for a specific student
Parameters
Student ID
Response
Success Response (200)
{
"id": 123,
"student_id": "STU001",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"date_of_birth": "2005-03-15",
"class_id": 456,
"class_name": "Grade 10A",
"status": "active",
"enrollment_date": "2023-09-01",
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"parent": {
"id": 789,
"name": "Jane Doe",
"email": "jane.doe@example.com",
"phone": "+1234567891"
},
"academic_records": {
"current_gpa": 3.8,
"total_credits": 24,
"attendance_rate": 95.5
},
"created_at": "2023-09-01T08:00:00Z",
"updated_at": "2024-01-15T14:30:00Z"
}/students/{id}
Update student information
Parameters
Student ID
Updated first name
Updated last name
Updated email address
Updated phone number
Updated class ID
Updated status
Response
Success Response (200)
{
"id": 123,
"student_id": "STU001",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"date_of_birth": "2005-03-15",
"class_id": 456,
"class_name": "Grade 10A",
"status": "active",
"enrollment_date": "2023-09-01",
"updated_at": "2024-01-15T15:45:00Z"
}/students/{id}
Delete a student record (soft delete)
Parameters
Student ID
Response
Success Response (200)
{
"message": "Student successfully deleted",
"id": 123
}Bulk Operations
Bulk Import Students
Import multiple students from CSV or Excel files
curl -X POST https://api.klasstra.com/students/import \
-H "X-API-Key: your_api_key" \
-F "file=@students.csv" \
-F "class_id=456"Export Student Data
Export student information in various formats
curl -X GET "https://api.klasstra.com/students/export?format=csv&class_id=456" \
-H "X-API-Key: your_api_key" \
-o students_export.csvAdvanced Search
Search students with complex filters and sorting
curl -X GET "https://api.klasstra.com/students/search?q=john&class_id=456&status=active&sort=gpa" \
-H "X-API-Key: your_api_key"Student Data Model
Understanding the student data structure will help you work with the API more effectively.
{
"id": 123, // Unique student ID
"student_id": "STU001", // Institution student ID
"first_name": "John", // Student first name
"last_name": "Doe", // Student last name
"email": "john@example.com", // Student email
"phone": "+1234567890", // Student phone number
"date_of_birth": "2005-03-15", // Date of birth (ISO format)
"class_id": 456, // Current class ID
"class_name": "Grade 10A", // Current class name
"status": "active", // active, inactive, graduated
"enrollment_date": "2023-09-01", // Enrollment date
"address": { // Student address object
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"parent": { // Parent/Guardian information
"id": 789,
"name": "Jane Doe",
"email": "jane@example.com",
"phone": "+1234567891"
},
"academic_records": { // Academic performance data
"current_gpa": 3.8,
"total_credits": 24,
"attendance_rate": 95.5
},
"created_at": "2023-09-01T08:00:00Z",
"updated_at": "2024-01-15T14:30:00Z"
}Best Practices
Performance
- Use pagination for large datasets
- Implement caching for frequently accessed data
- Use specific filters to reduce response size
- Batch operations when possible
Data Management
- Validate data before sending requests
- Handle errors gracefully with proper retry logic
- Keep student data synchronized
- Respect privacy and data protection laws
Explore More APIs
Continue building your integration with other Klasstra APIs.