merce.STACK
merce.STACK
Skip to content
PricingWhat's new
Log inGet started
{}Developers
GuidesAPI referenceChangelogGet API keys →
  • Get started

    • Quickstart
    • Keys & authentication
  • Storefront

    • Products & catalog
    • Carts
    • Checkout & payment
    • Customer accounts
    • Digital products
    • Without a build step
    • Bookings
    • Courses
    • Drop-in components
  • Server API

    • Server API
    • Customers
    • Payment links & transactions
    • Balance & payouts
    • Classes & students
    • Node SDK
  • Email API

    • Email API
    • Sending email
    • Delivery events
  • Events & errors

    • Webhooks
    • Errors
  • Reference

    • API reference
    • Changelog

Server API

Classes & students

Read your classes and who's in them; enrol people from your own systems.

Each class has a public page at mercestack.com/classrooms/<workspace>/<class> where people pay to join. Paying students become customers in your CRM, tagged student. Use these endpoints to read the roster or give someone a seat — a scholarship, a corporate booking — without payment.

List classes

GET/v1/classrooms
Secret keyclassrooms:read

With price, status and seats taken.

curl https://api.mercestack.com/v1/classrooms \
  -H "Authorization: Bearer sk_test_…"
Response
{ "object": "list", "data": [ { "id": "c1…", "title": "Product Design Bootcamp", "status": "published", … } ], "hasMore": false, "nextCursor": null }

Get a class

GET/v1/classrooms/:id
Secret keyclassrooms:read

Sessions, resources and enrolments.

curl https://api.mercestack.com/v1/classrooms/CLASS_ID \
  -H "Authorization: Bearer sk_test_…"
Response
{ "id": "c1…", "title": "Product Design Bootcamp", "sessions": [ … ], … }

List students

GET/v1/classrooms/:id/enrollments
Secret keyclassrooms:read

Everyone enrolled, with status and what they paid.

Query parameters

searchstring
Name or email.
curl https://api.mercestack.com/v1/classrooms/CLASS_ID/enrollments \
  -H "Authorization: Bearer sk_test_…"
Response
{
  "object": "list",
  "data": [
    {
      "id": "e1…",
      "name": "Chidi Okeke",
      "email": "[email protected]",
      "status": "active",
      "customerId": "7e1f…",
      "amountMinor": "4500000",
      "currency": "NGN",
      "enrolledAt": "2026-09-01T10:00:00.000Z"
    }
  ],
  "hasMore": false,
  "nextCursor": null
}

Enrol someone

POST/v1/classrooms/:id/enrollments
Secret keyclassrooms:write

Gives a seat without payment and emails them the class. Respects capacity.

Body

namestringrequired
Student's name.
emailstringrequired
Where the invitation goes.
curl -X POST https://api.mercestack.com/v1/classrooms/CLASS_ID/enrollments \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"name":"Ngozi Eze","email":"[email protected]"}'
Response
{ "id": "e2…", "status": "active", … }

Create a class

POST/v1/classrooms
Secret keyclassrooms:write

A class with its offering. primaryInstructorMembershipId is a member of your workspace; the class starts as a draft until published.

Body

titlestringrequired
Shown on the class page.
enrollmentKind"paid" | "free" | "invite"required
How people get a seat.
primaryInstructorMembershipIduuidrequired
The member who teaches it.
pricestring
For paid classes, in major units.
capacitynumber
Seats. Omit for unlimited.
curl -X POST https://api.mercestack.com/v1/classrooms \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Product Design Bootcamp","enrollmentKind":"invite","primaryInstructorMembershipId":"MEMBERSHIP_ID"}'
Response
{ "id": "c1…", "status": "draft", … }

Schedule a live session

POST/v1/classrooms/:id/sessions
Secret keyclassrooms:write

A live class on a date. Also GET to list, and PATCH / DELETE /sessions/:id to move or cancel one that has not started.

Body

titlestringrequired
Week 1 — Research.
startsAtISO 8601required
When it starts.
endsAtISO 8601required
When it ends.
curl -X POST https://api.mercestack.com/v1/classrooms/CLASS_ID/sessions \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"title":"Week 1","startsAt":"2026-10-05T09:00:00Z","endsAt":"2026-10-05T10:00:00Z"}'
Response
{ "id": "s1…", "status": "scheduled", … }

Create a join link

POST/v1/sessions/:id/join-links
Secret keyclassrooms:join

A link that puts one person into the live class — a learner on their enrollment, or a host who runs it — with no Mercestack account. Mint one per person on your server and send it from your own app; it works until it expires. A host joining starts the class. Guests can join only once it is live; before then the link says so and can be retried.

Body

role"host" | "learner"required
What they can do in the room.
enrollmentIduuid
Required for a learner.
namestring
How a host appears.
expiresInnumber
Seconds, 60–604800. Default 86400.
returnUrlhttps URL
Where Leave takes them on your site.
curl -X POST https://api.mercestack.com/v1/sessions/SESSION_ID/join-links \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"role":"learner","enrollmentId":"ENROLLMENT_ID"}'
Response
{ "url": "https://classroom.mercestack.com/live/s1…#handoff=…", "expiresAt": "2026-10-06T09:00:00.000Z" }

Embed the live class in your own page with the join link: <div data-mercestack-classroom="JOIN_LINK" style="height:640px"></div> and <script src="https://classroom.mercestack.com/live/embed.js" async></script>. The frame gets camera, microphone and screen-share permission; nothing else on your page can reach into it.

List recordings

GET/v1/sessions/:id/recordings
Secret keyrecordings:read

Recordings a host made during the class (recording always starts by hand). playbackUrl streams the MP4 and works for a few hours — fetch it when you need it rather than storing it. Listen for the recording.ready webhook to know when one lands.

curl https://api.mercestack.com/v1/sessions/SESSION_ID/recordings \
  -H "Authorization: Bearer sk_test_…"
Response
{ "object": "list", "data": [ { "id": "r1…", "status": "ready", "durationSeconds": 3540, "playbackUrl": "https://…/recordings/play/r1…?exp=…&sig=…" } ], … }

Webhooks for classes: classroom.session.started, classroom.session.ended, classroom.enrollment.confirmed, classroom.enrollment.cancelled and recording.ready. Add an endpoint under Settings › Developers.

← PreviousBalance & payoutsNext →Node SDK

On this page

  • GETList classes
  • GETGet a class
  • GETList students
  • POSTEnrol someone
  • POSTCreate a class
  • POSTSchedule a live session
  • POSTCreate a join link
  • GETList recordings
Create a workspaceTalk to usPricing

One workspace for everything your business runs on — your team, customers, store, marketing and payouts in one place.

Get started

Product

  • All products
  • Pricing
  • What's new
  • Security

Resources

  • Documentation
  • Guides
  • Use cases
  • Blog
  • Get support

Company

  • About
  • Careers
  • Contact us
  • Talk to the team

Legal

  • Privacy
  • Terms
  • Cookie policy
  • GDPR
  • Report a vulnerability

© 2026 Mercestack. All rights reserved.

Mercestack StructureOS

mercestack