---
title: "Create Schedule"
method: POST
path: "/organizations/{orgId}/dataexports/schedules"
tags: ["ExportSchedule"]
---

# Create Schedule

`POST /organizations/{orgId}/dataexports/schedules`

Create a new Data Export Schedule. Each Schedule can be configured for exporting *only one* of either Usage or Operational data:

**Operational Data Exports**.
* Use the `operationalDataTypes` parameter to specify the entities whose operational data you want to include in the export each time the Export Schedule runs.
* For each of the entity types you select, each time the Export Schedule runs a separate file is compiled containing the operational data for all entities of that type that exist in your Organization

**Usage Data Exports**.
* Select the Meters and Accounts whose usage data you want to include in the export each time the Export Schedule runs.
* You can use the `dimensionFilters` parameter to filter the usage data returned for export by adding specific values of non-numeric Dimension data fields on included Meters. Only the data collected for the values you've added for the selected Dimension fields will be included in the export.
* You can use the `aggregations` to apply aggregation methods the usage data returned for export. This restricts the range of usage data returned for export to only the data collected by aggregated fields on selected Meters. Nothing is returned for any non-aggregated fields on Meters. The usage data for Meter fields is returned as the values resulting from applying the selected aggregation method. See the [Aggregations for Queries - Options and Consequences](https://www.m3ter.com/docs/guides/data-explorer/usage-data-explorer-v2#aggregations-for-queries---understanding-options-and-consequences) for more details.
* If you've applied `aggregations` to the usage returned for export, you can then use the `groups` parameter to group the data by *Account*, *Dimension*, or *Time*.

Request and Response schema:
* Use the selector under the `sourceType` parameter to expose the relevant request and response schema for the source data type.

Request and Response samples:
* Use the **Example** selector to show the relevant request and response samples for source data type.

## Path parameters

- `orgId` string, required

## Request body

- union
  - OperationalDataExportConfigurationRequest
    - `sourceType` 'OPERATIONAL', required — The type of data to export. Possible values are: OPERATIONAL, USAGE.
    - `operationalDataTypes` OperationalDataType[], required — A list of the entities whose operational data is included in the data export.
    - `name` string, required — The name of the Data Export Schedule.
    - `code` string, required — Unique short code of the Data Export Schedule.
    - `destinationIds` string[] — The Export Destination ids. **Note:** When creating or updating an Export Schedule, you can: * Define at least one Export Destination - see the [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API Reference. * Alternatively, omit a Destination. Even if you omit a Destinations when the Export job runs and has succeeded, you can download the data export file locally. For details, see the [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) endpoint in this API Reference.
    - `scheduleType` string — The type of interval used for when Data Exports are run for the Schedule. Possible values are: HOURLY or DAILY or MINUTE. Used in conjunction with the `period` parameter to define the frequency of Data Exports in hours, days, or minutes.
    - `period` integer — Defines the Schedule frequency for the Data Export to run in Hours, Days, or Minutes. Used in conjunction with the `scheduleType` parameter: * Lowest frequency is every 3 days. * Highest frequency is every 15 minutes.
    - `offset` integer — Offset indicating starting point of the export
    - `cronExpression` string
    - `exportFileFormat` 'CSV' | 'JSONL' — The export file format.
    - `version` integer — The version number of the entity: - **Create entity:** Not valid for initial insertion of new entity - *do not use for Create*. On initial Create, version is set at 1 and listed in the response. - **Update Entity:** On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
  - UsageDataExportConfigurationRequestV2
    - `sourceType` 'USAGE', required — The type of data to export. Possible values are: OPERATIONAL, USAGE.
    - `meterIds` string[] — List of meter IDs to export
    - `accountIds` string[] — List of account IDs to export
    - `dimensionFilters` DataExplorerDimensionFilter[] — List of dimension filters to apply
      - `meterId` string, required — Meter ID
      - `fieldCode` string, required — Field code
    - `aggregations` DataExplorerAggregation[] — List of aggregations to apply
      - `meterId` string, required — Meter ID
      - `fieldCode` string, required — Field code
    - `groups` DataExplorerGroup[] — List of groups to apply
      - `groupType` 'ACCOUNT' | 'DIMENSION' | 'TIME' — Type of group
    - `timePeriod` 'TODAY' | 'YESTERDAY' | 'WEEK_TO_DATE' | 'MONTH_TO_DATE' | 'YEAR_TO_DATE' | 'PREVIOUS_WEEK' | 'PREVIOUS_MONTH' | 'PREVIOUS_QUARTER' | 'PREVIOUS_YEAR' | 'LAST_12_HOURS' | 'LAST_7_DAYS' | 'LAST_30_DAYS' | 'LAST_35_DAYS' | 'LAST_90_DAYS' | 'LAST_120_DAYS' | 'LAST_YEAR', required — Time period for which the usage data should be exported.
    - `name` string, required — The name of the Data Export Schedule.
    - `code` string, required — Unique short code of the Data Export Schedule.
    - `destinationIds` string[] — The Export Destination ids. **Note:** When creating or updating an Export Schedule, you can: * Define at least one Export Destination - see the [ExportDestination](https://www.m3ter.com/docs/api#tag/ExportDestination) section of this API Reference. * Alternatively, omit a Destination. Even if you omit a Destinations when the Export job runs and has succeeded, you can download the data export file locally. For details, see the [Get Data Export File Download URL](https://www.m3ter.com/docs/api#tag/ExportDestination/operation/GenerateDataExportFileDownloadUrl) endpoint in this API Reference.
    - `scheduleType` string — The type of interval used for when Data Exports are run for the Schedule. Possible values are: HOURLY or DAILY or MINUTE. Used in conjunction with the `period` parameter to define the frequency of Data Exports in hours, days, or minutes.
    - `period` integer — Defines the Schedule frequency for the Data Export to run in Hours, Days, or Minutes. Used in conjunction with the `scheduleType` parameter: * Lowest frequency is every 3 days. * Highest frequency is every 15 minutes.
    - `offset` integer — Offset indicating starting point of the export
    - `cronExpression` string
    - `exportFileFormat` 'CSV' | 'JSONL' — The export file format.
    - `version` integer — The version number of the entity: - **Create entity:** Not valid for initial insertion of new entity - *do not use for Create*. On initial Create, version is set at 1 and listed in the response. - **Update Entity:** On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.

## Response `200`

Returns the created Export Schedule

- union
  - OperationalDataExportConfigurationResponse
    - `id` string, required — The UUID of the entity.
    - `operationalDataTypes` OperationalDataType[] — A list of the entities whose operational data is included in the data export.
    - `name` string — The name of the Data Export Schedule.
    - `code` string — Unique short code of the Data Export Schedule.
    - `sourceType` 'USAGE' | 'OPERATIONAL' — The type of data to export. Possible values: OPERATIONAL or USAGE.
    - `destinationIds` string[] — The Export Destination ids.
    - `scheduleType` 'HOUR' | 'DAY' | 'MINUTE' | 'AD_HOC' — The schedule type.
    - `period` integer — Defines the Schedule frequency for the Data Export to run in Hours, Days, or Minutes. Used in conjunction with the `scheduleType` parameter.
    - `offset` integer — Offset indicating starting point of the export within the configured scheduleType. For DAY, offset is in hours. For HOUR, offset is in minutes. Offset is not valid for MINUTE.
    - `cronExpression` string — A cron expression (https://en.wikipedia.org/wiki/Cron) describing the frequency of the expression. Executions cannot be more frequent than every 15 minutes.
    - `exportFileFormat` 'CSV' | 'JSONL' — The export file format.
    - `dtCreated` string, date-time — The DateTime when the Data Export Schedule was created.
    - `dtLastModified` string, date-time — The DateTime when the Schedule was last modified.
    - `createdBy` string — The id of the user who created this Schedule.
    - `lastModifiedBy` string — The id of the user who last modified this Data Export Schedule.
    - `version` integer — The version number: - **Create:** On initial Create to insert a new entity, the version is set at 1 in the response. - **Update:** On successful Update, the version is incremented by 1 in the response.
  - UsageDataExportConfigurationResponseV2
    - `id` string, required — The UUID of the entity.
    - `meterIds` string[] — List of meter IDs for which the usage data will be exported.
    - `accountIds` string[] — List of account IDs for which the usage data will be exported.
    - `timePeriod` 'TODAY' | 'YESTERDAY' | 'WEEK_TO_DATE' | 'MONTH_TO_DATE' | 'YEAR_TO_DATE' | 'PREVIOUS_WEEK' | 'PREVIOUS_MONTH' | 'PREVIOUS_QUARTER' | 'PREVIOUS_YEAR' | 'LAST_12_HOURS' | 'LAST_7_DAYS' | 'LAST_30_DAYS' | 'LAST_35_DAYS' | 'LAST_90_DAYS' | 'LAST_120_DAYS' | 'LAST_YEAR' — Time period for which the usage data should be exported.
    - `dimensionFilters` DataExplorerDimensionFilter[] — List of dimension filters to apply
      - `meterId` string, required — Meter ID
      - `fieldCode` string, required — Field code
    - `aggregations` DataExplorerAggregation[] — List of aggregations to apply
      - `meterId` string, required — Meter ID
      - `fieldCode` string, required — Field code
    - `groups` DataExplorerGroup[] — List of groups to apply
      - `groupType` 'ACCOUNT' | 'DIMENSION' | 'TIME' — Type of group
    - `name` string — The name of the Data Export Schedule.
    - `code` string — Unique short code of the Data Export Schedule.
    - `sourceType` 'USAGE' | 'OPERATIONAL' — The type of data to export. Possible values: OPERATIONAL or USAGE.
    - `destinationIds` string[] — The Export Destination ids.
    - `scheduleType` 'HOUR' | 'DAY' | 'MINUTE' | 'AD_HOC' — The schedule type.
    - `period` integer — Defines the Schedule frequency for the Data Export to run in Hours, Days, or Minutes. Used in conjunction with the `scheduleType` parameter.
    - `offset` integer — Offset indicating starting point of the export within the configured scheduleType. For DAY, offset is in hours. For HOUR, offset is in minutes. Offset is not valid for MINUTE.
    - `cronExpression` string — A cron expression (https://en.wikipedia.org/wiki/Cron) describing the frequency of the expression. Executions cannot be more frequent than every 15 minutes.
    - `exportFileFormat` 'CSV' | 'JSONL' — The export file format.
    - `dtCreated` string, date-time — The DateTime when the Data Export Schedule was created.
    - `dtLastModified` string, date-time — The DateTime when the Schedule was last modified.
    - `createdBy` string — The id of the user who created this Schedule.
    - `lastModifiedBy` string — The id of the user who last modified this Data Export Schedule.
    - `version` integer — The version number: - **Create:** On initial Create to insert a new entity, the version is set at 1 in the response. - **Update:** On successful Update, the version is incremented by 1 in the response.

## Other responses

- `4XX` — Error message
- `5XX` — Error message

---

[API](https://skmtc.net/m3ter-com/apis/m3ter-api.md) · [All operations](https://skmtc.net/m3ter-com/apis/m3ter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/m3ter-com/m3ter-api/revisions/ac93d1a9e6d9/schema)
