> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/api/quick-start-guide/api-data-generation-schedule.md).

# 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 [Scheduling data generation](/app/workflows/data-generation-run-job/data-generation-scheduling.md).

## 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
