{"openapi":"3.0.1","info":{"title":"YepCode REST API","termsOfService":"https://yepcode.io/terms-of-use","contact":{"email":"apiteam@yepcode.io"},"version":"1.0"},"servers":[{"url":"https://cloud.yepcode.io/api/{team}/rest","variables":{"team":{"description":"YepCode Team Id (the same at https://cloud.yepcode.io/{team})","default":"your-team-id"}}}],"security":[{"oauth2":["executor"]}],"paths":{"/schedules/{id}/resume":{"put":{"tags":["Schedules"],"summary":"Resume scheduled process","operationId":"resumeSchedule","parameters":[{"name":"id","in":"path","description":"Scheduled process id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation"},"404":{"description":"Scheduled process not found"},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/schedules/{id}/pause":{"put":{"tags":["Schedules"],"summary":"Pause scheduled process","operationId":"pauseSchedule","parameters":[{"name":"id","in":"path","description":"Scheduled process id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation"},"404":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/executions/{id}/kill":{"put":{"tags":["Executions"],"summary":"Kill execution","operationId":"killExecution","parameters":[{"name":"id","in":"path","description":"Execution id","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Execution not found"},"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/processes/{processIdOrSlug}/execute":{"post":{"tags":["Processes"],"summary":"Execute a process asynchronously","operationId":"executeProcessAsync","parameters":[{"name":"processIdOrSlug","in":"path","description":"Process id or slug","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Execute process input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteProcessInput"}}},"required":true},"responses":{"404":{"description":"Process not found"},"202":{"description":"Accepted","headers":{"Yep-Execution-ID":{"description":"Execution ID","style":"simple","schema":{"type":"string"}},"Location":{"description":"URL to check the status of the execution","style":"simple","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionId"}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/processes/{processIdOrSlug}/execute-sync":{"post":{"tags":["Processes"],"summary":"Execute a process synchronously","operationId":"executeProcessSync","parameters":[{"name":"processIdOrSlug","in":"path","description":"Process id or slug","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Execute process input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteProcessInput"}}},"required":true},"responses":{"404":{"description":"Process not found"},"203":{"description":"successful operation","headers":{"Yep-Execution-ID":{"description":"Execution ID","style":"simple","schema":{"type":"string"}}},"content":{"application/json":{}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/processes/{id}/schedule":{"post":{"tags":["Processes"],"summary":"Schedule a process","operationId":"createSchedule","parameters":[{"name":"id","in":"path","description":"Process id","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"Schedule input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledProcessInput"}}},"required":true},"responses":{"404":{"description":"Scheduled process not found"},"400":{"description":"Bad Request"},"201":{"description":"Created","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Schedule"}}}},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/executions/{id}/rerun":{"post":{"tags":["Executions"],"summary":"Rerun execution","operationId":"rerunExecution","parameters":[{"name":"id","in":"path","description":"Execution id","required":true,"schema":{"type":"string"}}],"responses":{"404":{"description":"Execution not found"},"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/schedules":{"get":{"tags":["Schedules"],"summary":"Get scheduled processes","operationId":"getSchedules","parameters":[{"name":"page","in":"query","description":"Page number","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","description":"Amount of items to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}},{"name":"processId","in":"query","description":"Process filter: process id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulesPaginatedResult"}}}}},"security":[{"oauth2":["executor"]}]}},"/processes":{"get":{"tags":["Processes"],"summary":"Get processes","operationId":"getProcesses","parameters":[{"name":"keywords","in":"query","description":"Keywords filter: applies to process name or description","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","description":"Amount of items to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessesPaginatedResult"}}}},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/executions":{"get":{"tags":["Executions"],"summary":"Get executions","operationId":"getExecutions","parameters":[{"name":"keywords","in":"query","description":"Keywords filter: applies to process name or execution comment","required":false,"schema":{"type":"string"}},{"name":"processId","in":"query","description":"Process filter: process id","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Status filter","required":false,"schema":{"type":"string","enum":["CREATED","RUNNING","FINISHED","KILLED","REJECTED","ERROR"]}},{"name":"from","in":"query","description":"From filter","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"To filter","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"page","in":"query","description":"Page number","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","description":"Amount of items to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionsPaginatedResult"}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/executions/{id}":{"get":{"tags":["Executions"],"summary":"Get execution","operationId":"getExecution","parameters":[{"name":"id","in":"path","description":"Execution id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"404":{"description":"Execution not found"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/executions/{id}/logs":{"get":{"tags":["Executions"],"summary":"Get execution logs","operationId":"getExecutionLogs","parameters":[{"name":"id","in":"path","description":"Execution id","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"Page number","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"limit","in":"query","description":"Amount of items to retrieve","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionLogsPaginatedResult"}}}},"400":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}},"/schedules/{id}":{"delete":{"tags":["Schedules"],"summary":"Delete scheduled process","operationId":"deleteSchedule","parameters":[{"name":"id","in":"path","description":"Scheduled process id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successful operation"},"404":{"description":"Bad Request"},"401":{"description":"Unauthorized"}},"security":[{"oauth2":["executor"]}]}}},"components":{"schemas":{"ExecuteProcessInput":{"type":"object","properties":{"parameters":{"type":"string","example":"{\"name\":\"YepCode\"}"},"tag":{"type":"string","description":"A version tag or an alias of the version","example":"[\"v1.0.0\",\"production\"]"},"comment":{"type":"string","example":"YepCode execution test"},"settings":{"$ref":"#/components/schemas/ExecuteProcessSettingsInput"}}},"ExecuteProcessSettingsInput":{"type":"object","properties":{"agentPoolSlug":{"type":"string","description":"Agent pool where to execute","example":"aws-eu-west-1"}}},"ExecutionId":{"type":"object","properties":{"executionId":{"type":"string"}},"description":"Execution ID"},"ScheduledProcessInput":{"type":"object","properties":{"cron":{"type":"string","example":"0 0 6 * * SUN"},"dateTime":{"type":"string","format":"date-time"},"allowConcurrentExecutions":{"type":"boolean","example":true},"input":{"$ref":"#/components/schemas/ExecuteProcessInput"}}},"Schedule":{"type":"object","properties":{"id":{"type":"string","example":"138f7d70-7d13-430f-9f15-a66de3ce1852"},"createdBy":{"type":"string","example":"jane-doe"},"createdAt":{"type":"string","format":"date-time"},"processId":{"type":"string","example":"a4f0c6fd-0da8-4769-8ebb-6c0c030fdfb8"},"comment":{"type":"string","example":"Daily execution"},"parameters":{"type":"object","additionalProperties":{"type":"object","example":{"message":"Hello YepCode!"}},"example":{"message":"Hello YepCode!"}},"paused":{"type":"boolean","example":false},"type":{"type":"string","enum":["PERIODIC","ONE_TIME"]},"cron":{"type":"string","example":"0 0 6 * * SUN"},"dateTime":{"type":"string","format":"date-time"},"settings":{"$ref":"#/components/schemas/ScheduleSettings"}}},"ScheduleSettings":{"type":"object","properties":{"allowConcurrentExecutions":{"type":"boolean"},"agentPoolSlugs":{"type":"array","example":["aws-eu-west-1","azure-us-east-1"],"items":{"type":"string","example":"[\"aws-eu-west-1\",\"azure-us-east-1\"]"}}}},"SchedulesPaginatedResult":{"type":"object","properties":{"hasNextPage":{"type":"boolean","example":false},"page":{"type":"integer","format":"int32","example":0},"limit":{"type":"integer","format":"int32","example":10},"total":{"type":"integer","format":"int64","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/Schedule"}}}},"Process":{"type":"object","properties":{"id":{"type":"string","example":"a4f0c6fd-0da8-4769-8ebb-6c0c030fdfb8"},"name":{"type":"string","example":"Hello World!"},"slug":{"type":"string","example":"hello-world"},"description":{"type":"string","example":"A sample process to show how YepCode works"},"createdBy":{"type":"string","example":"jane-doe"},"createdAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string","example":"jane-doe"},"updatedAt":{"type":"string","format":"date-time"},"parametersSchema":{"type":"object","additionalProperties":{"type":"object","example":{"name":{"type":"string"}}},"example":{"name":{"type":"string"}}},"programmingLanguage":{"type":"string","enum":["JAVASCRIPT","PYTHON"]},"sourceCode":{"type":"string","example":"const {\\n  context: { parameters },\\n} = yepcode;\\n\\nconst message = `Hello ${parameters.name}`\\n\\nconsole.log(message);\\n\\nreturn {\\n  theMessage: message\\n}"}}},"ProcessesPaginatedResult":{"type":"object","properties":{"hasNextPage":{"type":"boolean","example":false},"page":{"type":"integer","format":"int32","example":0},"limit":{"type":"integer","format":"int32","example":10},"total":{"type":"integer","format":"int64","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/Process"}}}},"Execution":{"type":"object","properties":{"id":{"type":"string","example":"138f7d70-7d13-430f-9f15-a66de3ce1892"},"processId":{"type":"string","example":"a4f0c6fd-0da8-4769-8ebb-6c0c030fdfb8"},"scheduledId":{"type":"string","example":"74c679c4-4df8-4a9c-9d06-4d62ab69ed49"},"status":{"type":"string","enum":["CREATED","RUNNING","FINISHED","KILLED","REJECTED","ERROR"]},"timeline":{"$ref":"#/components/schemas/ExecutionTimeline"},"parameters":{"type":"object","additionalProperties":{"type":"object","example":{"name":"YepCode"}},"example":{"name":"YepCode"}},"createdBy":{"type":"string","example":"jane-doe"},"createdAt":{"type":"string","format":"date-time"},"comment":{"type":"string","example":"Say hello to YepCode"},"returnValue":{"type":"string","example":"Hello YepCode!"},"settings":{"$ref":"#/components/schemas/ExecutionSettings"}}},"ExecutionSettings":{"type":"object","properties":{"timeout":{"type":"integer","description":"Timeout in milliseconds","format":"int64","example":10000},"agentPoolSlug":{"type":"string","description":"Agent pool where the execution was executed","example":"aws-eu-west-1"}}},"ExecutionTimeline":{"type":"object","properties":{"explanation":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/ExecutionTimelineEvent"}}}},"ExecutionTimelineEvent":{"type":"object","properties":{"status":{"type":"string","enum":["CREATED","RUNNING","FINISHED","KILLED","REJECTED","ERROR"]},"timestamp":{"type":"string","format":"date-time"}}},"ExecutionsPaginatedResult":{"type":"object","properties":{"hasNextPage":{"type":"boolean","example":false},"page":{"type":"integer","format":"int32","example":0},"limit":{"type":"integer","format":"int32","example":10},"total":{"type":"integer","format":"int64","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/Execution"}}}},"ExecutionLogsPaginatedResult":{"type":"object","properties":{"hasNextPage":{"type":"boolean","example":false},"page":{"type":"integer","format":"int32","example":0},"limit":{"type":"integer","format":"int32","example":10},"total":{"type":"integer","format":"int64","example":1},"data":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}}}},"LogEntry":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"level":{"type":"string","example":"INFO"},"message":{"type":"string","example":"Hello YepCode!"}}}},"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://cloud.yepcode.io/auth/realms/yepcode/protocol/openid-connect/token","scopes":{}}}}}}}