Set up your institution, step by step. Start here.

How to Set Up the Developer API: API Keys, Allowed Websites & Headless Mode

Let your own website show your Course37 courses and pages — and, in Headless mode, sign students in and teach them — with API keys you create, limit and revoke in Integrations.


Your students normally learn on the website Course37 hosts for you. The Developer API lets a website you own — built by your developer, on your own domain — show your courses and pages from Course37, and even run the whole student side: sign-up, sign-in and lessons. You keep managing everything in Course37; your website shows it.

How to get here: in the left sidebar under Platform, click Integrations, open the Developer API category — Show your courses and pages on your own website — and click Configure on the Headless API card. The card shows Not set up until you switch the API on, then On · N keys.

Owner only. Only the organization's owner can change these settings, because a key hands your data to whoever holds it. Anyone else sees Only the organization owner can manage Developer API keys.

The dialog has five parts, from top to bottom: Your own website, Allowed websites, Connection, API keys and New key.


1. Choose How Your Own Website Works

Under Your own website, click one of three modes. It saves straight away: Developer API turned on (or turned off).

Mode What it does Choose it when
Off Students use your Course37 site only. API keys do not work. You don't have a website of your own
Hybrid Your own website shows your courses and pages from the API. Enroll and Login send students to your Course37 site. Your website is for marketing; learning stays on Course37
Headless Your own website is the whole student side: students sign up, sign in, watch and read their courses through the API. Your website replaces the Course37 student site

Your Course37 site keeps working in every mode. Hybrid and Headless only switch the API on — students can still sign in and learn on your Course37 site. So you can try your own website before you send students to it, and switch back to Off at any time.

Taking exams and submitting assignments aren't in the API yet (Taking exams and submitting assignments through the API are coming next). Until then, a Headless website sends students to your Course37 site for those, where they use the same account.


2. List Your Allowed Websites

A publishable key only works in a browser on the websites listed under Allowed websites. Type one address per line and click Save websites: Allowed websites saved.

  • Enter the address only, without a page path: https://acme.com, not https://acme.com/courses.
  • If your site also opens with www., add that separately: https://www.acme.com.
  • Addresses must start with https://. Typing acme.com saves it as https://acme.com.
  • While your developer builds the site on their computer, also add http://localhost:3000 — the only kind of address allowed without https.
  • Wildcards such as *.acme.com are not accepted. You can list up to 20 websites.

Changes reach every server within a minute.


3. The Connection Panel

Connection holds what your developer needs:

  • API URL, with a copy button: https://api.course37.com/v1.
  • The endpoints for your organization profile, courses and website pages. Expand Student endpoints (Headless mode): sign-in, courses, lessons, progress for the sign-in and learning endpoints.
  • A ready-to-copy example request, and the rules: send the key in the X-Api-Key header, don't send cookies, and the request limits per key and per visitor.

Send your developer to the Developer API Reference for the details.


4. Create a Key

Under New key:

  1. Enter a Name that says where the key is used, such as Marketing website.
  2. Under Where it runs, choose:
    • Publishable (pk_) — For code in the visitor's browser. Only works on your allowed websites. This is the key a website needs.
    • Secret (sk_) — For your own server only. Refused if it is ever sent from a browser.
  3. Choose its Permissions. A new key has all five ticked — see the table below.
  4. Click Create key.
  5. An amber box shows the key: Key created: copy the key now. It is shown only once and cannot be retrieved later. Copy it, send it to your developer, and click I've saved it.
Permission What it allows
Organization profile (org:read) Name, logo, contact details, theme colours and locale settings
Course catalog (courses:read) Active courses, prices, teachers and the syllabus outline
Website pages (pages:read) Published page-builder pages and their sections
Student sign-in (students:auth) Students sign up (with an OTP code), sign in, sign out and reset their password on your site
Student learning (students:learn) The signed-in student's own profile, courses, lessons, video progress and payments

Live keys start with pk_live_ (publishable) or sk_live_ (secret). A key only ever reaches your own organization's data, and a signed-in student only sees their own.

If the mode is Off, the dialog reminds you: Keys only work once you choose Hybrid or Headless above.

Never put a secret key in website code. Anyone can read a website's code. If a secret key ends up there, rotate it straight away.


5. Manage Your Keys

Each key under API keys shows its name, a Publishable or Secret badge, an Active or Disabled badge, the first characters of the key, its permissions and when it was last used.

Control What it does
Switch Disables the key, or turns it back on. A disabled key stops working at once
Pencil (Edit permissions) Change the key's permissions, then click Save permissions
Rotate key Issues a new key, shown once. The old key keeps working for 24 hours so you can update your website, then it stops. Until then the row says The previous key still works until …
Delete key Deletes the key. Any website or server using it stops working at once

An organization can have up to 20 keys.


Troubleshooting

When something isn't set up, the API answers your developer with a code. Most are fixed in this dialog:

Code your developer sees What it means Fix
api_disabled The mode is Off Choose Hybrid or Headless
headless_mode_required A student tried to sign in while the mode is Hybrid Choose Headless
origin_not_allowed The website's address isn't in Allowed websites Add the exact address — with www. if the site uses it
invalid_api_key The key is wrong, deleted or disabled — or it's an old key, more than 24 hours after a rotation Check the key's switch, or give your developer a new key
secret_key_in_browser A secret key was used in website code Use a publishable key there, and rotate the secret key
insufficient_scope The key is missing a permission Edit the key's permissions
not_a_student An admin or teacher account tried to sign in on your website Only student accounts can sign in there
What you see in the dialog Fix
Not a valid website origin … Use the form https://acme.com (no path). Remove the page path, the wildcard or http:// from that address
An organization can have at most 20 API keys. Delete a key you no longer use
You lost a key Keys are shown only once — rotate it to get a new one

Related: Build Your Own Student Website · Use the Course37 JavaScript SDK · Developer API Reference · Manage Integrations

#developer api #api keys #headless #own website #publishable key #secret key #allowed websites #integrations