# Schedule data generation jobs

{% hint style="info" %}
Included in the Basic API
{% endhint %}

From the Tonic Structural API, you can set up a schedule to run data generation for a workspace. The schedule consists of one or more configurations. Each configuration uses a cron expression to specify the schedule.

For an overview of the cron expression syntax, go to [data-generation-scheduling](https://docs.tonic.ai/app/workflows/data-generation-run-job/data-generation-scheduling "mention").

## Getting the current job schedule for a workspace <a href="#api-data-gen-schedule-get" id="api-data-gen-schedule-get"></a>

To get the current schedule for a workspace, use:

<mark style="background-color:blue;">**GET**</mark>**&#x20;/api/workspace/{workspaceId}/JobSchedule**

The request includes:

* The type of schedule (always `DataGeneration`)
* Optionally, the number of configurations to include in the response.

The response contains the list of job configurations. Each job configuration includes:

* The type of configuration (always `Cron`)
* The cron expression
* The time zone for the configuration
* Whether the configuration is active
* When the configuration was created and most recently updated
* The users who created and most recently updated the configuration

## Updating the job schedule for a workspace <a href="#api-data-gen-schedule-update" id="api-data-gen-schedule-update"></a>

When you update a job schedule, you provide a new set of schedule configurations. The provided schedule configurations replace the existing schedule configurations for the workspace.

To update the job schedule for a workspace, use:

<mark style="background-color:green;">**POST**</mark>**&#x20;/api/workspace/{workspaceId}/JobSchedule**

Each schedule configuration includes:

* The type of configuration (always `Cron`).
* The cron expression.
* The time zone for the configuration.
* Whether the configuration is active.

## Removing the job schedule for a workspace <a href="#api-data-gen-schedule-remove" id="api-data-gen-schedule-remove"></a>

To remove the schedule completely from a workspace, use:

<mark style="background-color:red;">**DELETE**</mark>**&#x20;/api/workspace/{workspaceId}/JobSchedule**

When you delete a job schedule, you specify the type of schedule (always `DataGeneration`).
