thepaliaDevelopers

Open a course with a magic link

Add a course-access button to your app or customer account area.

Before you start

You need an existing enrollment, its stored courseEnrollmentId, and your API credentials. First follow Create a course enrollment. Contact our dev team if you need integration details.

The endpoint accepts enrollments belonging to your partner account and active customer users. Protect your own course button so a customer can only request a link for their own enrollment.

1. Reuse or obtain an API token

Reuse an unexpired API token. If you need a new one, call POST /v1/oauth/token using the authentication reference:

{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}

Tokens last 24 hours. Issuance is limited to 20 requests per minute per client IP. Keep credentials and token handling on your server.

Use https://api.staging.thepalia.de for testing; staging does not generate completion certificates. Use https://api.thepalia.de for production with matching credentials and enrollment IDs. Production enrollments are billed.

Call GET /v1/course-enrollments/{enrollment_id}/magic-link, replacing {enrollment_id} with the stored courseEnrollmentId.

Authorization: Bearer EXAMPLE_ACCESS_TOKEN

The magic-link reference includes the full request, errors, and playground. A successful HTTP 200 response contains:

{
  "magicLink": "https://staging.thepalia.app/user/magic-link/EXAMPLE_TOKEN?ref=%2Fcourses%2F33333333-3333-4333-8333-333333333333"
}

3. Redirect immediately

Redirect the participant to the returned magicLink. It authenticates them and sends them to the course.

The link expires after 30 minutes, so generate it immediately before redirecting. Do not pre-generate links for a campaign or store them as permanent course URLs. Do not publish or log them.

If authentication fails, check or renew the API token. For other errors, use the error-handling guidance. Read requests can use limited retries with a delay.

Check your integration

Using a staging enrollment, click your course button and verify that your server requests a fresh magic link, redirects to it, and opens the correct participant's course. The button should generate a new link each time it is used.

On this page