This article explains how to use Freshlearn APIs
The FreshLearn API is based around REST. We return JSON for every request.
This is unique API key which you will use in the API’s .
To start using the FreshLearn API, You have to login to your Admin account and go to Settings -> User and click on your user. You will find the API Key.
FreshLearn API lets you send the information about member and course enrollment related details seamlessly.
Retrieve all of the existing member for the authenticated user.
https://api.freshlearn.com/v1/integration/member
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Adds a New Member
https://api.freshlearn.com/v1/integration/member
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Request Parameters:
In each POST Request body following parameters need to be sent in JSON
| Mandatory, Member’s email address | |
| fullName | Mandatory, Member’s full name |
| phone | Member’s Phone Number |
| city | Member’s city of residence |
| source | Mandatory, Zapier/FreshLearn/etc |
Update member information based on registered email
https://api.freshlearn.com/v1/integration/member/update
Header Parameters:
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Request Parameters:
In each PUT Request body following parameters need to be sent in JSON
| Mandatory, Member’s email address, (email can not be modified) | |
| fullName | Mandatory, Member’s full name |
| phone | Member’s Phone Number |
| city | Member’s city of residence |
| source | Mandatory, Zapier/FreshLearn/etc |
curl -X PUT \
https://api.freshlearn.com/v1/integration/member/update \
-H 'api-key: ffec555c3fc0a0882f2720weewew' \
-H 'content-type: application/json' \
-d '{ "email": "john@gmail.com","fullName": "John Sculley",
"phone": "0113452310", "city": "Seattle", "source": "Zapier’
}'
Enroll existing member in a course
https://api.freshlearn.com/v1/integration/member/enroll
Parameters:
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Request Parameters:
In each POST Request body following parameters need to be sent in JSON
| courseId | Mandatory, Course unique identifier from Admin Portal.You will find this under the course name. See here |
|---|---|
| planId | Mandatory, You will find this against the course -> pricing. |
| memberEmail | Mandatory, Member’s Email Address, |
| paymentGateway | STRIPE/RAZORPAY/PAYPAL/MANUAL/FREE |
| paymentType | CHEQUE/ONLINE/CASH/GIFT/RECURRING/OTHER |
| reference | References if any for enrollment |
| transactionDate | Payment transaction date in ‘yyyy-MM-dd’ format |
| transactionId | Mandatory, Payment unique identifier for the enrollment |
| source | Mandatory, Zapier/FreshLearn/etc |
curl -X POST \
https://api.freshlearn.com/v1/integration/member/enroll \
-H 'api-key: ffec555c3fc0a0882f2720weewew' \
-H 'content-type: application/json' \
-d '{ "courseId": 39555,"planId": 40234, "memberEmail":
"john@gmail.com","paymentGateway": "stripe",
"paymentType": "cheque", "reference": "Course Enrollment Fee",
"transactionDate": "2021-01-01","transactionId": "abc_1123345",
"source": "zapier"
}
{
"courseId": 39555,
"planId": 40234,
"memberEmail": "john@gmail.com",
"paymentGateway": "stripe",
"paymentType": "cheque",
"reference": "Course Enrollment Fee",
"transactionDate": "2021-01-01",
"transactionId": "abc_1123345",
"source": "zapier"
}
Course Completed Members
https://api.freshlearn.com/v1/integration/member/completed-courses
Parameters:
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
curl -X GET \
https://api.freshlearn.com/v1/integration/member/completed-courses \
{
"id": 1011804,
"courseId": 157636,
"courseName": "Email Marketing Mastery",
"email": "john.doe@example.com",
"amount": 245,
"planId": 40234,
"planName": "Premium Subscription",
"courseCompletionTime": "2023-12-18",
"createdTime": 1702888189,
"domainId": "57",
"rating": "null",
"courseCompletion": "100",
}
Enroll Course for New and Existing Members:
https://api.freshlearn.com/v1/integration/member/createMemberAndEnroll
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Request Parameters:
In each POST Request body following parameters need to be sent in JSON
| Mandatory, Member’s email address | |
| fullName | Mandatory, Member’s full name |
| phone | Member’s Phone Number |
| city | Member’s city of residence |
| source | Mandatory, Zapier/FreshLearn/etc |
| courseId | Mandatory, Course unique identifier from Admin Portal.You will find this under the course name. See here |
| planId | Mandatory, You will find this against the course -> pricing. |
| paymentGateway | STRIPE/RAZORPAY/PAYPAL/MANUAL/FREE |
| paymentType | CHEQUE/ONLINE/CASH/GIFT/RECURRING/OTHER |
| reference | References if any for enrollment |
| transactionDate | Payment transaction date in ‘yyyy-MM-dd’ format |
| transactionId | Mandatory, Payment unique identifier for the enrollment |
| source | Mandatory, Zapier/FreshLearn/etc |
Unenroll member from a course.
https://api.freshlearn.com/v1/integration/member/unenroll/course
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Enroll a New and Existing Member to ProductBundle
https://api.freshlearn.com/v1/integration/member/enroll/productBundle
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Request Parameters:
In each POST Request body following parameters need to be sent in JSON
| Mandatory, Member’s email address | |
| fullName | Mandatory, Member’s full name |
| phone | Member’s Phone Number |
| city | Member’s city of residence |
| source | Mandatory, Zapier/FreshLearn/etc |
| courseId | Mandatory, Course unique identifier from Admin Portal.You will find this under the course name. See here |
| planId | Mandatory, You will find this against the course -> pricing. |
| paymentGateway | STRIPE/RAZORPAY/PAYPAL/MANUAL/FREE |
| paymentType | CHEQUE/ONLINE/CASH/GIFT/RECURRING/OTHER |
| reference | References if any for enrollment |
| transactionDate | Payment transaction date in ‘yyyy-MM-dd’ format |
| transactionId | Mandatory, Payment unique identifier for the enrollment |
| source | Mandatory, Zapier/FreshLearn/etc |
Returns the course structure including modules and chapters. Only returns enabled modules and published chapters.
https://api.freshlearn.com/v1/integration/course/{courseId}/structure
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Path Parameters:
| courseId | Mandatory, The unique ID of the course |
|---|
curl -X GET \
https://api.freshlearn.com/v1/integration/course/1234/structure \
-H 'api-key: ffec555c3fc0a0882f2720weewew' \
-H 'content-type: application/json'
Marks specified chapters as completed for specified or ALL enrolled members. Processing is asynchronous — returns 202 Accepted immediately.
https://api.freshlearn.com/v1/integration/course/{courseId}/complete-chapters
Header Parameters
| Key | Value |
|---|---|
| api-key | This is the request header parameter, unique key assigned in your admin settings. |
Path Parameters:
| courseId | Mandatory, The unique ID of the course |
|---|
Request Parameters:
In each POST Request body following parameters need to be sent in JSON
| chapterIds | Mandatory, List of chapter IDs to mark as completed |
|---|---|
| memberEmails | Optional, List of member email addresses. If empty or null, chapters will be marked complete for ALL enrolled members. |
curl -X POST \
https://api.freshlearn.com/v1/integration/course/1234/complete-chapters \
-H 'api-key: ffec555c3fc0a0882f2720weewew' \
-H 'content-type: application/json' \
-d '{ "chapterIds": [1001, 1002, 1003],
"memberEmails": ["john@gmail.com", "jane@gmail.com"]
}
FreshLearn API integration uses HTTP status to indicate the status of the request, Here is the possible response codes
200 OK Success response
201 CREATED when new requested item is created
202 ACCEPTED request accepted for asynchronous processing
400 Bad Request you did not provide Mandatory, parameter or wrong data
401 Unauthorized you did not provide a valid api key