cURL
curl --request POST \
--url https://api.tirdad.ai/v1/tasks/scheduled \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"connection_id": "<string>",
"job_config": {
"bucket": "<string>",
"endpoint_url": "<string>",
"export_metadata_fields": [
{
"field_key": "<string>",
"column_name": "<string>"
}
],
"key_prefix": "<string>",
"region": "<string>",
"use_path_style": true
},
"enabled": true
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.scheduled_tasks.create_scheduled_task(connection_id="<id>", entity_type="credit_usage", interval="custom", job_config={})
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.scheduledTasks.createScheduledTask({
connectionId: "<id>",
entityType: "credit_usage",
interval: "custom",
jobConfig: {},
});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.ScheduledTasks.CreateScheduledTask(ctx, types.CreateScheduledTaskRequest{
ConnectionID: "<id>",
EntityType: types.ScheduledTaskEntityTypeCreditUsage,
Interval: types.ScheduledTaskIntervalCustom,
JobConfig: types.S3JobConfig{},
})
if err != nil {
log.Fatal(err)
}
if res.ScheduledTaskResponse != nil {
// handle response
}
}{
"connection_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"entity_type": "events",
"environment_id": "<string>",
"id": "<string>",
"interval": "15MIN",
"job_config": {
"bucket": "<string>",
"compression": "none",
"encryption": "AES256",
"endpoint_url": "<string>",
"export_metadata_fields": [
{
"entity_type": "customer",
"field_key": "<string>",
"column_name": "<string>"
}
],
"key_prefix": "<string>",
"provider": "tirdad",
"region": "<string>",
"use_path_style": true
},
"status": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Scheduled Tasks
Create scheduled task
Use when setting up recurring data exports or other scheduled jobs. Ideal for report generation or syncing data on a schedule.
POST
/
tasks
/
scheduled
cURL
curl --request POST \
--url https://api.tirdad.ai/v1/tasks/scheduled \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"connection_id": "<string>",
"job_config": {
"bucket": "<string>",
"endpoint_url": "<string>",
"export_metadata_fields": [
{
"field_key": "<string>",
"column_name": "<string>"
}
],
"key_prefix": "<string>",
"region": "<string>",
"use_path_style": true
},
"enabled": true
}
'from tirdad_sdk import Tirdad
with Tirdad(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.scheduled_tasks.create_scheduled_task(connection_id="<id>", entity_type="credit_usage", interval="custom", job_config={})
# Handle response
print(res)import { Tirdad } from "@tirdad/sdk";
const tirdad = new Tirdad({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await tirdad.scheduledTasks.createScheduledTask({
connectionId: "<id>",
entityType: "credit_usage",
interval: "custom",
jobConfig: {},
});
console.log(result);
}
run();package main
import(
"context"
tirdad "github.com/tirdad-billing/go-sdk/v2"
"github.com/tirdad-billing/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := tirdad.New(
tirdad.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.ScheduledTasks.CreateScheduledTask(ctx, types.CreateScheduledTaskRequest{
ConnectionID: "<id>",
EntityType: types.ScheduledTaskEntityTypeCreditUsage,
Interval: types.ScheduledTaskIntervalCustom,
JobConfig: types.S3JobConfig{},
})
if err != nil {
log.Fatal(err)
}
if res.ScheduledTaskResponse != nil {
// handle response
}
}{
"connection_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"entity_type": "events",
"environment_id": "<string>",
"id": "<string>",
"interval": "15MIN",
"job_config": {
"bucket": "<string>",
"compression": "none",
"encryption": "AES256",
"endpoint_url": "<string>",
"export_metadata_fields": [
{
"entity_type": "customer",
"field_key": "<string>",
"column_name": "<string>"
}
],
"key_prefix": "<string>",
"provider": "tirdad",
"region": "<string>",
"use_path_style": true
},
"status": "<string>",
"tenant_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
Scheduled Task
Response
Created