Create an automation
curl --request POST \
--url https://charts.basedash.com/api/public/organizations/{orgId}/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"icon": "stopwatch",
"color": "1",
"active": true,
"triggerType": "SCHEDULE",
"frequency": "DAILY",
"preferredHour": 9,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"triggerDatabaseConnectionId": null,
"triggerSqlQuery": "",
"slackChannel": null,
"emailRecipients": ""
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/automations"
payload = {
"name": "<string>",
"instructions": "<string>",
"icon": "stopwatch",
"color": "1",
"active": True,
"triggerType": "SCHEDULE",
"frequency": "DAILY",
"preferredHour": 9,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"triggerDatabaseConnectionId": None,
"triggerSqlQuery": "",
"slackChannel": None,
"emailRecipients": ""
}
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>',
instructions: '<string>',
icon: 'stopwatch',
color: '1',
active: true,
triggerType: 'SCHEDULE',
frequency: 'DAILY',
preferredHour: 9,
preferredDayOfWeek: 3,
preferredDayOfMonth: 16,
triggerDatabaseConnectionId: null,
triggerSqlQuery: '',
slackChannel: null,
emailRecipients: ''
})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/automations', 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://charts.basedash.com/api/public/organizations/{orgId}/automations",
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>',
'instructions' => '<string>',
'icon' => 'stopwatch',
'color' => '1',
'active' => true,
'triggerType' => 'SCHEDULE',
'frequency' => 'DAILY',
'preferredHour' => 9,
'preferredDayOfWeek' => 3,
'preferredDayOfMonth' => 16,
'triggerDatabaseConnectionId' => null,
'triggerSqlQuery' => '',
'slackChannel' => null,
'emailRecipients' => ''
]),
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://charts.basedash.com/api/public/organizations/{orgId}/automations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\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://charts.basedash.com/api/public/organizations/{orgId}/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/automations")
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 \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"icon": "<string>",
"color": "<string>",
"instructions": "<string>",
"active": true,
"archivedAt": "2023-11-07T05:31:56Z",
"trigger": {
"preferredHour": 11,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"databaseConnectionId": "<string>",
"sqlQuery": "<string>"
},
"notifications": {
"slackChannel": "<string>",
"emailRecipients": "<string>"
},
"createdByMemberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Automations
Create an automation
Creates an automation for an organization. Requires admin access to the organization.
POST
/
api
/
public
/
organizations
/
{orgId}
/
automations
Create an automation
curl --request POST \
--url https://charts.basedash.com/api/public/organizations/{orgId}/automations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"instructions": "<string>",
"icon": "stopwatch",
"color": "1",
"active": true,
"triggerType": "SCHEDULE",
"frequency": "DAILY",
"preferredHour": 9,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"triggerDatabaseConnectionId": null,
"triggerSqlQuery": "",
"slackChannel": null,
"emailRecipients": ""
}
'import requests
url = "https://charts.basedash.com/api/public/organizations/{orgId}/automations"
payload = {
"name": "<string>",
"instructions": "<string>",
"icon": "stopwatch",
"color": "1",
"active": True,
"triggerType": "SCHEDULE",
"frequency": "DAILY",
"preferredHour": 9,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"triggerDatabaseConnectionId": None,
"triggerSqlQuery": "",
"slackChannel": None,
"emailRecipients": ""
}
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>',
instructions: '<string>',
icon: 'stopwatch',
color: '1',
active: true,
triggerType: 'SCHEDULE',
frequency: 'DAILY',
preferredHour: 9,
preferredDayOfWeek: 3,
preferredDayOfMonth: 16,
triggerDatabaseConnectionId: null,
triggerSqlQuery: '',
slackChannel: null,
emailRecipients: ''
})
};
fetch('https://charts.basedash.com/api/public/organizations/{orgId}/automations', 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://charts.basedash.com/api/public/organizations/{orgId}/automations",
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>',
'instructions' => '<string>',
'icon' => 'stopwatch',
'color' => '1',
'active' => true,
'triggerType' => 'SCHEDULE',
'frequency' => 'DAILY',
'preferredHour' => 9,
'preferredDayOfWeek' => 3,
'preferredDayOfMonth' => 16,
'triggerDatabaseConnectionId' => null,
'triggerSqlQuery' => '',
'slackChannel' => null,
'emailRecipients' => ''
]),
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://charts.basedash.com/api/public/organizations/{orgId}/automations"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\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://charts.basedash.com/api/public/organizations/{orgId}/automations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://charts.basedash.com/api/public/organizations/{orgId}/automations")
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 \"instructions\": \"<string>\",\n \"icon\": \"stopwatch\",\n \"color\": \"1\",\n \"active\": true,\n \"triggerType\": \"SCHEDULE\",\n \"frequency\": \"DAILY\",\n \"preferredHour\": 9,\n \"preferredDayOfWeek\": 3,\n \"preferredDayOfMonth\": 16,\n \"triggerDatabaseConnectionId\": null,\n \"triggerSqlQuery\": \"\",\n \"slackChannel\": null,\n \"emailRecipients\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"icon": "<string>",
"color": "<string>",
"instructions": "<string>",
"active": true,
"archivedAt": "2023-11-07T05:31:56Z",
"trigger": {
"preferredHour": 11,
"preferredDayOfWeek": 3,
"preferredDayOfMonth": 16,
"databaseConnectionId": "<string>",
"sqlQuery": "<string>"
},
"notifications": {
"slackChannel": "<string>",
"emailRecipients": "<string>"
},
"createdByMemberId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}{
"error": {
"title": "RateLimitExceeded",
"detail": "<string>",
"retryAfterMs": 123
}
}{
"error": {
"title": "<string>",
"detail": "<string>"
}
}Authorizations
API key authentication using Bearer token format: Bearer <basedash_api_key>
Path Parameters
Organization ID
Body
application/json
Automation name
Minimum string length:
1Automation instructions
Icon name
Icon color
Automation trigger type
Available options:
MANUAL, SCHEDULE, DATA_CHANGE Schedule frequency
Available options:
DAILY, WEEKDAYS, WEEKLY, MONTHLY, QUARTERLY Preferred UTC hour
Required range:
0 <= x <= 23Required range:
0 <= x <= 6Required range:
1 <= x <= 31Response
Automation created successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I