Workspace API

Kursy i quizy

Endpointy „Kursy i quizy” Zanfia Workspace API — ze schematami i przykładami kodu.

12 min czytaniaOstatnia aktualizacja: 10 wrz 2026

Treści kursu adresowane są przez id produktu. Statusy lekcji i modułów: draft, public, hidden, locked. Pole content lekcji to Markdown, a PATCH zastępuje całą treść. Lekcje wideo mają też rozdziały i kluczowe momenty na swoim wideo Bunny (…/lessons/{lessonId}/video); endpointy generowania AI proponują je z transkrypcji, a wybrane zapisujesz tym samym PUT. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.

Struktura kursu

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,          "thumbnail": "string"        }      ]    }  ]}
{  "error": "string",  "message": "string"}

Analityka kursu

GET/products/{productId}/course/analytics

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

productId*string

Product id

Query Parameters

learnersLimit?integer

Learner rows to return (default 50, max 200).

learnersSort?string

progress-desc (default), progress-asc (least progress first) or last-activity-desc.

Value in

  • "progress-desc"
  • "progress-asc"
  • "last-activity-desc"

Response Body

application/json

application/json

curl -X GET "https://example.com/products/string/course/analytics"
{  "summary": {    "tracked": 0,    "completedCourse": 0,    "activeLast7Days": 0,    "activeLast30Days": 0  },  "lessons": [    {      "lessonId": "string",      "title": "string",      "module": "string",      "status": "string",      "started": 0,      "completed": 0,      "quizAttempts": 0,      "quizPassed": 0    }  ],  "learners": {    "total": 0,    "returned": 0,    "lessonsBasis": 0,    "rows": [      {        "email": "string",        "name": "string",        "progressPercent": 0,        "completedLessons": 0,        "startedLessons": 0,        "completedCourse": true,        "numberOfSessions": 0,        "firstActivityAt": "string",        "lastActivityAt": "string"      }    ]  }}
{  "error": "string",  "message": "string"}

Mapa transkrypcji kursu

GET/products/{productId}/course/transcripts

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/transcripts"
{  "courseId": "string",  "modules": [    {      "id": "string",      "name": "string",      "lessons": [        {          "lessonId": "string",          "title": "string",          "type": "video",          "mediaId": "string",          "hasTranscript": true,          "transcriptionStatus": "string",          "durationSeconds": 0        }      ]    }  ],  "totals": {    "lessons": 0,    "videoLessons": 0,    "transcribed": 0  }}
{  "error": "string",  "message": "string"}

Szczegóły lekcji

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"      }    ],    "thumbnail": "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",  "message": "string"}

Aktualizuj lekcję

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",  "message": "string"}

Usuń lekcję (trwale)

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",  "message": "string"}

Dodaj moduł

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",  "message": "string"}

Aktualizuj moduł

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",  "message": "string"}

Usuń moduł (trwale)

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",  "message": "string"}

Dodaj lekcję

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",  "message": "string"}

Zbiorcza zmiana statusu lekcji

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",  "message": "string"}

Zmień kolejność modułów

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",  "message": "string"}

Zmień kolejność lekcji w module

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",  "message": "string"}

Ustaw miniaturę lekcji

PUT/products/{productId}/course/lessons/{lessonId}/thumbnail

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/thumbnail" \  -H "Content-Type: application/json" \  -d '{}'
{  "lessonId": "string",  "thumbnailUrl": "string"}
{  "error": "string",  "message": "string"}

Rozdziały i momenty wideo lekcji

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

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/video"
{  "lessonId": "string",  "chapters": [    {      "title": "string",      "start": 0,      "end": 0    }  ],  "moments": [    {      "label": "string",      "timestamp": 0    }  ],  "metaTags": [    {      "property": "string",      "value": "string"    }  ]}
{  "error": "string",  "message": "string"}

Zapisz rozdziały i momenty wideo lekcji

PUT/products/{productId}/course/lessons/{lessonId}/video

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.

Presence-based: a list that is sent REPLACES the stored list, an omitted list is kept as is (the server fills it from the current video). At least one list required. metaTags are merged over Bunny's existing tags.

Response Body

application/json

application/json

curl -X PUT "https://example.com/products/string/course/lessons/string/video" \  -H "Content-Type: application/json" \  -d '{}'
{  "lessonId": "string",  "updated": true}
{  "error": "string",  "message": "string"}

Wygeneruj rozdziały (AI)

POST/products/{productId}/course/lessons/{lessonId}/chapters/generate

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.

AI chapter proposal from the lesson's transcript — candidates only, nothing is persisted; save them with PUT …/lessons/{lessonId}/video.

Response Body

application/json

application/json

curl -X POST "https://example.com/products/string/course/lessons/string/chapters/generate" \  -H "Content-Type: application/json" \  -d '{}'
{  "chapters": [    {      "title": "string",      "start": 0,      "end": 0    }  ]}
{  "error": "string",  "message": "string"}

Wygeneruj kluczowe momenty (AI)

POST/products/{productId}/course/lessons/{lessonId}/moments/generate

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/moments/generate" \  -H "Content-Type: application/json" \  -d '{}'
{  "moments": [    {      "label": "string",      "timestamp": 0    }  ]}
{  "error": "string",  "message": "string"}

Pytania i ustawienia quizu

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",  "message": "string"}

Dodaj pytanie do quizu

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",  "message": "string"}

Zmień kolejność pytań quizu

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",  "message": "string"}

Zastąp pytanie quizu

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",  "message": "string"}

Usuń pytanie quizu (trwale)

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",  "message": "string"}

Aktualizuj ustawienia quizu

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",  "message": "string"}

Czy ten artykuł był pomocny?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.