{"components":{"schemas":{"ActivationCodeExternalCreateRequest":{"properties":{"eMail":{"description":"Participant's email address. Existing users are matched by email.","title":"Email","type":"string"},"firstName":{"description":"Participant's first name.","title":"Firstname","type":"string"},"lastName":{"description":"Participant's last name.","title":"Lastname","type":"string"},"offerId":{"description":"Offer ID supplied by thepalia for this course and API environment.","format":"uuid","title":"Offerid","type":"string"}},"required":["offerId","firstName","lastName","eMail"],"title":"ActivationCodeExternalCreateRequest","type":"object"},"ActivationCodeExternalCreatedResponse":{"properties":{"code":{"description":"Activation code to give to the participant for the agreed integration.","title":"Code","type":"string"},"registrationUrl":{"description":"Registration URL containing the activation code.","title":"Registrationurl","type":"string"}},"required":["code","registrationUrl"],"title":"ActivationCodeExternalCreatedResponse","type":"object"},"Body_get_token_for_credentials":{"properties":{"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Client ID supplied by thepalia.","title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Client secret supplied by thepalia. Keep it on your server.","title":"Client Secret"}},"title":"Body_get_token_for_credentials","type":"object"},"CourseEnrollmentExternalCreateRequest":{"properties":{"eMail":{"description":"Participant's email address. Existing users are matched by email.","title":"Email","type":"string"},"firstName":{"description":"Participant's first name.","title":"Firstname","type":"string"},"lastName":{"description":"Participant's last name.","title":"Lastname","type":"string"},"offerId":{"description":"Offer ID supplied by thepalia for this course and API environment.","format":"uuid","title":"Offerid","type":"string"}},"required":["offerId","firstName","lastName","eMail"],"title":"CourseEnrollmentExternalCreateRequest","type":"object"},"CourseEnrollmentExternalCreatedResponse":{"properties":{"courseEnrollmentId":{"description":"Enrollment ID used for magic links, progress, and cancellation.","format":"uuid","title":"Courseenrollmentid","type":"string"},"registrationUrl":{"description":"Registration link to send to the participant. Valid for 31 days.","title":"Registrationurl","type":"string"},"userId":{"description":"Participant ID. Store with your customer or order for support.","format":"uuid","title":"Userid","type":"string"}},"required":["userId","courseEnrollmentId","registrationUrl"],"title":"CourseEnrollmentExternalCreatedResponse","type":"object"},"CourseEnrollmentMagicLinkResponse":{"properties":{"magicLink":{"description":"Login link valid for 30 minutes. Generate immediately before redirecting.","title":"Magiclink","type":"string"}},"required":["magicLink"],"title":"CourseEnrollmentMagicLinkResponse","type":"object"},"CourseEnrollmentProgressResponse":{"properties":{"accessibleFrom":{"description":"Start of the participant's course access period.","format":"date-time","title":"Accessiblefrom","type":"string"},"accessibleUntil":{"description":"End of the participant's course access period.","format":"date-time","title":"Accessibleuntil","type":"string"},"completedDurationInSeconds":{"description":"Sum of durations of completed sections, in seconds.","title":"Completeddurationinseconds","type":"integer"},"completedSectionsCount":{"description":"Number of completed sections in the current course.","title":"Completedsectionscount","type":"integer"},"completedUnitsCount":{"description":"Number of fully completed course units.","title":"Completedunitscount","type":"integer"},"completionDate":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Course completion time, or null if the course is incomplete.","title":"Completiondate"},"courseEnrollmentId":{"description":"ID of the requested enrollment.","format":"uuid","title":"Courseenrollmentid","type":"string"},"lastSectionCompletedAt":{"anyOf":[{"format":"date-time","type":"string"},{"type":"null"}],"description":"Most recent section completion time, or null if none.","title":"Lastsectioncompletedat"},"totalDurationInSeconds":{"description":"Sum of all section durations, in seconds.","title":"Totaldurationinseconds","type":"integer"},"totalSectionsCount":{"description":"Total number of sections in the current course.","title":"Totalsectionscount","type":"integer"},"totalUnitsCount":{"description":"Total number of course units.","title":"Totalunitscount","type":"integer"},"userId":{"description":"ID of the participant enrolled in the course.","format":"uuid","title":"Userid","type":"string"}},"required":["courseEnrollmentId","userId","completedSectionsCount","totalSectionsCount","completedUnitsCount","totalUnitsCount","completedDurationInSeconds","totalDurationInSeconds","accessibleFrom","accessibleUntil","lastSectionCompletedAt","completionDate"],"title":"CourseEnrollmentProgressResponse","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"title":"Detail","type":"array"}},"title":"HTTPValidationError","type":"object"},"HealthInsuranceCoveragePublic":{"properties":{"coveragePercent":{"description":"Percentage of the course price covered by the insurer.","maximum":100,"minimum":0,"title":"Coveragepercent","type":"integer"},"id":{"description":"ID of the health-insurance coverage entry.","format":"uuid","title":"Id","type":"string"},"insuranceName":{"description":"Name of the health insurer.","title":"Insurancename","type":"string"},"link":{"description":"Link to the insurer's information about reimbursement.","title":"Link","type":"string"},"maxCoverageAmount":{"description":"Maximum reimbursement amount in euros.","minimum":0,"title":"Maxcoverageamount","type":"integer"}},"required":["id","insuranceName","coveragePercent","link","maxCoverageAmount"],"title":"HealthInsuranceCoveragePublic","type":"object"},"OAuthTokenResponse":{"properties":{"access_token":{"description":"Bearer access token, valid for 24 hours. Reuse until expiry.","title":"Access Token","type":"string"},"token_type":{"description":"Authorization scheme. The API returns Bearer.","title":"Token Type","type":"string"}},"required":["access_token","token_type"],"title":"OAuthTokenResponse","type":"object"},"ValidationError":{"properties":{"ctx":{"title":"Context","type":"object"},"input":{"title":"Input"},"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"title":"Location","type":"array"},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}},"required":["loc","msg","type"],"title":"ValidationError","type":"object"}},"securitySchemes":{"OAuth2":{"description":"Obtain a token at /v1/oauth/token, then send Authorization: Bearer <access_token>.","flows":{"clientCredentials":{"scopes":{},"tokenUrl":"/v1/oauth/token"}},"type":"oauth2"}}},"info":{"description":"Create course enrollments and integrate course access with your checkout. Contact max@thepalia.de for credentials and offer IDs.","title":"thepalia Partner API","version":"v1"},"openapi":"3.1.0","paths":{"/v1/activation-codes":{"post":{"deprecated":true,"description":"Legacy integration. Create an activation code and registration URL for the supplied participant and offer. Use this integration only if thepalia explicitly tells you to; normally create a course enrollment instead. The offer must belong to your partner account and match the API environment. Each request generates a new code, so do not blindly repeat an uncertain request.","operationId":"generate_activation_code","requestBody":{"content":{"application/json":{"example":{"eMail":"alex@example.com","firstName":"Alex","lastName":"Example","offerId":"11111111-1111-4111-8111-111111111111"},"schema":{"$ref":"#/components/schemas/ActivationCodeExternalCreateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"code":"EXAMPLE-CODE","registrationUrl":"https://thepalia.app/courses/register?activationCode=EXAMPLE-CODE&email=alex%40example.com&firstName=Alex&lastName=Example"},"schema":{"$ref":"#/components/schemas/ActivationCodeExternalCreatedResponse"}}},"description":"Activation code created."},"400":{"content":{"application/json":{"example":{"detail":"Could not create activation code"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Could not generate a unique activation code."},"401":{"content":{"application/json":{"example":{"detail":"Invalid token"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Missing, expired, invalid, or inactive API credential token."},"403":{"content":{"application/json":{"example":{"detail":"Access denied"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The enrollment or offer does not belong to your partner account."},"404":{"content":{"application/json":{"example":{"detail":"Not found"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The requested enrollment or offer was not found."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"OAuth2":[]}],"summary":"Create an activation code","tags":["ActivationCodes"]}},"/v1/course-enrollments":{"post":{"description":"After a successful purchase and confirmation of the course's suitability requirements, create an enrollment using the offer ID supplied by thepalia. Existing participants are matched by email. Store userId and courseEnrollmentId with your order, then email registrationUrl to the participant; the registration link is valid for 31 days. Production enrollments are billable. Each request creates a separate enrollment: there is no idempotency protection. After an ambiguous timeout, reconcile with thepalia before submitting again. Prefer this integration over activation codes unless instructed otherwise.","operationId":"create_course_enrollment_external","requestBody":{"content":{"application/json":{"example":{"eMail":"alex@example.com","firstName":"Alex","lastName":"Example","offerId":"11111111-1111-4111-8111-111111111111"},"schema":{"$ref":"#/components/schemas/CourseEnrollmentExternalCreateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"courseEnrollmentId":"33333333-3333-4333-8333-333333333333","registrationUrl":"https://thepalia.app/enrollment/registration?enrollmentId=33333333-3333-4333-8333-333333333333","userId":"22222222-2222-4222-8222-222222222222"},"schema":{"$ref":"#/components/schemas/CourseEnrollmentExternalCreatedResponse"}}},"description":"Enrollment created. Send the registration link to the participant."},"401":{"content":{"application/json":{"example":{"detail":"Invalid token"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Missing, expired, invalid, or inactive API credential token."},"403":{"content":{"application/json":{"example":{"detail":"Access denied"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The enrollment or offer does not belong to your partner account."},"404":{"content":{"application/json":{"example":{"detail":"Not found"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The requested enrollment or offer was not found."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"OAuth2":[]}],"summary":"Create a course enrollment","tags":["CourseEnrollments"]}},"/v1/course-enrollments/{enrollment_id}":{"delete":{"description":"Delete an enrollment belonging to your partner account using its courseEnrollmentId. This removes the enrollment and course access; it does not refund a payment in your checkout system. A successful response is HTTP 204 with no body. A missing or already deleted enrollment returns 404.","operationId":"delete_course_enrollment_external_by_enrollment_id","parameters":[{"description":"courseEnrollmentId returned when the enrollment was created.","in":"path","name":"enrollment_id","required":true,"schema":{"description":"courseEnrollmentId returned when the enrollment was created.","format":"uuid","title":"Enrollment Id","type":"string"}}],"responses":{"204":{"description":"Enrollment deleted. No response body."},"401":{"content":{"application/json":{"example":{"detail":"Invalid token"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Missing, expired, invalid, or inactive API credential token."},"403":{"content":{"application/json":{"example":{"detail":"Access denied"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The enrollment or offer does not belong to your partner account."},"404":{"content":{"application/json":{"example":{"detail":"Not found"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The requested enrollment or offer was not found."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"OAuth2":[]}],"summary":"Cancel a course enrollment","tags":["CourseEnrollments"]}},"/v1/course-enrollments/{enrollment_id}/magic-link":{"get":{"description":"Generate a magic link for an existing enrollment belonging to your partner account. Create it on your server immediately before redirecting the participant; it expires after 30 minutes. Use courseEnrollmentId from enrollment creation. The participant must be an active customer. Do not publish or log the returned link: it authenticates the participant.","operationId":"get_course_enrollment_magic_link_by_enrollment_id","parameters":[{"description":"courseEnrollmentId returned when the enrollment was created.","in":"path","name":"enrollment_id","required":true,"schema":{"description":"courseEnrollmentId returned when the enrollment was created.","format":"uuid","title":"Enrollment Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"magicLink":"https://thepalia.app/user/magic-link/EXAMPLE_TOKEN?ref=%2Fcourses%2F33333333-3333-4333-8333-333333333333"},"schema":{"$ref":"#/components/schemas/CourseEnrollmentMagicLinkResponse"}}},"description":"Temporary login link created."},"401":{"content":{"application/json":{"example":{"detail":"Invalid token"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Missing, expired, invalid, or inactive API credential token."},"403":{"content":{"application/json":{"example":{"detail":"Access denied"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The enrollment or offer does not belong to your partner account."},"404":{"content":{"application/json":{"example":{"detail":"Not found"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The requested enrollment or offer was not found."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"OAuth2":[]}],"summary":"Generate a course login link","tags":["CourseEnrollments"]}},"/v1/course-enrollments/{enrollment_id}/progress":{"get":{"description":"Read progress for an enrollment belonging to your partner account using its courseEnrollmentId. Counts and durations refer to sections and units in the current course. Dates describe the access period and completion state; completionDate and lastSectionCompletedAt may be null. This request does not change the enrollment.","operationId":"get_course_enrollment_progress_by_enrollment_id","parameters":[{"description":"courseEnrollmentId returned when the enrollment was created.","in":"path","name":"enrollment_id","required":true,"schema":{"description":"courseEnrollmentId returned when the enrollment was created.","format":"uuid","title":"Enrollment Id","type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"accessibleFrom":"2026-01-01T00:00:00","accessibleUntil":"2027-01-01T00:00:00","completedDurationInSeconds":900,"completedSectionsCount":3,"completedUnitsCount":1,"courseEnrollmentId":"33333333-3333-4333-8333-333333333333","lastSectionCompletedAt":"2026-01-02T10:00:00","totalDurationInSeconds":3600,"totalSectionsCount":12,"totalUnitsCount":4,"userId":"22222222-2222-4222-8222-222222222222"},"schema":{"$ref":"#/components/schemas/CourseEnrollmentProgressResponse"}}},"description":"Current progress and access period."},"401":{"content":{"application/json":{"example":{"detail":"Invalid token"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Missing, expired, invalid, or inactive API credential token."},"403":{"content":{"application/json":{"example":{"detail":"Access denied"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The enrollment or offer does not belong to your partner account."},"404":{"content":{"application/json":{"example":{"detail":"Not found"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"The requested enrollment or offer was not found."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"}},"security":[{"OAuth2":[]}],"summary":"Read enrollment progress","tags":["CourseEnrollments"]}},"/v1/info/health-insurance-coverages":{"get":{"description":"List the configured health insurers and their course reimbursement information. This endpoint is public and does not require an access token. Entries contain a coverage percentage, a maximum reimbursement amount in euros, and a link to the insurer's information. Use the insurer's current terms to confirm eligibility.","operationId":"get_health_insurance_coverages","responses":{"200":{"content":{"application/json":{"example":[{"coveragePercent":80,"id":"44444444-4444-4444-8444-444444444444","insuranceName":"Example insurance","link":"https://example.com/reimbursement","maxCoverageAmount":100}],"schema":{"items":{"$ref":"#/components/schemas/HealthInsuranceCoveragePublic"},"title":"Response Get Health Insurance Coverages","type":"array"}}},"description":"Configured health-insurance coverages."}},"summary":"List health-insurance coverages","tags":["Info"]}},"/v1/oauth/token":{"post":{"description":"Exchange the client_id and client_secret supplied by thepalia for a Bearer token valid for 24 hours. Reuse it in the Authorization header until expiry. Credential issuance is limited to 20 requests per minute per client IP. JSON, URL-encoded form, multipart form, and HTTP Basic credentials are accepted. With HTTP Basic, send Authorization: Basic base64(client_id:client_secret); no body is needed. Keep credentials in your server, never in participant-facing browser code.","operationId":"get_token_for_credentials","requestBody":{"content":{"application/json":{"example":{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET"},"schema":{"properties":{"client_id":{"description":"Client ID supplied by thepalia.","title":"Client Id","type":"string"},"client_secret":{"description":"Client secret supplied by thepalia. Keep it on your server.","title":"Client Secret","type":"string"}},"required":["client_id","client_secret"],"title":"OAuthCredentials","type":"object"}},"application/x-www-form-urlencoded":{"example":{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET"},"schema":{"$ref":"#/components/schemas/Body_get_token_for_credentials","properties":{"client_id":{"description":"Client ID supplied by thepalia.","title":"Client Id","type":"string"},"client_secret":{"description":"Client secret supplied by thepalia. Keep it on your server.","title":"Client Secret","type":"string"}},"required":["client_id","client_secret"],"title":"OAuthCredentials","type":"object"}},"multipart/form-data":{"example":{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET"},"schema":{"properties":{"client_id":{"description":"Client ID supplied by thepalia.","title":"Client Id","type":"string"},"client_secret":{"description":"Client secret supplied by thepalia. Keep it on your server.","title":"Client Secret","type":"string"}},"required":["client_id","client_secret"],"title":"OAuthCredentials","type":"object"}}},"description":"Send credentials in a body, or omit the body and use HTTP Basic authentication.","required":false},"responses":{"200":{"content":{"application/json":{"example":{"access_token":"EXAMPLE_ACCESS_TOKEN","token_type":"Bearer"},"schema":{"$ref":"#/components/schemas/OAuthTokenResponse"}}},"description":"Access token issued."},"400":{"content":{"application/json":{"example":{"detail":"Invalid JSON body"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Malformed credentials, invalid JSON, or missing form fields."},"401":{"content":{"application/json":{"example":{"detail":"invalid credentials"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Incorrect or inactive client credentials."},"404":{"description":"Not found"},"415":{"content":{"application/json":{"example":{"detail":"Use application/json or application/x-www-form-urlencoded or basic auth header"},"schema":{"properties":{"detail":{"description":"Human-readable error message.","type":"string"}},"required":["detail"],"type":"object"}}},"description":"Unsupported request content type."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}},"description":"Validation Error"},"429":{"content":{"application/json":{"example":{"error":"Rate limit exceeded: 20 per 1 minute"},"schema":{"properties":{"error":{"description":"Human-readable error message.","type":"string"}},"required":["error"],"type":"object"}}},"description":"Token issuance exceeded 20 requests per minute. Retry with delay."}},"summary":"Obtain an API access token","tags":["OAuth"]}}},"servers":[{"description":"Production — enrollments are billed","url":"https://api.thepalia.de"},{"description":"Staging — testing, no completion certificates","url":"https://api.staging.thepalia.de"}]}