Create an AI report schedule
curl --request POST \
--url https://app.flextell.ai/api/v1/ai-report-schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"systems": [],
"follows_work_hours": true,
"is_active": true,
"period_start_date": "2023-11-07T05:31:56Z",
"period_end_date": "2023-11-07T05:31:56Z",
"time": "<string>",
"timezone": "<string>",
"starts_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://app.flextell.ai/api/v1/ai-report-schedules"
payload = {
"name": "<string>",
"systems": [],
"follows_work_hours": True,
"is_active": True,
"period_start_date": "2023-11-07T05:31:56Z",
"period_end_date": "2023-11-07T05:31:56Z",
"time": "<string>",
"timezone": "<string>",
"starts_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
systems: [],
follows_work_hours: true,
is_active: true,
period_start_date: '2023-11-07T05:31:56Z',
period_end_date: '2023-11-07T05:31:56Z',
time: '<string>',
timezone: '<string>',
starts_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://app.flextell.ai/api/v1/ai-report-schedules', 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.flextell.ai/api/v1/ai-report-schedules",
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>',
'systems' => [
],
'follows_work_hours' => true,
'is_active' => true,
'period_start_date' => '2023-11-07T05:31:56Z',
'period_end_date' => '2023-11-07T05:31:56Z',
'time' => '<string>',
'timezone' => '<string>',
'starts_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/ai-report-schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.flextell.ai/api/v1/ai-report-schedules")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/ai-report-schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"systems": [
"<unknown>"
],
"period_label": "<string>",
"period_start_date": "<string>",
"period_end_date": "<string>",
"frequency": "<string>",
"time": "<string>",
"timezone": "<string>",
"follows_work_hours": true,
"starts_at": "<string>",
"is_active": true,
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}AIReportSchedule
Create an AI report schedule
POST
/
v1
/
ai-report-schedules
Create an AI report schedule
curl --request POST \
--url https://app.flextell.ai/api/v1/ai-report-schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"systems": [],
"follows_work_hours": true,
"is_active": true,
"period_start_date": "2023-11-07T05:31:56Z",
"period_end_date": "2023-11-07T05:31:56Z",
"time": "<string>",
"timezone": "<string>",
"starts_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://app.flextell.ai/api/v1/ai-report-schedules"
payload = {
"name": "<string>",
"systems": [],
"follows_work_hours": True,
"is_active": True,
"period_start_date": "2023-11-07T05:31:56Z",
"period_end_date": "2023-11-07T05:31:56Z",
"time": "<string>",
"timezone": "<string>",
"starts_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
systems: [],
follows_work_hours: true,
is_active: true,
period_start_date: '2023-11-07T05:31:56Z',
period_end_date: '2023-11-07T05:31:56Z',
time: '<string>',
timezone: '<string>',
starts_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://app.flextell.ai/api/v1/ai-report-schedules', 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.flextell.ai/api/v1/ai-report-schedules",
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>',
'systems' => [
],
'follows_work_hours' => true,
'is_active' => true,
'period_start_date' => '2023-11-07T05:31:56Z',
'period_end_date' => '2023-11-07T05:31:56Z',
'time' => '<string>',
'timezone' => '<string>',
'starts_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/ai-report-schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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.flextell.ai/api/v1/ai-report-schedules")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/ai-report-schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"systems\": [],\n \"follows_work_hours\": true,\n \"is_active\": true,\n \"period_start_date\": \"2023-11-07T05:31:56Z\",\n \"period_end_date\": \"2023-11-07T05:31:56Z\",\n \"time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"systems": [
"<unknown>"
],
"period_label": "<string>",
"period_start_date": "<string>",
"period_end_date": "<string>",
"frequency": "<string>",
"time": "<string>",
"timezone": "<string>",
"follows_work_hours": true,
"starts_at": "<string>",
"is_active": true,
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"last_status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"user": {
"id": 123,
"name": "<string>",
"avatar_url": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
oauth2bearer
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Gövde
application/json
The name of the AI report schedule.
Maximum string length:
120The modules included in scheduled reports.
Minimum array length:
1The report module.
Mevcut seçenekler:
appointment, treatment, room, customer, demographics, customer_form, revenue, collections, sale_items, installments, payment_methods, lead, pipeline, offer, lead_source, chat, channel, blacklist, ai_suggestion, ticket, low_stock, stock_movement, staff, doctor_workload, storage, credits, all The report period.
Mevcut seçenekler:
today, yesterday, last_7_days, last_30_days, this_week, this_month, last_month, this_year, custom_date_range The schedule frequency.
Mevcut seçenekler:
daily, weekly, monthly Whether the schedule follows clinic closing time.
Whether the AI report schedule is active.
The custom period start date.
The custom period end date.
The fixed run time in a half-hour slot.
Pattern:
^(?:[01]\d|2[0-3]):(?:00|30)$The IANA timezone used by the schedule.
The calendar date when recurrence starts.