> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/rules/create-or-update-schedule-rule.md).

# Create or update schedule Rule

Create or update a schedule for a rule so it runs automatically at specified times.

Use the API reference below to try the endpoint.

## Create or update schedule

> Create or update a schedule for a rule. Only rules support scheduling.

```json
{"openapi":"3.0.3","info":{"title":"Nected Rule API (Dev V1)","version":"1.0"},"tags":[{"name":"Rule","description":"List, create, read, update, test, schedule, and publish rules."}],"servers":[{"url":"https://api.nected.ai","description":"Production"}],"security":[{"DevAuth":[]}],"components":{"securitySchemes":{"DevAuth":{"type":"apiKey","in":"header","name":"Nected-API-Key","description":"Dev API key (`Nected-API-Key` header)"}},"schemas":{"ScheduleRequest":{"type":"object","description":"Request body for create or update schedule","properties":{"unit":{"type":"string","description":"Schedule unit (e.g. minute, hour, day)"},"isEnabled":{"type":"boolean"},"isDelete":{"type":"boolean","description":"Set true to remove the schedule"},"startAt":{"type":"string","description":"Start (ISO 8601)"},"endAt":{"type":"string","description":"End (ISO 8601)"},"spec":{"$ref":"#/components/schemas/ScheduleSpec"},"inputParam":{"type":"object","additionalProperties":true,"description":"Inputs when the rule runs on schedule"}}},"ScheduleSpec":{"type":"object","description":"Cron-like spec for schedule","properties":{"minute":{"type":"string","description":"Minute (0-59)"},"hour":{"type":"string","description":"Hour (0-23)"},"dayOfMonth":{"type":"string","description":"Day of month (1-31)"},"month":{"type":"string","description":"Month (1-12)"},"dayOfWeek":{"type":"string","description":"Day of week (0-6, 0 = Sunday)"}}},"Response":{"type":"object","description":"Standard API response wrapper","properties":{"code":{"type":"string"},"data":{"description":"Response payload: rule object, array of rules (list), version rows, or execution result — shape varies by endpoint"},"message":{"type":"string"},"pageNo":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"},"totalPages":{"type":"integer"},"paginationInfo":{"$ref":"#/components/schemas/PaginationInfo"}}},"PaginationInfo":{"type":"object","description":"Pagination metadata returned by GET /dev/v1/rule (list rules)","properties":{"perPage":{"type":"integer","description":"Page size (items per page)"},"totalPage":{"type":"integer","description":"Total number of pages"},"currentPage":{"type":"integer","description":"Current page index"},"totalRecord":{"type":"integer","description":"Total records across all pages"}}}}},"paths":{"/dev/v1/rule/{entity-id}/schedule":{"post":{"operationId":"createOrUpdateSchedule","tags":["Rule"],"summary":"Create or update schedule","description":"Create or update a schedule for a rule. Only rules support scheduling.","parameters":[{"name":"Nected-Branch","in":"header","required":false,"description":"Branch name (optional)","schema":{"type":"string"}},{"name":"entity-id","in":"path","required":true,"schema":{"type":"string"},"description":"The rule's entity ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRequest"}}}},"responses":{"200":{"description":"OK (illustrative)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}}}}}}}
```
