Course Builder API
POST /services/courses/v1/customer/courses/tutor/ask Auth

Ask the course tutor

A question (`message`, at most 1,000 characters) about lesson `lesson_id` (with `course_id` or `slug` when given: it must be that lesson's course), with the last messages of the conversation as `history` ([{role: user|assistant, content}], the client keeps them; the newest 6 are used). Answers `reply`, `source` (ai, or fallback: the tutor is not available right now) and `replaced` (true when the AI's text gave a quiz answer away and a hint to reread a lesson was given instead). Only for a student enrolled with access whose module is open (a preview is not enough): 403 `not_enrolled` or `locked`; 403 `tutor_off` when the course has no tutor; 429 `tutor_month_limit` or `tutor_daily_limit` when the plan's month or the student's day is used up. Another shop's lesson is 404. The question and the reply are not kept.

Request Body Required

FieldTypeRequiredDescriptionExample
lesson_id integer Yes
course_id integer|null No
slug string|null
max: 191
No
message string
max: 1000
Yes
history array|null No

Responses

200
422
401
429
Successful response
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 20
X-RateLimit-Remaining integer Number of requests remaining in the current window 17
FieldTypeDescription
error boolean
message string
data mixed[]
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Unauthenticated — missing or invalid Bearer token
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 20
X-RateLimit-Remaining integer Number of requests remaining in the current window 17
FieldTypeDescription
error boolean
message string
Too Many Requests — rate limit exceeded
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 20
X-RateLimit-Remaining integer Number of requests remaining in the current window 17
Retry-After integer Seconds until the rate limit resets 60
FieldTypeDescription
error boolean
message string
Base URL
https://api.wemasy.nl/api
Authentication

Request Sample
cURL
JS
PHP
Python
curl -X POST "https://api.wemasy.nl/api/services/courses/v1/customer/courses/tutor/ask" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "lesson_id": 0,
    "course_id": "string",
    "slug": "string",
    "message": "string",
    "history": "string"
}'
fetch('https://api.wemasy.nl/api/services/courses/v1/customer/courses/tutor/ask', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "lesson_id": 0,
    "course_id": "string",
    "slug": "string",
    "message": "string",
    "history": "string"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
    ->accept('application/json')
    ->post('https://api.wemasy.nl/api/services/courses/v1/customer/courses/tutor/ask', {
    "lesson_id": 0,
    "course_id": "string",
    "slug": "string",
    "message": "string",
    "history": "string"
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "lesson_id": 0,
    "course_id": "string",
    "slug": "string",
    "message": "string",
    "history": "string"
}
r = requests.post("https://api.wemasy.nl/api/services/courses/v1/customer/courses/tutor/ask", headers=headers, json=data)
print(r.json())
Response Example
{
    "error": true,
    "message": "string",
    "data": []
}

Try It
Request Body Required

Export