Introduction
In this documentation, you will learn how to use Zenedu's REST API to integrate our platform with other services
The API is based on the HTTP protocol and all responses are returned in JSON format. All requests must have Accept: application/json
key-value in headers.
Base URL
The base URL for all API endpoints is: https://app.zenedu.io/api/v1/
All requests must have Accept: application/json
key-value in headers.
Authentication
The Zenedu API uses Bearer token authentication to ensure secure access to protected endpoints. To interact with the API, you must include an authorization header with each request.
Obtaining an API Token
To obtain your API token, navigate to the API section in your account page. The token is generated during registration and remains valid indefinitely.
It is of utmost importance not to expose your API token in publicly accessible code or repositories. If you suspect any compromise of your API token, reset it immediately and acquire a new one through the same page.
Making Authenticated Requests
Once you have obtained your API token, include it in your requests using the Authorization header. Set the value of the header to Bearer YOUR_API_TOKEN
.
Example request:
curl -X GET "https://app.zenedu.io/api/v1/endpoint" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Endpoints
Bots
Description
Retrieve a list of all your bots using this endpoint.
URL:
https://app.zenedu.io/api/v1/bots
Method: GET
Authentication: Bearer token in headers
Parameters: None
Results: The list of bots is sorted in descending order by creation date.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bots" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 2,
"name": "Test Bot 2",
"username": "test_bot_2",
"is_active": true,
"created_at": "2023-07-24T07:58:52.000000Z"
},
{
"id": 1,
"name": "Test Bot",
"username": "test_bot",
"is_active": true,
"created_at": "2023-06-23T09:41:34.000000Z"
}
]
}
Subscribers
Description
Get a list of all your subscribers for given bot using this endpoint. The results are paginated with 30 items per page.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/subscibers
Method: GET
Authentication: Bearer token in headers
Parameters: Use the
per_page
andpage
parameters to control the number of results per page.Results: The list of subscribers is sorted in descending order by creation date.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bot/1/subscribers?per_page=30&page=1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 3,
"user_id": 1002,
"first_name": "Sarah",
"last_name": "Connor",
"username": "sarah_connor",
"phone": null,
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2023-07-24T14:43:12.000000Z",
"created_at": "2023-07-24T14:43:10.000000Z",
"utm_tags": {
"utm_source": "source",
"utm_medium": "medium",
"utm_campaign": "campaign",
"utm_term": "term",
"utm_content": "content"
},
"custom_fields": {
"Address": "Address",
"Website": "https://zenedu.io"
}
},
{
"id": 2,
"user_id": 1001,
"first_name": "Foo",
"last_name": "Bar",
"username": "foo_bar",
"phone": null,
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2023-07-24T14:43:12.000000Z",
"created_at": "2023-07-24T14:41:44.000000Z",
"utm_tags": [],
"custom_fields": []
},
{
"id": 1,
"user_id": 1000,
"first_name": "John",
"last_name": null,
"username": "john",
"phone": null,
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2023-07-24T14:43:12.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z",
"utm_tags": [],
"custom_fields": []
}
],
"links": {
"first": "https://app.zenedu.io/api/v1/bot/1/subscribers?page=1",
"last": "https://app.zenedu.io/api/v1/bot/1/subscribers?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.zenedu.io/api/v1/bot/1/subscribers?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://app.zenedu.io/api/v1/bot/1/subscribers",
"per_page": 30,
"to": 3,
"total": 3
}
}
Orders
Description
Obtain a list of all your orders for given bot using this endpoint. The results are paginated with 30 items per page.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/orders
Method: GET
Authentication: Bearer token in headers
Results: The list of orders is sorted in descending order by creation date.
Parameters: Use the
per_page
andpage
parameters to control the number of results per page.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bot/1/orders?per_page=30&page=1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 2,
"uuid": "9d76cf9c-fdb4-4f7b-98e4-76b96159df93",
"number": 2,
"offer_id": 2,
"offer_name": "Offer 2",
"price": 1,
"currency": "USD",
"type": "one-time",
"payment_system_type": "fondy",
"payment_system_name": "Fondy",
"status_changed_at": "2023-07-24T14:43:52.000000Z",
"created_at": "2023-07-24T14:43:24.000000Z",
"subscriber": {
"id": 1,
"user_id": 1000,
"first_name": "John",
"last_name": null,
"username": "john",
"phone": null,
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2023-07-27T08:39:03.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z"
}
},
{
"id": 1,
"uuid": "a9e58c73-f6a8-413e-b6c5-7af312bf315b",
"number": 1,
"offer_id": 1,
"offer_name": "Offer 1",
"price": 1,
"currency": "USD",
"subscriber_id": 1,
"type": "subscription",
"payment_system_type": "stripe",
"payment_system_name": "Stripe",
"status_changed_at": "2023-07-24T14:42:12.000000Z",
"created_at": "2023-07-24T14:41:52.000000Z",
"subscriber": {
"id": 2,
"user_id": 1001,
"first_name": "Foo",
"last_name": "Bar",
"username": "foo_bar",
"phone": null,
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2023-07-27T08:39:03.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z"
}
}
],
"links": {
"first": "https://app.zenedu.io/api/v1/bot/1/orders?page=1",
"last": "https://app.zenedu.io/api/v1/bot/1/orders?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "<< Previous",
"active": false
},
{
"url": "https://app.zenedu.io/api/v1/bot/1/orders?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next >>",
"active": false
}
],
"path": "https://app.zenedu.io/api/v1/bot/1/orders",
"per_page": 30,
"to": 2,
"total": 2
}
}
Offers
Description
Obtain a list of all your offers for a given bot using this endpoint. The results are paginated with 30 items per page.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/offers
Method: GET
Authentication: Bearer token in headers
Results: The list of offers is sorted in descending order by creation date.
Parameters: Use the per_page and page parameters to control the number of results per page.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bot/1/offers?per_page=30&page=1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 177,
"name": "Intensiv Leonardo",
"price": 10,
"currency": "USD",
"is_active": true,
"is_subscription": false,
"accesses_count": 1,
"description": null,
"landing_name": "Intensiv Leonardo",
"landing_description": "",
"cover_url": null,
"request_contacts": false,
"time_limit_enabled": false,
"usage_limit_enabled": false,
"access_limit_enabled": false,
"created_at": "2024-08-15T10:07:01.000000Z"
},
{
"id": 172,
"name": "Coupon with sub",
"price": 100,
"currency": "USD",
"is_active": true,
"is_subscription": true,
"accesses_count": 1,
"description": "<b>Offer:</b> {{offer}} <br><b>Accesses:</b> {{accesses}} <br><b>Price:</b> {{price}}",
"landing_name": "Coupon with sub",
"landing_description": "<b>Accesses:</b> OneTime product",
"cover_url": null,
"request_contacts": false,
"time_limit_enabled": true,
"usage_limit_enabled": true,
"access_limit_enabled": false,
"created_at": "2024-07-24T18:59:46.000000Z"
}
],
"links": {
"first": "https://app.zenedu.io/api/v1/bot/1/offers?page=1",
"last": "https://app.zenedu.io/api/v1/bot/1/offers?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.zenedu.io/api/v1/bot/1/offers?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://app.zenedu.io/api/v1/bot/1/offers",
"per_page": 30,
"to": 14,
"total": 14
}
}
Funnels
Description
Obtain a list of all your funnels for a given bot using this endpoint. The results are paginated with 30 items per page.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/funnels
Method: GET
Authentication: Bearer token in headers
Results: The list of funnels is sorted in descending order by creation date.
Parameters: Use the per_page and page parameters to control the number of results per page.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bot/1/funnels?per_page=30&page=1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 263,
"name": "Intensiv Leonardo",
"is_active": true,
"subscribers_count": 1,
"steps_count": 1,
"sections_count": 0,
"cover_url": "https://app.zenedu.io/assets/img/product_blank/3.jpg",
"description": null,
"restart_enabled": true,
"autodelete_steps_enabled": true,
"template_url": "https://app.zenedu.io/bots?template=oMzBCK7MZqEwzrTbczlb9YjEIPUS9cK4",
"template_url_enabled": true,
"created_at": "2024-08-15T10:05:58.000000Z",
"direct_subscription_access": false
}
],
"links": {
"first": "https://app.zenedu.io/api/v1/bot/1/funnels?page=1",
"last": "https://app.zenedu.io/api/v1/bot/1/funnels?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.zenedu.io/api/v1/bot/1/funnels?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://app.zenedu.io/api/v1/bot/1/funnels",
"per_page": 30,
"to": 16,
"total": 16
}
}
Products
Description
Obtain a list of all your products for a given bot using this endpoint. The results are paginated with 30 items per page.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/products
Method: GET
Authentication: Bearer token in headers
Results: The list of products is sorted in descending order by creation date.
Parameters: Use the per_page and page parameters to control the number of results per page.
Example request
curl -X GET "https://app.zenedu.io/api/v1/bot/1/products?per_page=30&page=1" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN"
Example response
{
"data": [
{
"id": 253,
"name": "Assessments Test",
"is_active": true,
"subscribers_count": 1,
"steps_count": 8,
"sections_count": 0,
"cover_url": "https://app.zenedu.io/assets/img/product_blank/3.jpg",
"description": null,
"restart_enabled": false,
"autodelete_steps_enabled": true,
"template_url": "https://app.zenedu.io/bots?template=Bmsyk0unsFmyXcGxDovtJrDgOAMjOapI",
"template_url_enabled": true,
"created_at": "2024-06-19T07:20:02.000000Z"
}
],
"links": {
"first": "https://app.zenedu.io/api/v1/bot/1/products?page=1",
"last": "https://app.zenedu.io/api/v1/bot/1/products?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.zenedu.io/api/v1/bot/1/products?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "https://app.zenedu.io/api/v1/bot/1/products",
"per_page": 30,
"to": 12,
"total": 12
}
}
Add Subscriber To Funnel
Description
You can add a subscriber to a specific funnel using this method.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/subscribers/{subscriberId}/funnels
Method: POST
Authentication: Bearer token in headers
Parameters: funnel_id in form data.
Example request
curl -X POST "https://app.zenedu.io/api/v1/bot/1/subscribers/1/funnels" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN" –form “funnel_id=1”
Example response
{
"id": 1,
"user_id": 111222,
"first_name": "Student",
"last_name": null,
"username": null,
"phone": "+111222333444",
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2024-08-19T09:20:38.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z"
}
Add Subscriber To Offer
Description
You can add a subscriber to a specific offer using this method.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/subscribers/{subscriberId}/offers
Method: POST
Authentication: Bearer token in headers
Parameters: offer_id in form data.
Example request
curl -X POST "https://app.zenedu.io/api/v1/bot/1/subscribers/1/offers" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN" –form “offer_id=1”
Example response
{
"id": 1,
"user_id": 111222,
"first_name": "Student",
"last_name": null,
"username": null,
"phone": "+111222333444",
"email": null,
"notes": null,
"tags": null,
"is_active": true,
"is_blocked": false,
"last_active_at": "2024-08-19T09:20:38.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z"
}
Add Tags To Subscriber
Description
You can add tags to a subscriber using this method.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/subscribers/{subscriberId}/tags
Method: POST
Authentication: Bearer token in headers
Parameters: tags[] in form data.
Example request
curl -X POST "https://app.zenedu.io/api/v1/bot/1/subscribers/1/tags" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN" –form “tags[]=’tag1’” –form “tags[]=’tag2’”
Example response
{
"id": 1,
"user_id": 111222,
"first_name": "Student",
"last_name": null,
"username": null,
"phone": "+111222333444",
"email": null,
"notes": null,
"tags": ”tag1,tag2”,
"is_active": true,
"is_blocked": false,
"last_active_at": "2024-08-19T09:20:38.000000Z",
"created_at": "2023-06-23T09:51:07.000000Z"
}
Create Offer Link
Description
Create offer links for subscribers to get the offer without payment.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/links/offer
Method: POST
Authentication: Bearer token in headers
Parameters: in form data:
offer_id - required
usage_limit
expire_date
create_order
Example request
curl -X POST "https://app.zenedu.io/api/v1/bot/1/links/offer" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN" –form “offer_id=1”
Example response
{
"status": "success",
"data": {
"link": "https://t.me/bot_username?start=LINK",
"landing_link": "https://app.zenedu.io/l/LINK"
}
}
Create Funnel Link
Description
Create funnel links for subscribers.
URL:
https://app.zenedu.io/api/v1/bot/{botId}/links/funnel
Method: POST
Authentication: Bearer token in headers
Parameters: in form data:
funnel_id - required
name - required
expire_date
request_email
request_phone
tags
Example request
curl -X POST "https://app.zenedu.io/api/v1/bot/1/links/funnel" -H "Accept: application/json" -H "Authorization: Bearer YOUR_API_TOKEN" –form “funnel_id=1”
Example response
{
"status": "success",
"data": {
"link": "https://t.me/bot_username?start=LINK",
"landing_link": "https://app.zenedu.io/l/LINK"
}
}