Launch Week 3: Five days of launches

Export Schedules

Overview

The Confident AI SDK exposes every Export Schedule method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.

Methods

List Export Schedules

Lists the export schedules in your Confident AI project one page at a time, newest first. Narrow the page with exportType or enabled; retrieve one by id to see its cadence, filters and destination.

from confident_ai import ConfidentAI
from confident_ai.export_schedules import SchedulableExportType

client = ConfidentAI()

result = client.export_schedules.list(
    export_type=SchedulableExportType.TRACES,
    enabled="true",
    page=1,
    page_size=25,
)

For async mode, call a_list and await it as shown below:

result = await client.export_schedules.a_list(...)

Parameters

ParameterTypeDescription
export_typeOptional[SchedulableExportType]See SchedulableExportType.
enabledOptional[Literal['true', 'false']]Return only the schedules that are currently running, or only those that are paused. Omit it for both.
pageOptional[int]The page to return. Defaults to 1.
page_sizeOptional[int]The number of results per page, at most 100. Defaults to 25.

Returns

This method returns an object of type ExportScheduleList.

Create Export Schedule

Creates an export schedule in your Confident AI project and returns its id. Each run exports the window since the previous run and delivers it to the export destination you name, so a schedule starts producing files as soon as it is enabled.

from confident_ai import ConfidentAI
from confident_ai.export_schedules import SchedulableExportType
from confident_ai.common import ScheduleIntervalUnit
from confident_ai.common import ScheduleRecurrenceType

client = ConfidentAI()

result = client.export_schedules.create(
    name="Weekly checkout conversations",
    export_type=SchedulableExportType.TRACES,
    recurrence=ScheduleRecurrenceType.ONCE,
    repeat_every=1,
    repeat_unit=ScheduleIntervalUnit.MINUTE,
    start_at="2025-02-01T09:00:00+00:00",
    max_runs=12,
    end_at="2025-12-31T23:59:59+00:00",
    description="Last week's checkout conversations for the data team.",
    filters={
        "operator": "AND",
        "groups": [
            {
                "operator": "AND",
                "filters": [
                    {
                        "category": "Name",
                        "condition": "Is",
                        "value": "checkout-assistant"
                    }
                ]
            }
        ]
    },
    environment="production",
    annotation_selection_type="Traces",
    destination_id="<EXPORT-DESTINATION-ID>",
    enabled=True,
)

For async mode, call a_create and await it as shown below:

result = await client.export_schedules.a_create(...)

Parameters

ParameterTypeDescription
namestrRequired. The name of the schedule.
export_typeSchedulableExportTypeRequired. See SchedulableExportType.
recurrenceOptional[ScheduleRecurrenceType]See ScheduleRecurrenceType.
repeat_everyOptional[int]How many repeatUnits apart the runs are, for an INTERVAL schedule. Send null to clear it.
repeat_unitOptional[ScheduleIntervalUnit]The unit repeatEvery counts, for an INTERVAL schedule. Send null to clear it. See ScheduleIntervalUnit.
start_atOptional[str]When the schedule first runs, as an ISO 8601 datetime. Send null to start it immediately.
max_runsOptional[int]How many times the schedule runs before it stops. Send null to let it run indefinitely.
end_atOptional[str]When the schedule stops running, as an ISO 8601 datetime. Send null to leave it open-ended.
descriptionOptional[str]What the schedule exports. Send null to leave it unset.
filtersOptional[FilterSet]See FilterSet.
environmentOptional[Environment]The environment each run exports data from. Omit it, or send null, to export data from every environment. Ignored for TEST_RUNS exports, which have no environment. See Environment.
annotation_selection_typeOptional[AnnotationSelectionType]The annotation source for each ANNOTATIONS export run. Omit it, or send null, to export annotations from every source. Ignored for other export types. See AnnotationSelectionType.
destination_idOptional[str]The id of the export destination each run delivers its file to. A scheduled run has no recipient of its own, so a schedule created without a destination produces files that go nowhere.
enabledOptional[bool]Whether the schedule starts running as soon as it is created. Defaults to true.

Returns

This method returns an object of type ExportScheduleRef.

Get Export Schedule

Retrieves an export schedule by id, with the filters and destination each of its runs uses.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.export_schedules.get(
    export_schedule_id="<EXPORT-SCHEDULE-ID>",
)

For async mode, call a_get and await it as shown below:

result = await client.export_schedules.a_get(...)

Parameters

ParameterTypeDescription
export_schedule_idstrRequired. The id of the export schedule.

Returns

This method returns an object of type ExportSchedule.

Update Export Schedule

Changes an export schedule and returns it. Changing the cadence or pausing the schedule re-registers its next run; exportType is fixed at creation, because changing it would re-target every future run.

from confident_ai import ConfidentAI
from confident_ai.common import ScheduleIntervalUnit
from confident_ai.common import ScheduleRecurrenceType

client = ConfidentAI()

result = client.export_schedules.update(
    export_schedule_id="<EXPORT-SCHEDULE-ID>",
    recurrence=ScheduleRecurrenceType.ONCE,
    repeat_every=1,
    repeat_unit=ScheduleIntervalUnit.MINUTE,
    start_at="2025-02-01T09:00:00+00:00",
    max_runs=12,
    end_at="2025-12-31T23:59:59+00:00",
    name="Weekly checkout conversations",
    description="Last week's checkout conversations for the data team.",
    filters={
        "operator": "AND",
        "groups": [
            {
                "operator": "AND",
                "filters": [
                    {
                        "category": "Name",
                        "condition": "Is",
                        "value": "checkout-assistant"
                    }
                ]
            }
        ]
    },
    environment="production",
    annotation_selection_type="Traces",
    destination_id="<EXPORT-DESTINATION-ID>",
    enabled=True,
)

For async mode, call a_update and await it as shown below:

result = await client.export_schedules.a_update(...)

Parameters

ParameterTypeDescription
export_schedule_idstrRequired. The id of the export schedule.
recurrenceOptional[ScheduleRecurrenceType]See ScheduleRecurrenceType.
repeat_everyOptional[int]How many repeatUnits apart the runs are, for an INTERVAL schedule. Send null to clear it.
repeat_unitOptional[ScheduleIntervalUnit]The unit repeatEvery counts, for an INTERVAL schedule. Send null to clear it. See ScheduleIntervalUnit.
start_atOptional[str]When the schedule first runs, as an ISO 8601 datetime. Send null to start it immediately.
max_runsOptional[int]How many times the schedule runs before it stops. Send null to let it run indefinitely.
end_atOptional[str]When the schedule stops running, as an ISO 8601 datetime. Send null to leave it open-ended.
nameOptional[str]The name of the schedule.
descriptionOptional[str]What the schedule exports. Send null to clear it.
filtersOptional[FilterSet]See FilterSet.
environmentOptional[Environment]The environment each run exports data from. Send null to export data from every environment. Ignored for TEST_RUNS exports, which have no environment. See Environment.
annotation_selection_typeOptional[AnnotationSelectionType]The annotation source for each ANNOTATIONS export run. Send null to export annotations from every source. Ignored for other export types. See AnnotationSelectionType.
destination_idOptional[str]The id of the export destination each run delivers its file to. Send null to leave the schedule without one.
enabledOptional[bool]Whether the schedule runs. Send false to pause it without deleting it.

Returns

This method returns an object of type ExportSchedule.

Delete Export Schedule

Permanently deletes an export schedule and unregisters its next run. Files its earlier runs already delivered are kept.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.export_schedules.delete(
    export_schedule_id="<EXPORT-SCHEDULE-ID>",
)

For async mode, call a_delete and await it as shown below:

result = await client.export_schedules.a_delete(...)

Parameters

ParameterTypeDescription
export_schedule_idstrRequired. The id of the export schedule.

Returns

This method returns an object of type ExportScheduleRef.

Types

AnnotationSelectionType

The annotation source for an ANNOTATIONS export: traces, spans, or threads.

class AnnotationSelectionType(Enum):
    SPANS = "Spans"
    THREADS = "Threads"
    TRACES = "Traces"

SPANS · THREADS · TRACES

Environment

This is the environment where your trace was posted, which helps with separating and debugging traces from different environments on the Confident AI platform.

class Environment(Enum):
    PRODUCTION = "production"
    DEVELOPMENT = "development"
    STAGING = "staging"
    TESTING = "testing"

PRODUCTION · DEVELOPMENT · STAGING · TESTING

ExportSchedule

A recurring export of this project's data. Each run covers the window since the previous run and narrows it by filters, where an empty groups list exports everything in that window.

class ExportSchedule:
    id: str
    name: str
    description: Optional[str]
    export_type: SchedulableExportType = Field(alias="exportType")
    filters: FilterSet
    environment: Optional[Environment]
    annotation_selection_type: Optional[AnnotationSelectionType] = Field(alias="annotationSelectionType")
    destination_id: Optional[str] = Field(alias="destinationId")
    schedule_settings: Optional[ExportScheduleSettings] = Field(alias="scheduleSettings")
    created_at: str = Field(alias="createdAt")
    updated_at: str = Field(alias="updatedAt")

idstrRequired

The id of the schedule, generated by Confident AI.

Example: "<EXPORT-SCHEDULE-ID>"

namestrRequired

The name of the schedule.

Example: "Weekly checkout conversations"

descriptionOptional[str]Required

What the schedule exports, or null when it has no description.

Example: "Last week's checkout conversations for the data team."

export_typeSchedulableExportTypeRequired

filtersFilterSetRequired

environmentOptional[Environment]Required

The environment each run exports data from, or null when it exports data from every environment.

See Environment.

Example: "production"

annotation_selection_typeOptional[AnnotationSelectionType]Required

The annotation source for each ANNOTATIONS export run, or null when it exports annotations from every source.

See AnnotationSelectionType.

Example: "Traces"

destination_idOptional[str]Required

The id of the export destination each run delivers its file to, or null when the schedule has none.

Example: "<EXPORT-DESTINATION-ID>"

schedule_settingsOptional[ExportScheduleSettings]Required

The cadence the schedule runs on, or null when its settings were deleted and it no longer runs.

See ExportScheduleSettings.

created_atstrRequired

When the schedule was created.

Example: "2025-01-15T10:30:00+00:00"

updated_atstrRequired

When the schedule was last changed.

Example: "2025-02-24T09:00:00+00:00"

ExportScheduleList

One page of export schedules, with the total across all pages.

class ExportScheduleList:
    export_schedules: List[ExportScheduleSummary] = Field(alias="exportSchedules")
    total_export_schedules: int = Field(alias="totalExportSchedules")
    page: int
    page_size: int = Field(alias="pageSize")

export_schedulesList[ExportScheduleSummary]Required

The schedules for the current page, newest first.

See ExportScheduleSummary.

total_export_schedulesintRequired

The total number of schedules matching the query.

Example: 3

pageintRequired

The page this response covers.

Example: 1

page_sizeintRequired

The number of schedules per page.

Example: 25

ExportScheduleRef

A reference to an export schedule by its id.

class ExportScheduleRef:
    id: str

idstrRequired

The id of the schedule, generated by Confident AI.

Example: "<EXPORT-SCHEDULE-ID>"

ExportScheduleSettings

The cadence an export schedule runs on, together with how far through that cadence it is.

class ExportScheduleSettings:
    recurrence: ScheduleRecurrenceType
    repeat_every: Optional[int] = Field(alias="repeatEvery")
    repeat_unit: Optional[ScheduleIntervalUnit] = Field(alias="repeatUnit")
    start_at: Optional[str] = Field(alias="startAt")
    end_at: Optional[str] = Field(alias="endAt")
    max_runs: Optional[int] = Field(alias="maxRuns")
    run_count: int = Field(alias="runCount")
    last_run_at: Optional[str] = Field(alias="lastRunAt")
    enabled: bool

recurrenceScheduleRecurrenceTypeRequired

repeat_everyOptional[int]Required

How many repeatUnits apart the runs are, or null for a schedule that does not repeat.

Example: 1

repeat_unitOptional[ScheduleIntervalUnit]Required

The unit repeatEvery counts, or null for a schedule that does not repeat.

See ScheduleIntervalUnit.

start_atOptional[str]Required

When the schedule first runs, or null when it started immediately.

Example: "2025-02-01T09:00:00+00:00"

end_atOptional[str]Required

When the schedule stops running, or null when it is open-ended.

Example: "2025-12-31T23:59:59+00:00"

max_runsOptional[int]Required

How many times the schedule runs before it stops, or null when it runs indefinitely.

Example: 12

run_countintRequired

How many times the schedule has run so far.

Example: 6

last_run_atOptional[str]Required

When the schedule last ran, or null when it has never run.

Example: "2025-02-24T09:00:00+00:00"

enabledboolRequired

Whether the schedule is currently running.

Example: true

ExportScheduleSummary

An export schedule as it appears in a list: what it exports and whether it is running, without its cadence or filters.

class ExportScheduleSummary:
    id: str
    name: str
    export_type: SchedulableExportType = Field(alias="exportType")
    enabled: bool

idstrRequired

The id of the schedule, generated by Confident AI.

Example: "<EXPORT-SCHEDULE-ID>"

namestrRequired

The name of the schedule.

Example: "Weekly checkout conversations"

export_typeSchedulableExportTypeRequired

enabledboolRequired

Whether the schedule is currently running.

Example: true

FilterSet

A set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as Name or User Id, against a value with a condition such as Is or Contains.

class FilterSet:
    operator: Literal["AND", "OR"]
    groups: List[FilterSetGroup]

operatorLiteral["AND", "OR"]Required

groupsList[FilterSetGroup]Required

SchedulableExportType

What each run of the schedule exports. Only project-scoped export types can be scheduled: TRACES_WITH_SPANS, TRACES, CONVERSATIONS, CONVERSATION_METRICS, ANNOTATIONS, TEST_RUNS. Audit log exports are organization-scoped and are not export schedules. Please configure them on the platform instead.

class SchedulableExportType(Enum):
    TRACES = "TRACES"
    TRACES_WITH_SPANS = "TRACES_WITH_SPANS"
    CONVERSATIONS = "CONVERSATIONS"
    CONVERSATION_METRICS = "CONVERSATION_METRICS"
    ANNOTATIONS = "ANNOTATIONS"
    TEST_RUNS = "TEST_RUNS"
    AUDIT_LOGS = "AUDIT_LOGS"

TRACES · TRACES_WITH_SPANS · CONVERSATIONS · CONVERSATION_METRICS · ANNOTATIONS · TEST_RUNS · AUDIT_LOGS

ScheduleIntervalUnit

The unit repeatEvery counts for an INTERVAL schedule.

class ScheduleIntervalUnit(Enum):
    MINUTE = "MINUTE"
    HOUR = "HOUR"
    DAY = "DAY"
    WEEK = "WEEK"
    MONTH = "MONTH"

MINUTE · HOUR · DAY · WEEK · MONTH

ScheduleRecurrenceType

How often a schedule fires: ONCE runs a single time at startAt, INTERVAL repeats every repeatEvery repeatUnits.

class ScheduleRecurrenceType(Enum):
    ONCE = "ONCE"
    INTERVAL = "INTERVAL"

ONCE · INTERVAL

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI