Schedules
Schedule recurring exports of a saved definition
POST
/
report-definitions
/
{definitionId}
/
schedules
Schedule recurring exports of a saved definition
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"cron": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
]
},
"timezone": "Europe/London",
"format": "CSV"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules"
payload = {
"cron": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"]
},
"timezone": "Europe/London",
"format": "CSV"
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cron: '<string>',
delivery: {
webhookUrl: '<string>',
emails: ['<string>'],
cc: ['<string>'],
bcc: ['<string>']
},
timezone: 'Europe/London',
format: 'CSV'
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/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([
'cron' => '<string>',
'delivery' => [
'webhookUrl' => '<string>',
'emails' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
]
],
'timezone' => 'Europe/London',
'format' => 'CSV'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}"
response = http.request(request)
puts response.read_body{
"scheduleId": "<string>",
"definitionId": "<string>",
"cron": "<string>",
"timezone": "<string>",
"format": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
]
},
"enabled": true,
"nextDueAt": "2023-11-07T05:31:56Z",
"webhookSecret": "<string>"
}{
"error": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
FlowPayroll JWT (raw token, no Bearer prefix)
Organisation to scope the request to. Required when the principal can access more than one organisation; optional for single-organisation principals (the authorizer resolves it automatically).
Path Parameters
Report definition id (ULID)
Body
application/json
Response
Created — webhookSecret is returned exactly once, here
Show child attributes
Show child attributes
Returned exactly once, on creation — used to verify X-Flow-Signature
Was this page helpful?
⌘I
Schedule recurring exports of a saved definition
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--header 'X-Org-Id: <api-key>' \
--data '
{
"cron": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
]
},
"timezone": "Europe/London",
"format": "CSV"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules"
payload = {
"cron": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": ["<string>"],
"cc": ["<string>"],
"bcc": ["<string>"]
},
"timezone": "Europe/London",
"format": "CSV"
}
headers = {
"X-Auth-Token": "<api-key>",
"X-Org-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-Token': '<api-key>',
'X-Org-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cron: '<string>',
delivery: {
webhookUrl: '<string>',
emails: ['<string>'],
cc: ['<string>'],
bcc: ['<string>']
},
timezone: 'Europe/London',
format: 'CSV'
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/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([
'cron' => '<string>',
'delivery' => [
'webhookUrl' => '<string>',
'emails' => [
'<string>'
],
'cc' => [
'<string>'
],
'bcc' => [
'<string>'
]
],
'timezone' => 'Europe/London',
'format' => 'CSV'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>",
"X-Org-Id: <api-key>"
],
]);
$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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("X-Org-Id", "<api-key>")
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://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules")
.header("X-Auth-Token", "<api-key>")
.header("X-Org-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/report/report-definitions/{definitionId}/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["X-Org-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cron\": \"<string>\",\n \"delivery\": {\n \"webhookUrl\": \"<string>\",\n \"emails\": [\n \"<string>\"\n ],\n \"cc\": [\n \"<string>\"\n ],\n \"bcc\": [\n \"<string>\"\n ]\n },\n \"timezone\": \"Europe/London\",\n \"format\": \"CSV\"\n}"
response = http.request(request)
puts response.read_body{
"scheduleId": "<string>",
"definitionId": "<string>",
"cron": "<string>",
"timezone": "<string>",
"format": "<string>",
"delivery": {
"webhookUrl": "<string>",
"emails": [
"<string>"
],
"cc": [
"<string>"
],
"bcc": [
"<string>"
]
},
"enabled": true,
"nextDueAt": "2023-11-07T05:31:56Z",
"webhookSecret": "<string>"
}{
"error": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}