> For the complete documentation index, see [llms.txt](https://developer.emporix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.emporix.io/api-references/readme/api-reference-19/schedules.md).

# Schedules

Read and set a configuration's run schedule.

## Retrieving a schedule

> Retrieves the cron schedule for a configuration.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Schedules","description":"Read and set a configuration's run schedule."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"schemas":{"Schedule":{"title":"Schedule","type":"object","description":"A cron schedule for a configuration.","properties":{"id":{"type":"string","format":"uuid","description":"The schedule identifier."},"configId":{"type":"string","format":"uuid","description":"The scheduled configuration."},"cron":{"type":"string","description":"A Spring cron expression with six fields."},"timezone":{"type":"string","description":"The IANA time zone the cron is evaluated in. Defaults to `UTC`."},"enabled":{"type":"boolean","description":"Whether the schedule is active. Defaults to `true`."},"nextFireAt":{"type":"string","format":"date-time","description":"The next fire time."}},"required":["cron"]},"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}}},"paths":{"/importtool/{tenant}/configs/{configId}/schedule":{"get":{"summary":"Retrieving a schedule","description":"Retrieves the cron schedule for a configuration.","operationId":"GET-importtool-get-schedule","tags":["Schedules"],"responses":{"200":{"description":"The request was successful. The schedule is returned.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"204":{"description":"No schedule is configured for the configuration."},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```

## Scheduling an import job

> Creates or updates the cron schedule (cron expression, time zone, and enabled flag) that runs a configuration automatically.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Schedules","description":"Read and set a configuration's run schedule."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"schemas":{"Schedule":{"title":"Schedule","type":"object","description":"A cron schedule for a configuration.","properties":{"id":{"type":"string","format":"uuid","description":"The schedule identifier."},"configId":{"type":"string","format":"uuid","description":"The scheduled configuration."},"cron":{"type":"string","description":"A Spring cron expression with six fields."},"timezone":{"type":"string","description":"The IANA time zone the cron is evaluated in. Defaults to `UTC`."},"enabled":{"type":"boolean","description":"Whether the schedule is active. Defaults to `true`."},"nextFireAt":{"type":"string","format":"date-time","description":"The next fire time."}},"required":["cron"]},"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"NotFound_404":{"description":"The requested resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}}},"paths":{"/importtool/{tenant}/configs/{configId}/schedule":{"put":{"summary":"Scheduling an import job","description":"Creates or updates the cron schedule (cron expression, time zone, and enabled flag) that runs a configuration automatically.","operationId":"PUT-importtool-schedule-job","tags":["Schedules"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"responses":{"200":{"description":"The request was successful. The schedule has been saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"400":{"description":"The `cron` expression or `timezone` value is invalid. The service expects a six-field cron expression (`second minute hour day-of-month month day-of-week`). A five-field expression such as `0 * * * *` is rejected. The service does not store it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/NotFound_404"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```

## Removing a schedule

> Removes the schedule. The configuration then runs only when it is triggered.\
> \
> The request is idempotent. Removing a schedule that does not exist also returns \`204\`.\
> Unlike creating a schedule, this request does not require the configuration to exist.\
> Use it to remove a schedule that remains after the configuration is deleted.

```json
{"openapi":"3.0.0","info":{"title":"Import Service","version":"0.0.1"},"tags":[{"name":"Schedules","description":"Read and set a configuration's run schedule."}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["importtool.import_trigger"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"importtool.import_trigger":"Needed to trigger, schedule, monitor, and cancel import runs; to manage a file-based stream's file queue; and to read configurations, streams, schedules, runs, and imported data."}}}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. Details will be provided in the response payload.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Given authorization scopes are not sufficient and do not match scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorMessage"}}}},"InternalServiceError_500":{"description":"An unexpected error occurred in the service. The body is the framework's default error body, not the error schema of the other responses.","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"When the error occurred."},"status":{"type":"integer","description":"The HTTP status code."},"error":{"type":"string","description":"The HTTP status reason phrase."},"path":{"type":"string","description":"The request path."}}}}}}},"schemas":{"errorMessage":{"title":"Error","description":"Schema for specific API errors.","type":"object","properties":{"code":{"type":"integer","description":"HTTP status code.","minimum":100,"maximum":599},"status":{"description":"The HTTP status reason phrase, for example `Conflict`.","type":"string"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"resourceId":{"description":"Identifier of the resource the error concerns, for example the configuration of a run that conflicts with an active run, or the run a retry was requested for. `null` when the error concerns no single resource.","type":"string","nullable":true},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"One problem causing the error.","type":"object","properties":{"message":{"type":"string","description":"What is wrong."},"field":{"type":"string","description":"The field the problem concerns, when there is one."}}}}},"required":["status","code","message"]}}},"paths":{"/importtool/{tenant}/configs/{configId}/schedule":{"delete":{"summary":"Removing a schedule","description":"Removes the schedule. The configuration then runs only when it is triggered.\n\nThe request is idempotent. Removing a schedule that does not exist also returns `204`.\nUnlike creating a schedule, this request does not require the configuration to exist.\nUse it to remove a schedule that remains after the configuration is deleted.","operationId":"deleteSchedule","tags":["Schedules"],"responses":{"204":{"description":"The schedule has been removed. The configuration now runs only when triggered."},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"500":{"$ref":"#/components/responses/InternalServiceError_500"}}}}}}
```


---

# 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://developer.emporix.io/api-references/readme/api-reference-19/schedules.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.
