curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"text": "<string>",
"active": true,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"settings": {
"attach_file": true,
"has_spoiler": true,
"autodelete": 86400,
"protect_content": true,
"save_profile": true,
"question_error_message": "<string>",
"quiz_explanation": "<string>",
"resume_checked": true
},
"options": [
{
"text": "<string>",
"id": 123,
"is_correct": true
}
],
"telegram_file_ids": [
123
]
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps"
payload = {
"name": "<string>",
"text": "<string>",
"active": True,
"link_preview": True,
"task_autocheck": True,
"custom_field_id": 123,
"settings": {
"attach_file": True,
"has_spoiler": True,
"autodelete": 86400,
"protect_content": True,
"save_profile": True,
"question_error_message": "<string>",
"quiz_explanation": "<string>",
"resume_checked": True
},
"options": [
{
"text": "<string>",
"id": 123,
"is_correct": True
}
],
"telegram_file_ids": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
text: '<string>',
active: true,
link_preview: true,
task_autocheck: true,
custom_field_id: 123,
settings: {
attach_file: true,
has_spoiler: true,
autodelete: 86400,
protect_content: true,
save_profile: true,
question_error_message: '<string>',
quiz_explanation: '<string>',
resume_checked: true
},
options: [{text: '<string>', id: 123, is_correct: true}],
telegram_file_ids: [123]
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'text' => '<string>',
'active' => true,
'link_preview' => true,
'task_autocheck' => true,
'custom_field_id' => 123,
'settings' => [
'attach_file' => true,
'has_spoiler' => true,
'autodelete' => 86400,
'protect_content' => true,
'save_profile' => true,
'question_error_message' => '<string>',
'quiz_explanation' => '<string>',
'resume_checked' => true
],
'options' => [
[
'text' => '<string>',
'id' => 123,
'is_correct' => true
]
],
'telegram_file_ids' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"product_id": 123,
"section_id": 123,
"type": "message",
"name": "<string>",
"text": "<string>",
"active": true,
"sort": 123,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"sending_time": {
"option": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"skip_past_date": true,
"delay_time": "2023-11-07T05:31:56Z",
"delay_limit": {
"time_from": 719,
"time_to": 719,
"weekdays": [
"mon"
]
}
},
"menu_time": {
"type": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"delay_time": "2023-11-07T05:31:56Z"
},
"settings": {
"attach_file": true,
"has_spoiler": true,
"attach_style": "<string>",
"autodelete": 123,
"protect_content": true,
"save_profile": true,
"subtype": "<string>",
"question_error_message": "<string>",
"quiz_explanation": "<string>"
},
"cover_url": "<string>",
"attachments": [
{
"id": 123,
"type": "<string>",
"name": "<string>"
}
],
"buttons": [
{
"id": 123,
"type": "link",
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{}
],
"settings": {},
"sort": 123
}
],
"options": [
{
"id": 123,
"text": "<string>",
"is_correct": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Create product step
Creates a step in the product. Attachments cannot be set via the API.
curl --request POST \
--url https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"text": "<string>",
"active": true,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"settings": {
"attach_file": true,
"has_spoiler": true,
"autodelete": 86400,
"protect_content": true,
"save_profile": true,
"question_error_message": "<string>",
"quiz_explanation": "<string>",
"resume_checked": true
},
"options": [
{
"text": "<string>",
"id": 123,
"is_correct": true
}
],
"telegram_file_ids": [
123
]
}
'import requests
url = "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps"
payload = {
"name": "<string>",
"text": "<string>",
"active": True,
"link_preview": True,
"task_autocheck": True,
"custom_field_id": 123,
"settings": {
"attach_file": True,
"has_spoiler": True,
"autodelete": 86400,
"protect_content": True,
"save_profile": True,
"question_error_message": "<string>",
"quiz_explanation": "<string>",
"resume_checked": True
},
"options": [
{
"text": "<string>",
"id": 123,
"is_correct": True
}
],
"telegram_file_ids": [123]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
text: '<string>',
active: true,
link_preview: true,
task_autocheck: true,
custom_field_id: 123,
settings: {
attach_file: true,
has_spoiler: true,
autodelete: 86400,
protect_content: true,
save_profile: true,
question_error_message: '<string>',
quiz_explanation: '<string>',
resume_checked: true
},
options: [{text: '<string>', id: 123, is_correct: true}],
telegram_file_ids: [123]
})
};
fetch('https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'text' => '<string>',
'active' => true,
'link_preview' => true,
'task_autocheck' => true,
'custom_field_id' => 123,
'settings' => [
'attach_file' => true,
'has_spoiler' => true,
'autodelete' => 86400,
'protect_content' => true,
'save_profile' => true,
'question_error_message' => '<string>',
'quiz_explanation' => '<string>',
'resume_checked' => true
],
'options' => [
[
'text' => '<string>',
'id' => 123,
'is_correct' => true
]
],
'telegram_file_ids' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.zenedu.io/api/v1/bot/{bot}/products/{product}/steps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"text\": \"<string>\",\n \"active\": true,\n \"link_preview\": true,\n \"task_autocheck\": true,\n \"custom_field_id\": 123,\n \"settings\": {\n \"attach_file\": true,\n \"has_spoiler\": true,\n \"autodelete\": 86400,\n \"protect_content\": true,\n \"save_profile\": true,\n \"question_error_message\": \"<string>\",\n \"quiz_explanation\": \"<string>\",\n \"resume_checked\": true\n },\n \"options\": [\n {\n \"text\": \"<string>\",\n \"id\": 123,\n \"is_correct\": true\n }\n ],\n \"telegram_file_ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"product_id": 123,
"section_id": 123,
"type": "message",
"name": "<string>",
"text": "<string>",
"active": true,
"sort": 123,
"link_preview": true,
"task_autocheck": true,
"custom_field_id": 123,
"sending_time": {
"option": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"skip_past_date": true,
"delay_time": "2023-11-07T05:31:56Z",
"delay_limit": {
"time_from": 719,
"time_to": 719,
"weekdays": [
"mon"
]
}
},
"menu_time": {
"type": "immediately",
"delay_number": 123,
"delay_type": "seconds",
"delay_at": "2023-11-07T05:31:56Z",
"delay_time": "2023-11-07T05:31:56Z"
},
"settings": {
"attach_file": true,
"has_spoiler": true,
"attach_style": "<string>",
"autodelete": 123,
"protect_content": true,
"save_profile": true,
"subtype": "<string>",
"question_error_message": "<string>",
"quiz_explanation": "<string>"
},
"cover_url": "<string>",
"attachments": [
{
"id": 123,
"type": "<string>",
"name": "<string>"
}
],
"buttons": [
{
"id": 123,
"type": "link",
"name": "<string>",
"link": "<string>",
"offer_id": 123,
"actions": [
{}
],
"settings": {},
"sort": 123
}
],
"options": [
{
"id": 123,
"text": "<string>",
"is_correct": true
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"errors": {}
}Authorizations
API token from the Zenedu dashboard
Body
Step type. A task step automatically gets a task submission button (type: task), named in the bot's language — you don't add it yourself.
message, lesson, task, question, poll, quiz 255Task steps only: accept a submitted task automatically and advance the student immediately, instead of waiting for manual review.
Show child attributes
Show child attributes
When the step becomes available in the bot menu
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Poll or quiz options
2 - 12 elementsShow child attributes
Show child attributes
IDs of files registered via POST /api/v1/bot/{bot}/telegram-files to attach to this step (photos, videos, documents, etc.). The given set replaces the current attachments entirely. Only files you uploaded that are not yet attached to anything are accepted — an already-attached, non-existent, or another user's id returns 422 (telegram_file_ids: Not found). Omit the field or send an empty array to leave attachments unchanged; null is rejected with 422. To remove an attachment, use DELETE …/steps/{step}/attachments/{file}.
Response
Step created
Show child attributes
Show child attributes