# 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`).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/api/quick-start-guide/api-data-generation-schedule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
