Put someone into an automation
Subscribes the address to the automation’s list without asking for confirmation, then puts it on the journey and runs the first actions at once. Works whatever the automation’s trigger is, as long as it is running.
POST
/
v1
/
automations
/
{automation}
/
trigger
Put someone into an automation
curl --request POST \
--url https://api.lekalao.com/v1/automations/{automation}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "ada@example.com",
"first_name": "Ada"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'ada@example.com', first_name: 'Ada'})
};
fetch('https://api.lekalao.com/v1/automations/{automation}/trigger', 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://api.lekalao.com/v1/automations/{automation}/trigger",
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([
'email' => 'ada@example.com',
'first_name' => 'Ada'
]),
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;
}import requests
url = "https://api.lekalao.com/v1/automations/{automation}/trigger"
payload = {
"email": "ada@example.com",
"first_name": "Ada"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "The automation has started.",
"started": true
}{
"message": "The idempotency key is too long.",
"code": "idempotency_key_too_long",
"doc_url": "https://docs.lekalao.com/errors#idempotency_key_too_long"
}{
"message": "Unauthenticated.",
"code": "unauthenticated",
"doc_url": "https://docs.lekalao.com/errors#unauthenticated"
}{
"message": "A test key cannot send this: it would reach real people. Use a live key.",
"code": "sandbox_cannot_send",
"doc_url": "https://docs.lekalao.com/errors#sandbox_cannot_send"
}{
"message": "Not found.",
"code": "not_found",
"doc_url": "https://docs.lekalao.com/errors#not_found"
}{
"message": "<string>",
"code": "address_suppressed",
"doc_url": "<string>"
}{
"message": "The email field must be a valid email address.",
"code": "validation_error",
"doc_url": "<string>",
"errors": {},
"problem": "disposable",
"suggestion": "jsmith@example.com"
}{
"message": "Too many requests. Try again in 12 seconds.",
"code": "rate_limited",
"doc_url": "https://docs.lekalao.com/errors#rate_limited"
}Authorizations
An API token. The "read" ability: GET routes only. "read + write": every route.
Headers
Replay a write safely: the same key gives back the first answer for 24 hours (header Idempotent-Replay: true). Read on POST, PUT and PATCH; DELETE ignores it. 255 characters at most.
Maximum string length:
255Path Parameters
The automation's identifier (uuid).
⌘I
Put someone into an automation
curl --request POST \
--url https://api.lekalao.com/v1/automations/{automation}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "ada@example.com",
"first_name": "Ada"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: 'ada@example.com', first_name: 'Ada'})
};
fetch('https://api.lekalao.com/v1/automations/{automation}/trigger', 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://api.lekalao.com/v1/automations/{automation}/trigger",
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([
'email' => 'ada@example.com',
'first_name' => 'Ada'
]),
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;
}import requests
url = "https://api.lekalao.com/v1/automations/{automation}/trigger"
payload = {
"email": "ada@example.com",
"first_name": "Ada"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"message": "The automation has started.",
"started": true
}{
"message": "The idempotency key is too long.",
"code": "idempotency_key_too_long",
"doc_url": "https://docs.lekalao.com/errors#idempotency_key_too_long"
}{
"message": "Unauthenticated.",
"code": "unauthenticated",
"doc_url": "https://docs.lekalao.com/errors#unauthenticated"
}{
"message": "A test key cannot send this: it would reach real people. Use a live key.",
"code": "sandbox_cannot_send",
"doc_url": "https://docs.lekalao.com/errors#sandbox_cannot_send"
}{
"message": "Not found.",
"code": "not_found",
"doc_url": "https://docs.lekalao.com/errors#not_found"
}{
"message": "<string>",
"code": "address_suppressed",
"doc_url": "<string>"
}{
"message": "The email field must be a valid email address.",
"code": "validation_error",
"doc_url": "<string>",
"errors": {},
"problem": "disposable",
"suggestion": "jsmith@example.com"
}{
"message": "Too many requests. Try again in 12 seconds.",
"code": "rate_limited",
"doc_url": "https://docs.lekalao.com/errors#rate_limited"
}