# Executions

An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run.

## Retrieve an execution

> &#x20;Returns the \*\*execution\*\* with the given uuid. You can use this endpoint to check the status of the execution.&#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"execution_uuid":{"name":"execution_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The execution uuid"}},"schemas":{"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/executions/{execution_uuid}":{"get":{"summary":"Retrieve an execution","description":" Returns the **execution** with the given uuid. You can use this endpoint to check the status of the execution. ","tags":["Executions"],"operationId":"getExecution","parameters":[{"$ref":"#/components/parameters/execution_uuid","description":"The execution uuid"}],"responses":{"200":{"description":"Execution found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Execution"}}}},"401":{"description":"Authentication error"}}}}}}
```

## Execute

> &#x20;This endpoint allows you to execute an app. You can use this endpoint to execute an app and get the output of the execution.\
> \
> &#x20;Preconditions: the app must be \*\*published\*\*.\
> \
> \
> \> This endpoint executes the app immediately and returns the result, unless you are at your current capacity, or your app takes more than 10 minutes to run, in which case it will fail.\
> \
> &#x20;If you want to execute an app asynchronously, use the \[async\_execute]\(#/paths/\~1public\_api\~1airops\_apps\~1{app\_uuid}\~1async\_execute/post) endpoint.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/{app_uuid}/execute":{"post":{"summary":"Execute","description":" This endpoint allows you to execute an app. You can use this endpoint to execute an app and get the output of the execution.\n\n Preconditions: the app must be **published**.\n\n\n> This endpoint executes the app immediately and returns the result, unless you are at your current capacity, or your app takes more than 10 minutes to run, in which case it will fail.\n\n If you want to execute an app asynchronously, use the [async_execute](#/paths/~1public_api~1airops_apps~1{app_uuid}~1async_execute/post) endpoint.\n\n ","tags":["Executions"],"operationId":"executeApp","parameters":[{"$ref":"#/components/parameters/app_uuid","description":"The app uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_slug":{"type":"integer","description":"The version of the app (will use the default version if not provided)"},"inputs":{"type":"object","description":"The inputs of the app"}},"required":["inputs"]}}}},"responses":{"200":{"description":"Execution created","content":{"application/json":{"schema":{"type":"object","properties":{"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication error"}}}}}}
```

## Async Execute

> &#x20;This endpoint allows you to execute an app asynchronously. You can use this endpoint to execute an app and get the execution id to check the status of the execution.\
> \
> &#x20;Preconditions: the app must be \*\*published\*\*.\
> \
> \
> \> Executions created through this endpoint will be queued and executed at your workspace's capacity.\
> \
> &#x20;If you want to execute an app immediately, use the \[execute]\(#/paths/\~1public\_api\~1airops\_apps\~1{app\_uuid}\~1execute/post) endpoint.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/{app_uuid}/async_execute":{"post":{"summary":"Async Execute","description":" This endpoint allows you to execute an app asynchronously. You can use this endpoint to execute an app and get the execution id to check the status of the execution.\n\n Preconditions: the app must be **published**.\n\n\n> Executions created through this endpoint will be queued and executed at your workspace's capacity.\n\n If you want to execute an app immediately, use the [execute](#/paths/~1public_api~1airops_apps~1{app_uuid}~1execute/post) endpoint.\n\n ","tags":["Executions"],"operationId":"asyncExecuteApp","parameters":[{"$ref":"#/components/parameters/app_uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_slug":{"type":"integer","description":"The version of the app (will use the default version if not provided)"},"inputs":{"type":"object","description":"The inputs of the app"}},"required":["inputs"]}}}},"responses":{"200":{"description":"Execution created","content":{"application/json":{"schema":{"type":"object","properties":{"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication error"}}}}}}
```

## Execute Workflow Definition

> &#x20;This endpoint allows you to execute a workflow definition. You can use this endpoint to execute a workflow definition and get the execution id to check the status of the execution.\
> \
> &#x20;Preconditions: the app must be \*\*published\*\*.\
> \
> \
> \> This endpoint executes the app immediately and returns the result, unless you are at your current capacity, or your app takes more than 10 minutes to run, in which case it will fail.\
> \
> &#x20;If you want to execute an app asynchronously, use the \[async\_execute\_definition]\(#/paths/\~1public\_api\~1airops\_apps\~1{app\_uuid}\~1async\_execute\_definition/post) endpoint.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"WorkflowStep":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["llm","conditional","app","text","web_scrape","fetch_api","code","iteration"]},"config":{"anyOf":[{"$ref":"#/components/schemas/LLMConfig"},{"$ref":"#/components/schemas/ConditionalConfig"},{"$ref":"#/components/schemas/AppConfig"},{"$ref":"#/components/schemas/TextConfig"},{"$ref":"#/components/schemas/WebScrapeConfig"},{"$ref":"#/components/schemas/FetchAPIConfig"},{"$ref":"#/components/schemas/CodeConfig"},{"$ref":"#/components/schemas/IterationConfig"}]}},"required":["name","type","config"]},"LLMConfig":{"type":"object","properties":{"model":{"type":"string"},"soft_fail":{"type":"boolean"},"config":{"type":"object","properties":{"prompt":{"type":"string","description":"Use `prompt` if the model is gpt-3.5-turbo-instruct. Otherwise, use `messages``."},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","system","assistant"]},"content":{"type":"string"},"id":{"type":"string"},"images":{"type":"array","nullable":true,"items":{"type":"string"}}},"required":["role","content"]}},"request_consistent_results":{"type":"boolean"},"response_format":{"type":"string","nullable":true,"enum":["text","json_object"]},"stream":{"type":"boolean"},"temperature":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string"},"model_source":{"type":"string","enum":["airops"]},"max_tokens":{"type":"integer","nullable":true,"minimum":1},"json_schema":{"type":"object","nullable":true,"properties":{"schema":{"type":"object","properties":{"type":{"type":"object","properties":{"type":{"type":"object"}}}}},"strict":{"type":"boolean"},"name":{"type":"string"}},"required":["schema","strict","name"]}},"required":["prompt","messages","request_consistent_results","response_format","stream","temperature","note","model_source","max_tokens"]}},"required":["model","soft_fail","config"]},"ConditionalConfig":{"type":"object","properties":{"condition":{"type":"string","description":"The condition to evaluate. Must be javascript compatible code."},"if_branch":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}},"else_branch":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["condition","if_branch","else_branch"]},"AppConfig":{"type":"object","properties":{"app_id":{"type":"integer"},"app_version":{"type":"integer","nullable":true},"inputs":{"type":"object"},"soft_fail":{"type":"boolean"}},"required":["app_id","inputs"]},"TextConfig":{"type":"object","properties":{"template":{"type":"string"}},"required":["template"]},"WebScrapeConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"url":{"type":"string"},"max_length":{"type":"integer","nullable":true,"minimum":0},"hard_fail":{"type":"boolean","nullable":true},"render_js":{"type":"boolean","nullable":true},"proxy_type":{"type":"string","enum":["auto","datacenter","residential"]},"output_type":{"type":"string","nullable":true,"enum":["text","html","markdown"]},"timeout":{"type":"integer","nullable":true,"minimum":5000,"maximum":150000},"remove_boilerplate":{"type":"boolean","nullable":true},"optimize_for":{"type":"string","enum":["custom","speed","accuracy"]},"soft_fail":{"type":"boolean","nullable":true},"auto_scroll":{"type":"boolean","nullable":true}},"required":["url"]}}},"FetchAPIConfig":{"type":"object","properties":{"body":{"type":"string","description":"The jsonified body of the request"},"headers":{"type":"string","description":"The jsonified headers of the request"},"method":{"type":"string","enum":["get","post"]},"retries":{"type":"integer","minimum":0,"maximum":3},"url":{"type":"string"},"soft_fail":{"type":"boolean"}},"required":["method","url"]},"CodeConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"language":{"type":"string","enum":["python","javascript"]},"function":{"type":"string"},"soft_fail":{"type":"boolean"},"lambda_function":{"type":"string"}},"required":["language","function"]}}},"IterationConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"iterator":{"type":"string"},"step_function":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["iterator","step_function"]}}},"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/{app_uuid}/execute_definition":{"post":{"summary":"Execute Workflow Definition","description":" This endpoint allows you to execute a workflow definition. You can use this endpoint to execute a workflow definition and get the execution id to check the status of the execution.\n\n Preconditions: the app must be **published**.\n\n\n> This endpoint executes the app immediately and returns the result, unless you are at your current capacity, or your app takes more than 10 minutes to run, in which case it will fail.\n\n If you want to execute an app asynchronously, use the [async_execute_definition](#/paths/~1public_api~1airops_apps~1{app_uuid}~1async_execute_definition/post) endpoint.\n\n ","tags":["Executions"],"operationId":"executeDefinition","parameters":[{"$ref":"#/components/parameters/app_uuid","description":"The app uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"object","description":"The inputs of the workflow"},"inputs_schema":{"type":"array","items":{"type":"object","properties":{"interface":{"type":"string","enum":["long_text","short_text","json","single_select","number"]},"label":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"required":{"type":"boolean"},"group_id":{"type":"string","enum":["no-group"]},"action_id":{"type":"string"},"placeholder":{"type":"string"},"test_value":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}},"required":["interface","label","name","hint","required","group_id","action_id","placeholder","options"]}},"definition":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["inputs","inputs_schema","definition"]}}}},"responses":{"200":{"description":"Execution created","content":{"application/json":{"schema":{"type":"object","properties":{"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication error"}}}}}}
```

## Async Execute Workflow Definition

> &#x20;This endpoint allows you to execute a workflow definition asynchronously. You can use this endpoint to execute a workflow definition and get the execution id to check the status of the execution.\
> \
> &#x20;Preconditions: the app must be \*\*published\*\*.\
> \
> \
> \> Executions created through this endpoint will be queued and executed at your workspace's capacity.\
> \
> &#x20;If you want to execute a workflow definition immediately, use the \[execute\_definition]\(#/paths/\~1public\_api\~1airops\_apps\~1{app\_uuid}\~1execute\_definition/post) endpoint.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"WorkflowStep":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["llm","conditional","app","text","web_scrape","fetch_api","code","iteration"]},"config":{"anyOf":[{"$ref":"#/components/schemas/LLMConfig"},{"$ref":"#/components/schemas/ConditionalConfig"},{"$ref":"#/components/schemas/AppConfig"},{"$ref":"#/components/schemas/TextConfig"},{"$ref":"#/components/schemas/WebScrapeConfig"},{"$ref":"#/components/schemas/FetchAPIConfig"},{"$ref":"#/components/schemas/CodeConfig"},{"$ref":"#/components/schemas/IterationConfig"}]}},"required":["name","type","config"]},"LLMConfig":{"type":"object","properties":{"model":{"type":"string"},"soft_fail":{"type":"boolean"},"config":{"type":"object","properties":{"prompt":{"type":"string","description":"Use `prompt` if the model is gpt-3.5-turbo-instruct. Otherwise, use `messages``."},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["user","system","assistant"]},"content":{"type":"string"},"id":{"type":"string"},"images":{"type":"array","nullable":true,"items":{"type":"string"}}},"required":["role","content"]}},"request_consistent_results":{"type":"boolean"},"response_format":{"type":"string","nullable":true,"enum":["text","json_object"]},"stream":{"type":"boolean"},"temperature":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string"},"model_source":{"type":"string","enum":["airops"]},"max_tokens":{"type":"integer","nullable":true,"minimum":1},"json_schema":{"type":"object","nullable":true,"properties":{"schema":{"type":"object","properties":{"type":{"type":"object","properties":{"type":{"type":"object"}}}}},"strict":{"type":"boolean"},"name":{"type":"string"}},"required":["schema","strict","name"]}},"required":["prompt","messages","request_consistent_results","response_format","stream","temperature","note","model_source","max_tokens"]}},"required":["model","soft_fail","config"]},"ConditionalConfig":{"type":"object","properties":{"condition":{"type":"string","description":"The condition to evaluate. Must be javascript compatible code."},"if_branch":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}},"else_branch":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["condition","if_branch","else_branch"]},"AppConfig":{"type":"object","properties":{"app_id":{"type":"integer"},"app_version":{"type":"integer","nullable":true},"inputs":{"type":"object"},"soft_fail":{"type":"boolean"}},"required":["app_id","inputs"]},"TextConfig":{"type":"object","properties":{"template":{"type":"string"}},"required":["template"]},"WebScrapeConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"url":{"type":"string"},"max_length":{"type":"integer","nullable":true,"minimum":0},"hard_fail":{"type":"boolean","nullable":true},"render_js":{"type":"boolean","nullable":true},"proxy_type":{"type":"string","enum":["auto","datacenter","residential"]},"output_type":{"type":"string","nullable":true,"enum":["text","html","markdown"]},"timeout":{"type":"integer","nullable":true,"minimum":5000,"maximum":150000},"remove_boilerplate":{"type":"boolean","nullable":true},"optimize_for":{"type":"string","enum":["custom","speed","accuracy"]},"soft_fail":{"type":"boolean","nullable":true},"auto_scroll":{"type":"boolean","nullable":true}},"required":["url"]}}},"FetchAPIConfig":{"type":"object","properties":{"body":{"type":"string","description":"The jsonified body of the request"},"headers":{"type":"string","description":"The jsonified headers of the request"},"method":{"type":"string","enum":["get","post"]},"retries":{"type":"integer","minimum":0,"maximum":3},"url":{"type":"string"},"soft_fail":{"type":"boolean"}},"required":["method","url"]},"CodeConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"language":{"type":"string","enum":["python","javascript"]},"function":{"type":"string"},"soft_fail":{"type":"boolean"},"lambda_function":{"type":"string"}},"required":["language","function"]}}},"IterationConfig":{"type":"object","properties":{"config":{"type":"object","properties":{"iterator":{"type":"string"},"step_function":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["iterator","step_function"]}}},"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/{app_uuid}/async_execute_definition":{"post":{"summary":"Async Execute Workflow Definition","description":" This endpoint allows you to execute a workflow definition asynchronously. You can use this endpoint to execute a workflow definition and get the execution id to check the status of the execution.\n\n Preconditions: the app must be **published**.\n\n\n> Executions created through this endpoint will be queued and executed at your workspace's capacity.\n\n If you want to execute a workflow definition immediately, use the [execute_definition](#/paths/~1public_api~1airops_apps~1{app_uuid}~1execute_definition/post) endpoint.\n\n ","tags":["Executions"],"operationId":"asyncExecuteDefinition","parameters":[{"$ref":"#/components/parameters/app_uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"inputs":{"type":"object","description":"The inputs of the workflow"},"inputs_schema":{"type":"array","items":{"type":"object","properties":{"interface":{"type":"string","enum":["long_text","short_text","json","single_select","number"]},"label":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"required":{"type":"boolean"},"group_id":{"type":"string","enum":["no-group"]},"action_id":{"type":"string"},"placeholder":{"type":"string"},"test_value":{"type":"string"},"options":{"type":"array","items":{"type":"string"}}},"required":["interface","label","name","hint","required","group_id","action_id","placeholder","options"]}},"definition":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["inputs","inputs_schema","definition"]}}}},"responses":{"200":{"description":"Execution created","content":{"application/json":{"schema":{"type":"object","properties":{"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication error"}}}}}}
```

## Webhook Async Execute

> &#x20;This endpoint allows you to execute an app asynchronously as a webhook for an external service.\
> \
> &#x20;The payload of the request will be mapped to the first input of your app.\
> \
> &#x20;Preconditions: the app must be \*\*published\*\*.\
> \
> &#x20;More information on how to use this endpoint can be found \[here]\(<https://airops.gitbook.io/docs/execute/advanced/incoming-webhook).&#x20>;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"paths":{"/public_api/airops_apps/{app_uuid}/webhook_async_execute":{"post":{"summary":"Webhook Async Execute","description":" This endpoint allows you to execute an app asynchronously as a webhook for an external service.\n\n The payload of the request will be mapped to the first input of your app.\n\n Preconditions: the app must be **published**.\n\n More information on how to use this endpoint can be found [here](https://airops.gitbook.io/docs/execute/advanced/incoming-webhook). ","tags":["Executions"],"operationId":"WebhookAsyncExecuteApp","parameters":[{"$ref":"#/components/parameters/app_uuid"},{"name":"auth_token","in":"query","required":true,"schema":{"type":"string","description":"Your workspace API key"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"version_slug":{"type":"integer","description":"The version of the app (will use the default version if not provided)"},"inputs":{"type":"object","description":"The inputs of the app"}},"required":["inputs"]}}}},"responses":{"200":{"description":"Execution created","content":{"application/json":{"schema":{"type":"object","properties":{"airops_app_execution":{"$ref":"#/components/schemas/Execution"}}}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Authentication error"}}}}},"components":{"parameters":{"app_uuid":{"name":"app_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The app uuid, you can find the app uuid by going to the App => Integrate"}},"schemas":{"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}}}
```

## Cancel an execution

> &#x20;This endpoint allows you to cancel an execution.\
> \
> &#x20;Preconditions: the execution must be in the \*\*pending\*\* or \*\*running\*\* status.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"execution_uuid":{"name":"execution_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The execution uuid"}}},"paths":{"/public_api/airops_apps/executions/{execution_uuid}/cancel":{"patch":{"summary":"Cancel an execution","description":" This endpoint allows you to cancel an execution.\n\n Preconditions: the execution must be in the **pending** or **running** status.\n\n ","tags":["Executions"],"parameters":[{"$ref":"#/components/parameters/execution_uuid"}],"responses":{"204":{"description":"Execution cancelled"},"401":{"description":"Authentication error"}}}}}}
```

## Retry an execution

> &#x20;This endpoint allows you to retry an execution from the last failed step.\
> \
> &#x20;Preconditions: the execution must be in the \*\*error\*\* status.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"execution_uuid":{"name":"execution_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The execution uuid"}}},"paths":{"/public_api/airops_apps/executions/{execution_uuid}/retry":{"post":{"summary":"Retry an execution","description":" This endpoint allows you to retry an execution from the last failed step.\n\n Preconditions: the execution must be in the **error** status.\n\n ","tags":["Executions"],"parameters":[{"$ref":"#/components/parameters/execution_uuid"}],"responses":{"204":{"description":"Execution retried"},"400":{"description":"Execution is not in error status"},"401":{"description":"Authentication error"}}}}}}
```

## Rate an execution

> &#x20;This endpoint allows you to rate an execution.\
> \
> &#x20;Preconditions: the execution must be in the \*\*success\*\* status.\
> \
> &#x20;

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"parameters":{"execution_uuid":{"name":"execution_uuid","in":"path","required":true,"schema":{"type":"string"},"description":"The execution uuid"}}},"paths":{"/public_api/airops_apps/executions/{execution_uuid}/feedback":{"patch":{"summary":"Rate an execution","description":" This endpoint allows you to rate an execution.\n\n Preconditions: the execution must be in the **success** status.\n\n ","tags":["Executions"],"parameters":[{"$ref":"#/components/parameters/execution_uuid"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"string","enum":["positive","neutral","negative"],"description":"The feedback of the execution"}},"required":["feedback"]}}}},"responses":{"204":{"description":"Feedback sent"},"401":{"description":"Authentication error"}}}}}}
```

## Retrieve all executions for an Airops app

> Returns all the \*\*executions\*\* for a given Airops app. You can use this endpoint to check the status/input/output of all the executions.<br>

```json
{"openapi":"3.0.1","info":{"title":"API V1","version":"v1"},"tags":[{"name":"Executions","description":"An execution is a single run of an app, it contains the inputs, outputs, and status of the run, and can be used to check the status of the run."}],"servers":[{"url":"https://api.airops.com","variables":{"defaultHost":{"default":"api.airops.com"}}}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Execution":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","running","error","success","cancelled","review_needed"]},"airops_apps_version_id":{"type":"integer"},"conversation_id":{"type":"string"},"credits_used":{"type":"integer"},"error_code":{"type":"string"},"error_message":{},"feedback":{"type":"string","enum":["positive","neutral","negative"]},"inputs":{"type":"object"},"output":{"type":"object"},"runtime":{"type":"integer","description":"The time it took to execute the app in seconds"},"source":{"type":"string"},"uuid":{"type":"string","maxLength":36,"minLength":36},"workspace_id":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","createdAt","updatedAt"]}}},"paths":{"/public_api/airops_apps/:airops_app_id/executions":{"get":{"summary":"Retrieve all executions for an Airops app","description":"Returns all the **executions** for a given Airops app. You can use this endpoint to check the status/input/output of all the executions.\n","tags":["Executions"],"parameters":[{"name":"airops_app_id","in":"query","required":true,"description":"The Airops app ID to fetch executions from","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"The cursor value to use for pagination","schema":{"type":"string"}},{"name":"items","in":"query","required":false,"description":"The amount of items to fetch","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Executions found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"The list of executions returned","items":{"$ref":"#/components/schemas/Execution"}},"meta":{"type":"object","description":"Pagination information","properties":{"count":{"type":"integer","description":"Total amount of records in all pages"},"has_more":{"type":"boolean","description":"Whether there are more records to fetch"},"cursor":{"type":"string","description":"Cursor value to use in the next request"}}}}}}}},"401":{"description":"Authentication error"}}}}}}
```
