Create a draft sequence
curl --request POST \
--url https://app.leonar.app/api/v1/sequences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"status": "draft",
"priority": "normal",
"mode": "simple",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"schedule_config": {},
"steps": [
{
"client_key": "<string>",
"type": "email",
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"content_template": {},
"delay_days": 0,
"delay_hours": 0,
"execution_mode": "automatic",
"sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"parent_step_id": "<string>",
"branch_condition": {
"type": "<string>",
"after_days": 182
},
"entry_conditions": {}
}
]
}
'import requests
url = "https://app.leonar.app/api/v1/sequences"
payload = {
"name": "<string>",
"status": "draft",
"priority": "normal",
"mode": "simple",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"schedule_config": {},
"steps": [
{
"client_key": "<string>",
"type": "email",
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"content_template": {},
"delay_days": 0,
"delay_hours": 0,
"execution_mode": "automatic",
"sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"parent_step_id": "<string>",
"branch_condition": {
"type": "<string>",
"after_days": 182
},
"entry_conditions": {}
}
]
}
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>',
status: 'draft',
priority: 'normal',
mode: 'simple',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
schedule_config: {},
steps: [
{
client_key: '<string>',
type: 'email',
name: '<string>',
subject: '<string>',
body: JSON.stringify('<string>'),
content_template: {},
delay_days: 0,
delay_hours: 0,
execution_mode: 'automatic',
sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
parent_step_id: '<string>',
branch_condition: {type: '<string>', after_days: 182},
entry_conditions: {}
}
]
})
};
fetch('https://app.leonar.app/api/v1/sequences', 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.leonar.app/api/v1/sequences",
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>',
'status' => 'draft',
'priority' => 'normal',
'mode' => 'simple',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'schedule_config' => [
],
'steps' => [
[
'client_key' => '<string>',
'type' => 'email',
'name' => '<string>',
'subject' => '<string>',
'body' => '<string>',
'content_template' => [
],
'delay_days' => 0,
'delay_hours' => 0,
'execution_mode' => 'automatic',
'sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'parent_step_id' => '<string>',
'branch_condition' => [
'type' => '<string>',
'after_days' => 182
],
'entry_conditions' => [
]
]
]
]),
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.leonar.app/api/v1/sequences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\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.leonar.app/api/v1/sequences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/sequences")
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 \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}Sequences
Create a draft sequence
Creates a draft sequence, optionally with branched steps and a project link.
POST
/
sequences
Create a draft sequence
curl --request POST \
--url https://app.leonar.app/api/v1/sequences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"status": "draft",
"priority": "normal",
"mode": "simple",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"schedule_config": {},
"steps": [
{
"client_key": "<string>",
"type": "email",
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"content_template": {},
"delay_days": 0,
"delay_hours": 0,
"execution_mode": "automatic",
"sender_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"parent_step_id": "<string>",
"branch_condition": {
"type": "<string>",
"after_days": 182
},
"entry_conditions": {}
}
]
}
'import requests
url = "https://app.leonar.app/api/v1/sequences"
payload = {
"name": "<string>",
"status": "draft",
"priority": "normal",
"mode": "simple",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"owner_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"schedule_config": {},
"steps": [
{
"client_key": "<string>",
"type": "email",
"name": "<string>",
"subject": "<string>",
"body": "<string>",
"content_template": {},
"delay_days": 0,
"delay_hours": 0,
"execution_mode": "automatic",
"sender_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"parent_step_id": "<string>",
"branch_condition": {
"type": "<string>",
"after_days": 182
},
"entry_conditions": {}
}
]
}
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>',
status: 'draft',
priority: 'normal',
mode: 'simple',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
owner_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
schedule_config: {},
steps: [
{
client_key: '<string>',
type: 'email',
name: '<string>',
subject: '<string>',
body: JSON.stringify('<string>'),
content_template: {},
delay_days: 0,
delay_hours: 0,
execution_mode: 'automatic',
sender_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
parent_step_id: '<string>',
branch_condition: {type: '<string>', after_days: 182},
entry_conditions: {}
}
]
})
};
fetch('https://app.leonar.app/api/v1/sequences', 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.leonar.app/api/v1/sequences",
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>',
'status' => 'draft',
'priority' => 'normal',
'mode' => 'simple',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'owner_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'schedule_config' => [
],
'steps' => [
[
'client_key' => '<string>',
'type' => 'email',
'name' => '<string>',
'subject' => '<string>',
'body' => '<string>',
'content_template' => [
],
'delay_days' => 0,
'delay_hours' => 0,
'execution_mode' => 'automatic',
'sender_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'parent_step_id' => '<string>',
'branch_condition' => [
'type' => '<string>',
'after_days' => 182
],
'entry_conditions' => [
]
]
]
]),
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.leonar.app/api/v1/sequences"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\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.leonar.app/api/v1/sequences")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.leonar.app/api/v1/sequences")
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 \"status\": \"draft\",\n \"priority\": \"normal\",\n \"mode\": \"simple\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"owner_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"schedule_config\": {},\n \"steps\": [\n {\n \"client_key\": \"<string>\",\n \"type\": \"email\",\n \"name\": \"<string>\",\n \"subject\": \"<string>\",\n \"body\": \"<string>\",\n \"content_template\": {},\n \"delay_days\": 0,\n \"delay_hours\": 0,\n \"execution_mode\": \"automatic\",\n \"sender_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"parent_step_id\": \"<string>\",\n \"branch_condition\": {\n \"type\": \"<string>\",\n \"after_days\": 182\n },\n \"entry_conditions\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": {
"code": "validation_error",
"message": "Invalid input"
}
}Authorizations
API key starting with leo_
Body
application/json
Maximum string length:
200Available options:
draft Available options:
normal, high Available options:
simple, advanced Required array length:
1 - 50 elementsMaximum array length:
50Show child attributes
Show child attributes
Response
Sequence created
⌘I