Start here
The management API lets a school integrate its courses, learners, contacts, enrollments, commerce records, campaigns, automations, community moderation, usage, and signed outbound webhooks. It is designed for trusted backend systems, never browser or mobile client code.
Download the OpenAPI 3.1 contract for complete request schemas, response schemas, parameters, examples, and status codes.
Authentication
A school owner creates a key from Settings → API keys, chooses only the permissions the integration needs, and may set an expiry, IP allowlist, and per-minute request budget. API access is available on every plan. Some scopes appear only when their corresponding school feature is enabled.
CoursePan shows the complete credential once and retains only a non-secret prefix and one-way verifier. Store it in a server-side secret manager. Do not put it in a URL, browser bundle, analytics event, log, support ticket, or source control.
Authorization: Bearer ck_live_<prefix>.<secret>
Every key identifies exactly one school. CoursePan checks expiry, revocation, current plan access, optional IP restrictions, the endpoint scope, and the key’s rate limit on every request. Revocation is immediate; rotation revokes the old key in the same transaction that creates its one-time replacement.
Base URL and first request
https://api.coursepan.com/api/v1/management
curl --fail-with-body \
--header "Authorization: Bearer $COURSEPAN_API_KEY" \
--header "Accept: application/json" \
"https://api.coursepan.com/api/v1/management/courses?per_page=25"
Authenticated responses use Cache-Control: no-store, private and include
X-RateLimit-Limit and X-RateLimit-Remaining. A limited request
also includes Retry-After.
Endpoint reference
The tables below are generated from the same OpenAPI source that is checked against CoursePan’s live route middleware. A key needs the exact listed scope; write access never implies an unrelated read or moderation permission.
Courses
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/courses | courses:read | — | List courses |
POST /v1/management/courses | courses:write | Idempotency-Key | Create a course |
GET /v1/management/courses/{course} | courses:read | — | Get a course |
PATCH /v1/management/courses/{course} | courses:write | Idempotency-Key + If-Match | Update a course |
Learners
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/students | students:read | — | List learners |
GET /v1/management/students/{student} | students:read | — | Get a learner |
PATCH /v1/management/students/{student} | students:write | Idempotency-Key + If-Match | Update learner identity or account state |
Contacts
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/contacts | contacts:read | — | List CRM contacts |
POST /v1/management/contacts | contacts:write | Idempotency-Key | Create a CRM contact without inferring consent |
GET /v1/management/contacts/{contact} | contacts:read | — | Get a CRM contact |
PATCH /v1/management/contacts/{contact} | contacts:write | Idempotency-Key + If-Match | Update a CRM contact |
POST /v1/management/contacts/{contact}/archive | contacts:write | Idempotency-Key + If-Match | Archive a contact without deleting consent history |
Enrollments
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/enrollments | enrollments:read | — | List enrollments |
GET /v1/management/enrollments/{enrollment} | enrollments:read | — | Get an enrollment |
POST /v1/management/enrollment-grants | enrollments:grant | Idempotency-Key | Grant course access from an explicit external source |
POST /v1/management/enrollments/{enrollment}/revoke | enrollments:revoke | Idempotency-Key + If-Match | Revoke only the named API-managed access source |
Usage
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/usage | usage:read | — | Get plan and reconciled video usage |
Offers
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/offers | offers:read | — | List offers |
POST /v1/management/offers | offers:write | Idempotency-Key | Create an offer and its catalogue |
GET /v1/management/offers/{offer} | offers:read | — | Get an offer |
PATCH /v1/management/offers/{offer} | offers:write | Idempotency-Key + If-Match | Update an offer; purchased catalogues cannot be replaced |
POST /v1/management/offers/{offer}/publish | offers:write | Idempotency-Key + If-Match | Publish an offer |
POST /v1/management/offers/{offer}/archive | offers:write | Idempotency-Key + If-Match | Archive an offer |
POST /v1/management/offers/{offer}/draft | offers:write | Idempotency-Key + If-Match | Return an unpublished offer to draft |
Orders
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/orders | orders:read | — | List retained order and entitlement facts |
GET /v1/management/orders/{order} | orders:read | — | Get an order |
Subscriptions
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/subscriptions | subscriptions:read | — | List subscription lifecycle records |
GET /v1/management/subscriptions/{subscription} | subscriptions:read | — | Get a subscription and immutable billing cycles |
Campaigns
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/campaigns | campaigns:read | — | List campaigns and aggregate delivery outcomes |
POST /v1/management/campaigns | campaigns:write | Idempotency-Key | Create a draft campaign |
GET /v1/management/campaigns/{campaign} | campaigns:read | — | Get a campaign |
PATCH /v1/management/campaigns/{campaign} | campaigns:write | Idempotency-Key + If-Match | Update a draft campaign before audience confirmation |
POST /v1/management/campaigns/{campaign}/confirm | campaigns:write | Idempotency-Key + If-Match | Freeze the audience and campaign configuration |
POST /v1/management/campaigns/{campaign}/send | campaigns:write | Idempotency-Key + If-Match | Start or reschedule confirmed campaign delivery now |
POST /v1/management/campaigns/{campaign}/pause | campaigns:write | Idempotency-Key + If-Match | Pause a sending campaign |
POST /v1/management/campaigns/{campaign}/resume | campaigns:write | Idempotency-Key + If-Match | Resume a paused campaign |
POST /v1/management/campaigns/{campaign}/cancel | campaigns:write | Idempotency-Key + If-Match | Cancel unsent campaign work while retaining history |
Automations
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/automations | automations:read | — | List versioned automations and aggregate run outcomes |
POST /v1/management/automations | automations:write | Idempotency-Key | Create a draft automation version |
GET /v1/management/automations/{automation} | automations:read | — | Get an automation and its latest definition |
PATCH /v1/management/automations/{automation} | automations:write | Idempotency-Key + If-Match | Rename an automation or replace its complete draft definition |
POST /v1/management/automations/{automation}/dry-test | automations:write | Idempotency-Key + If-Match | Validate the latest draft without executing side effects |
POST /v1/management/automations/{automation}/publish | automations:write | Idempotency-Key + If-Match | Publish the successfully tested latest draft |
POST /v1/management/automations/{automation}/pause | automations:write | Idempotency-Key + If-Match | Pause a live automation |
POST /v1/management/automations/{automation}/resume | automations:write | Idempotency-Key + If-Match | Resume a paused automation |
POST /v1/management/automations/{automation}/versions | automations:write | Idempotency-Key + If-Match | Copy the live version into a new editable draft |
POST /v1/management/automations/{automation}/archive | automations:write | Idempotency-Key + If-Match | Archive an automation and cancel unfinished work |
Community
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/community-spaces | community:read | — | List community spaces and operational counts |
GET /v1/management/community-spaces/{space} | community:read | — | Get a community space |
GET /v1/management/community-posts | community:read | — | List posts; private conversations are never included |
GET /v1/management/community-posts/{post} | community:read | — | Get a post and safe attachment metadata |
GET /v1/management/community-comments | community:read | — | List community comments |
GET /v1/management/community-comments/{comment} | community:read | — | Get a community comment |
GET /v1/management/community-events | community:read | — | List events without exposing private join URLs |
GET /v1/management/community-events/{event} | community:read | — | Get a community event without its private join URL |
GET /v1/management/community-memberships | community:read | — | List memberships needed for community operations and moderation |
GET /v1/management/community-memberships/{membership} | community:read | — | Get a community membership |
GET /v1/management/community-reports | community:read | — | List encrypted-at-rest learner reports |
GET /v1/management/community-reports/{report} | community:read | — | Get a community report |
GET /v1/management/community-moderation-actions | community:read | — | List the immutable moderation ledger |
POST /v1/management/community-moderation-actions | community:moderate | Idempotency-Key + If-Match | Apply a reasoned, immutable moderation decision |
GET /v1/management/community-moderation-actions/{action} | community:read | — | Get one immutable moderation decision |
Webhooks
| Method and path | Required scope | Guards | Purpose |
|---|---|---|---|
GET /v1/management/webhook-events | webhooks:manage | — | List supported outbound event names and versions |
GET /v1/management/webhook-endpoints | webhooks:manage | — | List outbound webhook endpoints |
POST /v1/management/webhook-endpoints | webhooks:manage | Idempotency-Key | Create a signed outbound webhook endpoint |
GET /v1/management/webhook-endpoints/{endpoint} | webhooks:manage | — | Get an outbound webhook endpoint |
PATCH /v1/management/webhook-endpoints/{endpoint} | webhooks:manage | Idempotency-Key + If-Match | Update endpoint name, URL, or event subscriptions |
POST /v1/management/webhook-endpoints/{endpoint}/rotate | webhooks:manage | Idempotency-Key + If-Match | Rotate the signing secret and return the new secret once |
POST /v1/management/webhook-endpoints/{endpoint}/pause | webhooks:manage | Idempotency-Key + If-Match | Pause outbound delivery |
POST /v1/management/webhook-endpoints/{endpoint}/resume | webhooks:manage | Idempotency-Key + If-Match | Resume outbound delivery |
POST /v1/management/webhook-endpoints/{endpoint}/test | webhooks:manage | Idempotency-Key + If-Match | Queue a harmless signed test delivery |
GET /v1/management/webhook-endpoints/{endpoint}/deliveries | webhooks:manage | — | List delivery outcomes and sanitized attempts |
POST /v1/management/webhook-deliveries/{delivery}/replay | webhooks:manage | Idempotency-Key + If-Match | Queue a new delivery that references a terminal source delivery |
Safe mutations
Every POST, PATCH, PUT, or DELETE
operation requires an opaque Idempotency-Key between 8 and 191 characters.
Create one stable key for one logical operation and reuse it only when retrying that
exact request. CoursePan retains the replay record for at least 24 hours by default.
curl --fail-with-body \
--request POST \
--header "Authorization: Bearer $COURSEPAN_API_KEY" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: crm-import-2026-08-01-row-1842" \
--data '{"email":"[email protected]","name":"Example Learner"}' \
"https://api.coursepan.com/api/v1/management/contacts"
Reusing a key with a different HTTP method, route, If-Match value, or
canonical JSON body returns 409 idempotency_conflict. A completed replay
returns the original response with Idempotent-Replayed: true.
Updating existing state
Mutations of existing resources also require optimistic concurrency. Read the resource,
retain its opaque ETag response header, and send that exact value in
If-Match. Never construct or modify an ETag yourself.
HTTP/1.1 200 OK
ETag: "v4-opaque-value"
curl --fail-with-body \
--request PATCH \
--header "Authorization: Bearer $COURSEPAN_API_KEY" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: contact-name-01900000-attempt-1" \
--header 'If-Match: "v4-opaque-value"' \
--data '{"name":"Updated Learner"}' \
"https://api.coursepan.com/api/v1/management/contacts/01900000-0000-7000-8000-000000000001"
A missing precondition returns 428; a stale ETag returns 412.
Fetch the current resource, reconcile your intended change, and retry with a new
idempotency key and the new ETag.
Important resource rules
- Money is always an integer in the currency’s smallest unit. Byte counts are exact integers.
- Offer prices and courses become purchase history once used. Archive and replace a purchased catalogue instead of rewriting it.
- Enrollment revocation removes only the named API-managed grant; it cannot erase access supplied by a purchase, group, or another source.
- Confirming a campaign freezes its audience and configuration. Cancel unsent work or create a replacement instead of mutating confirmed history.
- Automation definitions are versioned. Dry-test before publishing and create a new version for a published workflow.
- Community moderation requires its own scope, an explicit reason, a client correlation ID, and authorized staff membership. Decisions enter an immutable moderation ledger.
- Private conversations, direct messages, file storage paths, payment credentials, and raw provider secrets are not exposed by this API.
Pagination, filters, and response shape
List endpoints accept page and per_page. Page size defaults
to 25 and is capped at 100. Most resources also expose stable filters such as state,
status, identifiers, or updated_after; see the OpenAPI contract for each
endpoint.
{
"data": [],
"meta": {
"page": 1,
"per_page": 25,
"total": 0,
"last_page": 1
}
}
Single resources use {"data": {...}}. Dates and times use ISO 8601.
UUIDs are opaque identifiers and should not be interpreted.
Signed outbound webhooks
Create an HTTPS endpoint with webhooks:manage, select explicit event names,
and copy the signing secret shown once. CoursePan validates public DNS, permits HTTPS
on port 443, pins the resolved destination for the request, rejects redirects and
private/reserved networks, retries transient failures, and exposes sanitized delivery
evidence and explicit replay controls.
CoursePan-Delivery-Id: <delivery UUID>
CoursePan-Event: enrollment.started
CoursePan-Timestamp: <Unix seconds>
CoursePan-Signature: v2=<lowercase hex HMAC-SHA256>
Verify the signature over the exact raw request bytes before parsing JSON:
signed_payload = timestamp + "." + delivery_id + "." + raw_body
expected = hex_hmac_sha256(signing_secret, signed_payload)
Parse every comma-separated signature and accept a constant-time match for a secret
version you currently trust. During the default 24-hour rotation window CoursePan may
send both the new and previous signatures. Reject timestamps outside your chosen
tolerance (five minutes is recommended), persist processed delivery IDs, and return a
2xx only after the event is durably accepted. Events are versioned and may
be delivered more than once.
Errors
{
"error": {
"code": "insufficient_scope",
"message": "This API key does not include the required scope."
}
}
Clients should branch on the stable error.code, not the human message.
Validation failures may also contain a field map. Expected status classes are:
401missing, malformed, expired, or revoked key;403unavailable plan feature, disallowed IP, or insufficient scope;404resource not found within the key’s school;409lifecycle, immutable-history, or idempotency conflict;412staleIf-Matchvalue;422invalid request fields or missing idempotency key;428requiredIf-Matchheader missing;429key request budget exhausted.
Audit, privacy, and support
The API key screen shows recent append-only lifecycle and request activity. Audit data contains fixed route names, scope, HTTP method, status, reason code, and actor where applicable. It does not retain bearer values, request or response bodies, URLs, query strings, email content, private messages, or raw client IP addresses.
CoursePan may add optional response fields or new event types within v1. Breaking request or response changes require a new API version. For integration help or to report unsafe behavior, use the support and abuse channel.