{"openapi":"3.1.0","info":{"title":"RunLater API","version":"1.0.0","description":"Send HTTP requests to public URLs at an exact time or on a cron schedule, with retries and a log of every run. Creating or running a schedule needs a plan; every plan starts with a 14-day trial.","contact":{"email":"hello@greatwork.company","url":"https://runlater.app/docs/api"}},"servers":[{"url":"https://runlater.app/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/account":{"get":{"operationId":"getAccount","summary":"Plan, trial end date, limits and usage this month","responses":{"200":{"description":"Account status","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules":{"get":{"operationId":"listSchedules","summary":"List scheduled requests, newest first","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["all","scheduled","paused","finished"],"default":"all"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"Schedules","content":{"application/json":{"schema":{"type":"object","properties":{"schedules":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}},"total":{"type":"integer"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSchedule","summary":"Schedule a request, once with run_at or repeatedly with cron","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleInput"}}}},"responses":{"201":{"description":"The schedule","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"no_plan: start the 14-day trial first. Also run_limit_reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"get":{"operationId":"getSchedule","summary":"One schedule with its recent runs","parameters":[{"name":"runs","in":"query","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Schedule and recent runs","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"},"recent_runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteSchedule","summary":"Delete a schedule for good","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"id":{"type":"string"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}/pause":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"post":{"operationId":"pauseSchedule","summary":"Stop a schedule until resumed","responses":{"200":{"description":"The schedule","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}/resume":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"post":{"operationId":"resumeSchedule","summary":"Resume a paused schedule","responses":{"200":{"description":"The schedule","content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/Schedule"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}/run":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"post":{"operationId":"runSchedule","summary":"Send the request once now, without retries","responses":{"200":{"description":"The run and the schedule","content":{"application/json":{"schema":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/Run"},"schedule":{"$ref":"#/components/schemas/Schedule"}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"no_plan: start the 14-day trial first. Also run_limit_reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedules/{id}/runs":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","maxLength":64}}],"get":{"operationId":"listScheduleRuns","summary":"Runs of one schedule","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["success","failed","retrying","pending"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/runs":{"get":{"operationId":"listRuns","summary":"Recent runs across the workspace","parameters":[{"name":"schedule_id","in":"query","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["success","failed","retrying","pending"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/Run"}}}}}}},"401":{"description":"Missing, wrong or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests for this workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A key starting with rl_sk_, created in Settings"}},"schemas":{"ScheduleInput":{"type":"object","required":["url"],"description":"Send run_at for one request, or cron for a repeating one.","properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"A public URL. Private and local addresses are refused."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"default":"POST"},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":4000}},"body":{"description":"A string, object or array","oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}]},"content_type":{"type":"string","maxLength":200},"name":{"type":"string","maxLength":100},"description":{"type":"string","maxLength":500},"run_at":{"type":"string","format":"date-time"},"cron":{"type":"string","description":"Five fields, at most once a minute","examples":["0 9 * * 1-5"]},"timezone":{"type":"string","default":"UTC","examples":["America/Chicago"]},"retries":{"type":"integer","minimum":0,"maximum":10,"default":3},"retry_delay_seconds":{"type":"integer","minimum":1,"maximum":3600,"default":60},"timeout_seconds":{"type":"integer","minimum":1,"maximum":300,"default":30}}},"Schedule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string","enum":["one_time","recurring"]},"url":{"type":"string"},"method":{"type":"string"},"header_names":{"type":"array","items":{"type":"string"},"description":"Header values are never returned"},"body_bytes":{"type":"integer"},"content_type":{"type":["string","null"]},"run_at":{"type":["string","null"]},"cron":{"type":["string","null"]},"timezone":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","finished"]},"next_run_at":{"type":["string","null"]},"last_run_at":{"type":["string","null"]},"retries":{"type":"integer"},"retry_delay_seconds":{"type":"integer"},"timeout_seconds":{"type":"integer"},"created_at":{"type":"string"}}},"Run":{"type":"object","description":"One attempt. Run history includes id, schedule_id, schedule_name, started_at and attempt; run-now returns only the result fields.","properties":{"id":{"type":"string"},"schedule_id":{"type":"string"},"schedule_name":{"type":["string","null"]},"started_at":{"type":"string"},"attempt":{"type":"integer"},"status":{"type":"string"},"status_code":{"type":["integer","null"]},"duration_ms":{"type":["integer","null"]},"error":{"type":["string","null"]},"response":{"type":["string","null"],"description":"A preview of the response body"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"next_url":{"type":"string"}}}}}}}}