Create cron job
curl --request POST \
--url https://app.azalt.co/api/v1/cron-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"description": "<string>",
"metadata": null
}
'import requests
url = "https://app.azalt.co/api/v1/cron-jobs"
payload = {
"name": "<string>",
"code": "<string>",
"description": "<string>",
"metadata": None
}
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>', code: '<string>', description: '<string>', metadata: null})
};
fetch('https://app.azalt.co/api/v1/cron-jobs', 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.azalt.co/api/v1/cron-jobs",
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>',
'code' => '<string>',
'description' => '<string>',
'metadata' => null
]),
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.azalt.co/api/v1/cron-jobs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\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.azalt.co/api/v1/cron-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/cron-jobs")
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 \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"schedule": "5m",
"isActive": true,
"organizationId": "<string>",
"createdById": "<string>",
"lastExecutionAt": "<string>",
"nextExecutionAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"metadata": null
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Cron Jobs
Create cron job
Create a new scheduled automation job:
Required Fields:
name: Unique job name within organizationcode: JavaScript code to executeschedule: Execution schedule (5m, 10m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w)
Optional Fields:
description: What this job does
Code Environment: Your JavaScript code has access to these APIs:
fetch: HTTP client for external APIsemail: Send notificationsldap: Authenticate and search LDAP directories from the host runtimeenv: Environment variablessecrets: Encrypted secret values
Access Requirements:
- Owner permissions required
- Job created in your organization
Security:
- Code runs in secure sandbox with 5-minute timeout
- No file system access, limited to provided APIs
- Return values stored but not exposed in this response
POST
/
cron-jobs
Create cron job
curl --request POST \
--url https://app.azalt.co/api/v1/cron-jobs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"description": "<string>",
"metadata": null
}
'import requests
url = "https://app.azalt.co/api/v1/cron-jobs"
payload = {
"name": "<string>",
"code": "<string>",
"description": "<string>",
"metadata": None
}
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>', code: '<string>', description: '<string>', metadata: null})
};
fetch('https://app.azalt.co/api/v1/cron-jobs', 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.azalt.co/api/v1/cron-jobs",
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>',
'code' => '<string>',
'description' => '<string>',
'metadata' => null
]),
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.azalt.co/api/v1/cron-jobs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\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.azalt.co/api/v1/cron-jobs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.azalt.co/api/v1/cron-jobs")
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 \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"metadata\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"schedule": "5m",
"isActive": true,
"organizationId": "<string>",
"createdById": "<string>",
"lastExecutionAt": "<string>",
"nextExecutionAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"metadata": null
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Successful response
Available options:
5m, 10m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w 
