Save a file worksheet definition
Creates or updates a raw saved view/report definition. The endpoint source must match module_id and the saved definition context/scope. Source view management or reports management plus context access is required. client_id is required for compatibility but always replaced by the authenticated organization. Donor/donation view validators discard unavailable columns/filter/footer keys; report definitions strictly validate field capabilities, operators, values and date presets. Existing reports stay reports. Initial report creation also creates an entitled schedule; later edits here preserve its schedule. Column identity/order are normalized for report updates. A schedule rejection can occur after the definition is saved.
curl --request POST \
--url https://api.gratona.com/v1/admin/files/saved_filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": 42,
"hysform_id": 42,
"module_id": 5,
"sponsorships": 42,
"view_id": 42,
"name": "Example",
"type": "view",
"date_range": {
"preset": "last_7_days",
"type": "last_30",
"value": "last_30_days",
"start_date": "2026-01-01",
"end_date": "2026-12-31",
"date_from": "2026-01-01",
"date_to": "2026-12-31"
},
"frequency": "weekly",
"date_time": "2026-12-01T09:00:00+03:00",
"timezone": "Africa/Kampala",
"recipient_emails": [
"finance@example.org"
],
"export_locale": "en",
"fields": [
"email"
],
"filterGroups": [
{
"field": "email",
"field_key": "email",
"fieldKey": "email",
"operator": "contains",
"op": "contains",
"value": "@example.org",
"semantic": "age_years"
}
],
"column_fields": [
"email"
],
"column_order": [
"email"
],
"sort_key": "Example",
"sort_order": "asc",
"footer_calculations": [
{
"operation": "count_empty",
"field_key": "amount",
"fieldKey": "amount"
}
],
"search_query": "Jane",
"searchQuery": "Jane",
"related_config": {
"program_surface": "recipients"
},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-01T09:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-01T06:00:00Z",
"source": "calendar"
},
"duration": 0,
"start_date": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/files/saved_filters"
payload = {
"client_id": 42,
"hysform_id": 42,
"module_id": 5,
"sponsorships": 42,
"view_id": 42,
"name": "Example",
"type": "view",
"date_range": {
"preset": "last_7_days",
"type": "last_30",
"value": "last_30_days",
"start_date": "2026-01-01",
"end_date": "2026-12-31",
"date_from": "2026-01-01",
"date_to": "2026-12-31"
},
"frequency": "weekly",
"date_time": "2026-12-01T09:00:00+03:00",
"timezone": "Africa/Kampala",
"recipient_emails": ["finance@example.org"],
"export_locale": "en",
"fields": ["email"],
"filterGroups": [
{
"field": "email",
"field_key": "email",
"fieldKey": "email",
"operator": "contains",
"op": "contains",
"value": "@example.org",
"semantic": "age_years"
}
],
"column_fields": ["email"],
"column_order": ["email"],
"sort_key": "Example",
"sort_order": "asc",
"footer_calculations": [
{
"operation": "count_empty",
"field_key": "amount",
"fieldKey": "amount"
}
],
"search_query": "Jane",
"searchQuery": "Jane",
"related_config": { "program_surface": "recipients" },
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-01T09:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-01T06:00:00Z",
"source": "calendar"
},
"duration": 0,
"start_date": "2026-10-20T12:00:00Z"
}
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({
client_id: 42,
hysform_id: 42,
module_id: 5,
sponsorships: 42,
view_id: 42,
name: 'Example',
type: 'view',
date_range: {
preset: 'last_7_days',
type: 'last_30',
value: 'last_30_days',
start_date: '2026-01-01',
end_date: '2026-12-31',
date_from: '2026-01-01',
date_to: '2026-12-31'
},
frequency: 'weekly',
date_time: '2026-12-01T09:00:00+03:00',
timezone: 'Africa/Kampala',
recipient_emails: ['finance@example.org'],
export_locale: 'en',
fields: ['email'],
filterGroups: [
{
field: 'email',
field_key: 'email',
fieldKey: 'email',
operator: 'contains',
op: 'contains',
value: '@example.org',
semantic: 'age_years'
}
],
column_fields: ['email'],
column_order: ['email'],
sort_key: 'Example',
sort_order: 'asc',
footer_calculations: [{operation: 'count_empty', field_key: 'amount', fieldKey: 'amount'}],
search_query: 'Jane',
searchQuery: 'Jane',
related_config: {program_surface: 'recipients'},
schedule: {
kind: 'instant',
localDatetime: '2026-12-01T09:00:00',
timezone: 'Africa/Kampala',
offsetMinutes: 180,
utcAt: '2026-12-01T06:00:00Z',
source: 'calendar'
},
duration: 0,
start_date: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/files/saved_filters', 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.gratona.com/v1/admin/files/saved_filters",
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([
'client_id' => 42,
'hysform_id' => 42,
'module_id' => 5,
'sponsorships' => 42,
'view_id' => 42,
'name' => 'Example',
'type' => 'view',
'date_range' => [
'preset' => 'last_7_days',
'type' => 'last_30',
'value' => 'last_30_days',
'start_date' => '2026-01-01',
'end_date' => '2026-12-31',
'date_from' => '2026-01-01',
'date_to' => '2026-12-31'
],
'frequency' => 'weekly',
'date_time' => '2026-12-01T09:00:00+03:00',
'timezone' => 'Africa/Kampala',
'recipient_emails' => [
'finance@example.org'
],
'export_locale' => 'en',
'fields' => [
'email'
],
'filterGroups' => [
[
'field' => 'email',
'field_key' => 'email',
'fieldKey' => 'email',
'operator' => 'contains',
'op' => 'contains',
'value' => '@example.org',
'semantic' => 'age_years'
]
],
'column_fields' => [
'email'
],
'column_order' => [
'email'
],
'sort_key' => 'Example',
'sort_order' => 'asc',
'footer_calculations' => [
[
'operation' => 'count_empty',
'field_key' => 'amount',
'fieldKey' => 'amount'
]
],
'search_query' => 'Jane',
'searchQuery' => 'Jane',
'related_config' => [
'program_surface' => 'recipients'
],
'schedule' => [
'kind' => 'instant',
'localDatetime' => '2026-12-01T09:00:00',
'timezone' => 'Africa/Kampala',
'offsetMinutes' => 180,
'utcAt' => '2026-12-01T06:00:00Z',
'source' => 'calendar'
],
'duration' => 0,
'start_date' => '2026-10-20T12:00:00Z'
]),
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://api.gratona.com/v1/admin/files/saved_filters"
payload := strings.NewReader("{\n \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\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://api.gratona.com/v1/admin/files/saved_filters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/files/saved_filters")
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 \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Filter Preferences Saved",
"data": {
"id": 42,
"client_id": 42,
"owner_user_id": 42,
"hysform_id": 42,
"module_id": 42,
"sponsorships": 42,
"name": "Example",
"fields": "[]",
"column_fields": "[]",
"column_order": "[]",
"date_range": "[]",
"footer_calculations": "[]",
"sort_key": "Example",
"sort_order": "Example",
"search_query": "Example",
"related_config": {},
"snapshot": false,
"type": "Example",
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"status": "error",
"error_code": "ENTITLEMENT_REQUIRED",
"message": "Scheduled reports are not included in your current plan.",
"feature": "reports.scheduled_email",
"feature_name": "Scheduled reports",
"required_tier": "Example",
"required_tier_name": "Example",
"current_tier": "Example",
"current_tier_name": "Example",
"allowance": 42,
"quota": 42,
"upgrade": {
"cta": "book_a_demo"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Body
Required compatibility input; the authenticated organization always overrides this value.
42
Required source donor form/program ID; all normalizes to zero. Existing definitions must retain their original source context.
x >= 042
Required source module for this endpoint.
5 5
Sponsorship scope (default normalized program context) or nonnegative donation tab; null is allowed.
42
Existing source-matching saved view/report to update; omitted creates a new definition.
42
Definition display label; omission resets saved-view name to null on legacy updates.
"Example"
Definition kind; existing reports remain reports.
view, report, null "view"
Show child attributes
Show child attributes
Required when type=report; named frequency or legacy numeric string.
daily, weekly, biweekly, monthly, quarterly, 3_months, semiannual, 6_months, annual, 1_year, once, 0, 1, 2, 3, 4, 5, 6, 7, 14, null "weekly"
Required when type=report; initial scheduled occurrence, preferably ISO8601 with offset.
"2026-12-01T09:00:00+03:00"
Valid IANA timezone, excluding Factory.
64"Africa/Kampala"
Scheduled report recipient email.
Scheduled tax-treatment export locale; default en.
en, es, fr, de, nl, ar, zhCn, null "en"
Stored filter groups or legacy column keys, depending on module/view contract.
Legacy saved-view column key.
"email"
Report alias always replaces fields; donation view maps only when fields absent.
Show child attributes
Show child attributes
Available worksheet field key.
Available worksheet field key.
Available sortable field; unavailable donor/donation/sponsorship sort clears sort state.
"Example"
Direction; sponsorship input is normalized before validation.
asc, desc, null "asc"
Show child attributes
Show child attributes
Stored search string.
1000"Jane"
Donation saved-view compatibility alias.
1000"Jane"
Optional related worksheet configuration.
Show child attributes
Show child attributes
Closed schedule-intent.v1 instant or recurrence. When also providing legacy date_time/timezone they must identify the same first UTC occurrence. Report scheduling rejects explicit weekdays and recommendation/legacy source.
Show child attributes
Show child attributes
Initial schedule legacy duration hint; defaults zero.
0
Initial schedule compatibility date when date_time absent; report validation still requires date_time when type=report.
"2026-10-20T12:00:00Z"
curl --request POST \
--url https://api.gratona.com/v1/admin/files/saved_filters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_id": 42,
"hysform_id": 42,
"module_id": 5,
"sponsorships": 42,
"view_id": 42,
"name": "Example",
"type": "view",
"date_range": {
"preset": "last_7_days",
"type": "last_30",
"value": "last_30_days",
"start_date": "2026-01-01",
"end_date": "2026-12-31",
"date_from": "2026-01-01",
"date_to": "2026-12-31"
},
"frequency": "weekly",
"date_time": "2026-12-01T09:00:00+03:00",
"timezone": "Africa/Kampala",
"recipient_emails": [
"finance@example.org"
],
"export_locale": "en",
"fields": [
"email"
],
"filterGroups": [
{
"field": "email",
"field_key": "email",
"fieldKey": "email",
"operator": "contains",
"op": "contains",
"value": "@example.org",
"semantic": "age_years"
}
],
"column_fields": [
"email"
],
"column_order": [
"email"
],
"sort_key": "Example",
"sort_order": "asc",
"footer_calculations": [
{
"operation": "count_empty",
"field_key": "amount",
"fieldKey": "amount"
}
],
"search_query": "Jane",
"searchQuery": "Jane",
"related_config": {
"program_surface": "recipients"
},
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-01T09:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-01T06:00:00Z",
"source": "calendar"
},
"duration": 0,
"start_date": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/files/saved_filters"
payload = {
"client_id": 42,
"hysform_id": 42,
"module_id": 5,
"sponsorships": 42,
"view_id": 42,
"name": "Example",
"type": "view",
"date_range": {
"preset": "last_7_days",
"type": "last_30",
"value": "last_30_days",
"start_date": "2026-01-01",
"end_date": "2026-12-31",
"date_from": "2026-01-01",
"date_to": "2026-12-31"
},
"frequency": "weekly",
"date_time": "2026-12-01T09:00:00+03:00",
"timezone": "Africa/Kampala",
"recipient_emails": ["finance@example.org"],
"export_locale": "en",
"fields": ["email"],
"filterGroups": [
{
"field": "email",
"field_key": "email",
"fieldKey": "email",
"operator": "contains",
"op": "contains",
"value": "@example.org",
"semantic": "age_years"
}
],
"column_fields": ["email"],
"column_order": ["email"],
"sort_key": "Example",
"sort_order": "asc",
"footer_calculations": [
{
"operation": "count_empty",
"field_key": "amount",
"fieldKey": "amount"
}
],
"search_query": "Jane",
"searchQuery": "Jane",
"related_config": { "program_surface": "recipients" },
"schedule": {
"kind": "instant",
"localDatetime": "2026-12-01T09:00:00",
"timezone": "Africa/Kampala",
"offsetMinutes": 180,
"utcAt": "2026-12-01T06:00:00Z",
"source": "calendar"
},
"duration": 0,
"start_date": "2026-10-20T12:00:00Z"
}
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({
client_id: 42,
hysform_id: 42,
module_id: 5,
sponsorships: 42,
view_id: 42,
name: 'Example',
type: 'view',
date_range: {
preset: 'last_7_days',
type: 'last_30',
value: 'last_30_days',
start_date: '2026-01-01',
end_date: '2026-12-31',
date_from: '2026-01-01',
date_to: '2026-12-31'
},
frequency: 'weekly',
date_time: '2026-12-01T09:00:00+03:00',
timezone: 'Africa/Kampala',
recipient_emails: ['finance@example.org'],
export_locale: 'en',
fields: ['email'],
filterGroups: [
{
field: 'email',
field_key: 'email',
fieldKey: 'email',
operator: 'contains',
op: 'contains',
value: '@example.org',
semantic: 'age_years'
}
],
column_fields: ['email'],
column_order: ['email'],
sort_key: 'Example',
sort_order: 'asc',
footer_calculations: [{operation: 'count_empty', field_key: 'amount', fieldKey: 'amount'}],
search_query: 'Jane',
searchQuery: 'Jane',
related_config: {program_surface: 'recipients'},
schedule: {
kind: 'instant',
localDatetime: '2026-12-01T09:00:00',
timezone: 'Africa/Kampala',
offsetMinutes: 180,
utcAt: '2026-12-01T06:00:00Z',
source: 'calendar'
},
duration: 0,
start_date: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/files/saved_filters', 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.gratona.com/v1/admin/files/saved_filters",
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([
'client_id' => 42,
'hysform_id' => 42,
'module_id' => 5,
'sponsorships' => 42,
'view_id' => 42,
'name' => 'Example',
'type' => 'view',
'date_range' => [
'preset' => 'last_7_days',
'type' => 'last_30',
'value' => 'last_30_days',
'start_date' => '2026-01-01',
'end_date' => '2026-12-31',
'date_from' => '2026-01-01',
'date_to' => '2026-12-31'
],
'frequency' => 'weekly',
'date_time' => '2026-12-01T09:00:00+03:00',
'timezone' => 'Africa/Kampala',
'recipient_emails' => [
'finance@example.org'
],
'export_locale' => 'en',
'fields' => [
'email'
],
'filterGroups' => [
[
'field' => 'email',
'field_key' => 'email',
'fieldKey' => 'email',
'operator' => 'contains',
'op' => 'contains',
'value' => '@example.org',
'semantic' => 'age_years'
]
],
'column_fields' => [
'email'
],
'column_order' => [
'email'
],
'sort_key' => 'Example',
'sort_order' => 'asc',
'footer_calculations' => [
[
'operation' => 'count_empty',
'field_key' => 'amount',
'fieldKey' => 'amount'
]
],
'search_query' => 'Jane',
'searchQuery' => 'Jane',
'related_config' => [
'program_surface' => 'recipients'
],
'schedule' => [
'kind' => 'instant',
'localDatetime' => '2026-12-01T09:00:00',
'timezone' => 'Africa/Kampala',
'offsetMinutes' => 180,
'utcAt' => '2026-12-01T06:00:00Z',
'source' => 'calendar'
],
'duration' => 0,
'start_date' => '2026-10-20T12:00:00Z'
]),
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://api.gratona.com/v1/admin/files/saved_filters"
payload := strings.NewReader("{\n \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\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://api.gratona.com/v1/admin/files/saved_filters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/files/saved_filters")
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 \"client_id\": 42,\n \"hysform_id\": 42,\n \"module_id\": 5,\n \"sponsorships\": 42,\n \"view_id\": 42,\n \"name\": \"Example\",\n \"type\": \"view\",\n \"date_range\": {\n \"preset\": \"last_7_days\",\n \"type\": \"last_30\",\n \"value\": \"last_30_days\",\n \"start_date\": \"2026-01-01\",\n \"end_date\": \"2026-12-31\",\n \"date_from\": \"2026-01-01\",\n \"date_to\": \"2026-12-31\"\n },\n \"frequency\": \"weekly\",\n \"date_time\": \"2026-12-01T09:00:00+03:00\",\n \"timezone\": \"Africa/Kampala\",\n \"recipient_emails\": [\n \"finance@example.org\"\n ],\n \"export_locale\": \"en\",\n \"fields\": [\n \"email\"\n ],\n \"filterGroups\": [\n {\n \"field\": \"email\",\n \"field_key\": \"email\",\n \"fieldKey\": \"email\",\n \"operator\": \"contains\",\n \"op\": \"contains\",\n \"value\": \"@example.org\",\n \"semantic\": \"age_years\"\n }\n ],\n \"column_fields\": [\n \"email\"\n ],\n \"column_order\": [\n \"email\"\n ],\n \"sort_key\": \"Example\",\n \"sort_order\": \"asc\",\n \"footer_calculations\": [\n {\n \"operation\": \"count_empty\",\n \"field_key\": \"amount\",\n \"fieldKey\": \"amount\"\n }\n ],\n \"search_query\": \"Jane\",\n \"searchQuery\": \"Jane\",\n \"related_config\": {\n \"program_surface\": \"recipients\"\n },\n \"schedule\": {\n \"kind\": \"instant\",\n \"localDatetime\": \"2026-12-01T09:00:00\",\n \"timezone\": \"Africa/Kampala\",\n \"offsetMinutes\": 180,\n \"utcAt\": \"2026-12-01T06:00:00Z\",\n \"source\": \"calendar\"\n },\n \"duration\": 0,\n \"start_date\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Filter Preferences Saved",
"data": {
"id": 42,
"client_id": 42,
"owner_user_id": 42,
"hysform_id": 42,
"module_id": 42,
"sponsorships": 42,
"name": "Example",
"fields": "[]",
"column_fields": "[]",
"column_order": "[]",
"date_range": "[]",
"footer_calculations": "[]",
"sort_key": "Example",
"sort_order": "Example",
"search_query": "Example",
"related_config": {},
"snapshot": false,
"type": "Example",
"created_at": "2026-10-20T12:00:00Z",
"updated_at": "2026-10-20T12:00:00Z",
"deleted_at": "2026-10-20T12:00:00Z"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"status": "error",
"error_code": "ENTITLEMENT_REQUIRED",
"message": "Scheduled reports are not included in your current plan.",
"feature": "reports.scheduled_email",
"feature_name": "Scheduled reports",
"required_tier": "Example",
"required_tier_name": "Example",
"current_tier": "Example",
"current_tier_name": "Example",
"allowance": 42,
"quota": 42,
"upgrade": {
"cta": "book_a_demo"
}
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}