cURL
curl --request POST \
--url https://us.api.flexprice.io/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 flexprice import Flexprice
with Flexprice(
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 { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.scheduledTasks.createScheduledTask({
connectionId: "<id>",
entityType: "credit_usage",
interval: "custom",
jobConfig: {},
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.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": "flexprice",
"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://us.api.flexprice.io/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 flexprice import Flexprice
with Flexprice(
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 { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.scheduledTasks.createScheduledTask({
connectionId: "<id>",
entityType: "credit_usage",
interval: "custom",
jobConfig: {},
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.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": "flexprice",
"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>"
}Authorizations
Enter your API key in the format x-api-key <api-key>*
Body
application/json
Scheduled Task
Available options:
events, invoice, credit_topups, wallet_debits, credit_usage, usage_analytics, revenue_facts Available options:
15MIN, 30MIN, custom, hourly, daily Show child attributes
Show child attributes
Response
Created
Available options:
events, invoice, credit_topups, wallet_debits, credit_usage, usage_analytics, revenue_facts Available options:
15MIN, 30MIN, custom, hourly, daily Show child attributes
Show child attributes

