ReachLMS REST API
Backend API for Canvas LMS sub-account provisioning with Stripe billing integration.
Authorization: Bearer <access_token>
Canvas LMS Integration
Endpoints for provisioning and managing Canvas LMS sub-accounts and users.
Provision Canvas Account
Creates a new Canvas user and sub-account, assigns the user as account admin, and sends a confirmation email.
Endpoint: /api/canvas/provision-account
Requires JWT access token
Request Body:
{
"user": {
"user": "John Doe",
"shortname": "John",
"email": "[email protected]",
"password": "securePassword123",
"sis_user_id": "user-john-abc123"
},
"account": {
"account": {
"name": "Acme Corp Training",
"sis_account_id": "acme-corp-123"
}
}
}
Success Response: 200
{
"status": "success"
}
Error Responses:
400 Missing user or account data
{
"error": "Missing 'user' or 'account' data"
}
500 Canvas API failure
{
"error": "Failed to create Canvas user",
"details": "Error message from Canvas API"
}
Check Canvas Account Exists
Check if a Canvas account exists in the local database by name.
Endpoint: /api/canvas/get-canvas-account
No authentication required
Request Body: Account name as raw string
"Acme Corp Training"
Success Response: 200
{
"status": "exists",
"message": "Account already exists"
}
Not Found Response: 200
{
"status": "ok",
"message": "No user found"
}
Check Canvas User Exists
Check if a Canvas user exists in the local database by email.
Endpoint: /api/canvas/get-canvas-user
No authentication required
Request Body: Email as raw string
"[email protected]"
Success Response: 200
{
"status": "exists",
"message": "User already exists"
}
Not Found Response: 200
{
"status": "ok",
"message": "No user found"
}
Get All Canvas Users
Retrieve all Canvas users associated with the authenticated user.
Endpoint: /api/canvas/get-all-canvas-users
Requires JWT access token
Request Body: None
Success Response: 200
[
{
"id": 1,
"ed_tech_user_id": 5,
"canvas_email": "[email protected]",
"user_sis_id": "user-john-abc123"
},
{
"id": 2,
"ed_tech_user_id": 5,
"canvas_email": "[email protected]",
"user_sis_id": "user-jane-def456"
}
]
Query Canvas Users
Search for users in Canvas LMS by email, login ID, or SIS ID. Excludes the current user from results.
Endpoint: /api/canvas/query-canvas-users
Authentication optional (excludes current user if authenticated)
Query Parameters:
[email protected]
Success Response: 200
{
"status": "exists"
}
Not Found Response: 200
{
"status": "Not Found",
"message": "No matching user found"
}
Query Local Users
Check if a user exists in the local database by email.
Endpoint: /api/canvas/query-users
Authentication optional (excludes current user if authenticated)
Request Body:
{
"email": "[email protected]"
}
Success Response: 200
{
"status": "exists"
}
Not Found Response: 200
{
"status": "not_found",
"message": "No matching user found"
}
Check Subaccount Name
Check if a sub-account name already exists in Canvas LMS (searches all sub-accounts recursively).
Endpoint: /api/canvas/check-subaccount-name
No authentication required
Query Parameters:
?name=Acme%20Corp%20Training
Exists Response: 200
{
"status": "exists"
}
Available Response: 200
{
"status": "not_found"
}
Get All Canvas Accounts
Retrieve all Canvas accounts associated with the authenticated user.
Endpoint: /api/canvas/get-all-canvas-accounts
Requires JWT access token
Request Body: None
Success Response: 200
[
{
"id": 1,
"ed_tech_user_id": 5,
"canvas_user_id": 1,
"account_name": "Acme Corp Training",
"account_sis_id": "acme-corp-123",
"status": "active",
"cancel_date": null
}
]