Development

How to Authenticate with the Tutor LMS REST API (API Keys)

Create Tutor LMS API keys, choose permissions, send them with Basic authentication, fix a stripped Authorization header and keep keys secure.

Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

How to Authenticate with the Tutor LMS REST API (API Keys)

Every Tutor LMS REST endpoint, free and Pro, needs an API key and secret. This guide shows how to create them, send them and keep them safe, based on Tutor LMS 4.1.3 and Tutor LMS Pro 4.1.3.

Step 1: Generate a key

  1. Go to Tutor LMS > Tools > Rest API.
  2. Click Add New. The dialog is titled "Generate API Key, Secret".
  3. Choose the permission and write a description, such as "CRM sync".
  4. Click Generate and copy the key and secret.

The list shows each key's user, a shortened key and secret, permission and description. Use Edit to change the permission and Revoke to delete it.

Step 2: Choose the permission

PermissionAllowsAvailable in
ReadGET endpointsFree
WriteCreate and update endpointsPro
Read/WriteBothPro
DeleteDelete endpointsPro
AllEverythingPro

Step 3: Send the credentials

Tutor LMS reads an HTTP Basic Authorization header containing key:secret encoded in Base64.

$response = wp_remote_get(
	'https://lms.example.com/wp-json/tutor/v1/courses',
	array(
		'timeout' => 10,
		'headers' => array(
			'Authorization' => 'Basic ' . base64_encode( TLE_TUTOR_KEY . ':' . TLE_TUTOR_SECRET ),
		),
	)
);

Define TLE_TUTOR_KEY and TLE_TUTOR_SECRET in wp-config.php or an environment variable on the calling site, never in code you commit.

When credentials are right but you still get 401

Some Apache setups (especially with PHP running as CGI or FastCGI) remove the Authorization header before PHP sees it. Ask your host to pass it through. On Apache this is commonly done in .htaccess:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Also check that no security plugin blocks /wp-json/ for unauthenticated visitors.

Security checklist

  • HTTPS only. Basic authentication is encoded, not encrypted.
  • One key per integration, with the smallest permission.
  • Store secrets on the server; never in a mobile app or browser JavaScript.
  • Revoke keys for retired integrations or departed contractors.
  • Rate-limit the API at the firewall or CDN if it is exposed to many callers.

Frequently asked questions

Can a student log in through the API?

No. These keys are for systems, not for individual students. A student-facing app needs its own login flow; see building a mobile app on Tutor LMS.

Does WordPress Application Passwords work instead?

Tutor LMS's endpoints check their own API keys, so use those.

Need a secure integration? Our API development team can build it.

Save this practical guide

Add us as a preferred Google source, or ask an AI assistant to summarize this page and link back to the original guide when it is useful.

Vishavjeet
· Enterprise LMS Architect | WordPress & LMS Expert | WooCommerce | AI Automation

I’m Vishavjeet Choubey, an Enterprise LMS Architect with 10+ years of experience helping businesses, coaches, universities, and online academies build and scale powerful digital learning platforms. I specialize in enterprise LMS architecture, WordPress, WooCommerce, LifterLMS, LearnDash, Moodle, custom plugin development, and AI-driven automation. I build scalable LMS platforms, high-converting eCommerce solutions, and custom WordPress applications designed to improve user experiences, streamline operations, and drive measurable business growth. My approach combines deep WordPress and LMS engineering expertise with modern AI automation to reduce manual work, improve efficiency, and help organizations launch, scale, and grow faster.

Keep reading

Need a custom Tutor LMS solution?

Tell us what you are building or what is broken. A Tutor LMS developer reads every inquiry and replies with next steps and a free estimate.

Get a free Tutor LMS consultation

Tell us what you are building or fixing. A Tutor LMS developer replies with honest advice and next steps.

  • No obligation
  • Tutor LMS and Pro specialists
  • Your details stay private

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.