Workspace API

Courses & quizzes

Courses & quizzes endpoints of the Zanfia Workspace API, with schemas and code samples.

9 min readLast updated Jul 26, 2026

Course content is addressed by the product id. Lesson and module statuses: draft, public, hidden, locked. Lesson content is Markdown and a PATCH replaces the whole body. All routes require a Authorization: Bearer header — see Authentication.

Course structure

GET/products/{productId}/course

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/course"
{  "courseId": "string",  "modulesCount": 0,  "modules": [    {      "id": "string",      "name": "string",      "description": "string",      "status": "draft",      "lessonsCount": 0,      "lessons": [        {          "id": "string",          "title": "string",          "description": "string",          "type": "video",          "status": "draft",          "videoStatus": "Pending",          "length": 0        }      ]    }  ]}
{  "error": "string"}

Lesson detail

GET/products/{productId}/course/lessons/{lessonId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/course/lessons/string"
{  "courseId": "string",  "lesson": {    "id": "string",    "moduleId": "string",    "title": "string",    "description": "string",    "type": "video",    "status": "draft",    "content": "string",    "attachments": [      {        "uid": "string",        "name": "string",        "url": "string"      }    ],    "video": {      "type": "bunny",      "status": "Pending",      "url": "string",      "length": 0    },    "audio": {      "url": "string",      "mimeType": "string",      "length": 0,      "size": 0    },    "createdAt": "string",    "updatedAt": "string"  }}
{  "error": "string"}

Update a lesson

PATCH/products/{productId}/course/lessons/{lessonId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/course/lessons/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "lessonId": "string"}
{  "error": "string"}

Delete a lesson (permanent)

DELETE/products/{productId}/course/lessons/{lessonId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/products/string/course/lessons/string"
{  "deleted": true}
{  "error": "string"}

Add a module

POST/products/{productId}/course/modules

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/course/modules" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "moduleId": "string",  "name": "string"}
{  "error": "string"}

Update a module

PATCH/products/{productId}/course/modules/{moduleId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

moduleId*string

Module id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/course/modules/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "moduleId": "string"}
{  "error": "string"}

Delete a module (permanent)

DELETE/products/{productId}/course/modules/{moduleId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

moduleId*string

Module id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/products/string/course/modules/string"
{  "deleted": true}
{  "error": "string"}

Add a lesson

POST/products/{productId}/course/modules/{moduleId}/lessons

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

moduleId*string

Module id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/course/modules/string/lessons" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "type": "video"  }'
{  "lessonId": "string",  "moduleId": "string",  "title": "string"}
{  "error": "string"}

Bulk lesson status change

POST/products/{productId}/course/lessons/status

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/course/lessons/status" \  -H "Content-Type: application/json" \  -d '{    "lessonIds": [      "string"    ],    "status": "draft"  }'
{  "updated": 0}
{  "error": "string"}

Reorder modules

PUT/products/{productId}/course/modules/order

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://example.com/products/string/course/modules/order" \  -H "Content-Type: application/json" \  -d '{    "moduleIds": [      "string"    ]  }'
{  "courseId": "string"}
{  "error": "string"}

Reorder a module's lessons

PUT/products/{productId}/course/modules/{moduleId}/lessons/order

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

moduleId*string

Module id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://example.com/products/string/course/modules/string/lessons/order" \  -H "Content-Type: application/json" \  -d '{    "lessonIds": [      "string"    ]  }'
{  "moduleId": "string"}
{  "error": "string"}

Quiz questions & settings

GET/products/{productId}/course/lessons/{lessonId}/quiz

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/course/lessons/string/quiz"
{  "questions": [    {      "id": "string",      "question": "string",      "explanation": "string",      "points": 0,      "order": 0,      "mediaUrl": "string",      "source": {        "snippet": "string",        "startSeconds": 0      },      "type": "single_choice",      "options": [        {          "id": "string",          "text": "string",          "isCorrect": true,          "mediaUrl": "string"        }      ]    }  ],  "settings": {    "passingScore": 0,    "maxAttempts": 0,    "timeLimitSeconds": 0,    "shuffleQuestions": true,    "shuffleOptions": true,    "showCorrectAnswers": true,    "requirePassToProgress": true,    "questionCount": 0,    "totalPoints": 0  }}
{  "error": "string"}

Add a quiz question

POST/products/{productId}/course/lessons/{lessonId}/quiz/questions

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/course/lessons/string/quiz/questions" \  -H "Content-Type: application/json" \  -d '{    "question": {      "question": "string",      "type": "single_choice",      "options": [        {          "text": "string",          "isCorrect": true        }      ]    }  }'
{  "questionId": "string"}
{  "error": "string"}

Reorder quiz questions

PUT/products/{productId}/course/lessons/{lessonId}/quiz/questions/order

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PUT "https://example.com/products/string/course/lessons/string/quiz/questions/order" \  -H "Content-Type: application/json" \  -d '{    "orderedQuestionIds": [      "string"    ]  }'
{  "reordered": true}
{  "error": "string"}

Replace a quiz question

PATCH/products/{productId}/course/lessons/{lessonId}/quiz/questions/{questionId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

questionId*string

Quiz question id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/course/lessons/string/quiz/questions/string" \  -H "Content-Type: application/json" \  -d '{    "question": {      "question": "string",      "type": "single_choice",      "options": [        {          "text": "string",          "isCorrect": true        }      ]    }  }'
{  "updated": true}
{  "error": "string"}

Delete a quiz question (permanent)

DELETE/products/{productId}/course/lessons/{lessonId}/quiz/questions/{questionId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

questionId*string

Quiz question id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/products/string/course/lessons/string/quiz/questions/string"
{  "deleted": true}
{  "error": "string"}

Update quiz settings

PATCH/products/{productId}/course/lessons/{lessonId}/quiz/settings

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

productId*string

Product id

lessonId*string

Lesson id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/products/string/course/lessons/string/quiz/settings" \  -H "Content-Type: application/json" \  -d '{    "settings": {}  }'
{  "updated": true}
{  "error": "string"}

Was this article helpful?

Related articles

Spotted something off? Tell us at support@zanfia.com.