# Run Flow

## Get Run From Id

> Gets the logged metadata of a run.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/inference/v0/run/{org_id}/{flow_id}/metadata":{"get":{"tags":["Run Flow"],"summary":"Get Run From Id","description":"Gets the logged metadata of a run.","operationId":"get_run_from_id_inference_v0_run__org_id___flow_id__metadata_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","title":"Flow Id"},"description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id)."},{"name":"run_id","in":"query","required":false,"schema":{"type":"string","description":"Run ID of the flow","title":"Run Id"},"description":"Run ID of the flow"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Run From Id Inference V0 Run  Org Id   Flow Id  Metadata Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Run Deployed Flow

> Run a flow and get the result.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/inference/v0/run/{org_id}/{flow_id}":{"post":{"tags":["Run Flow"],"summary":"Run Deployed Flow","description":"Run a flow and get the result.","operationId":"run_deployed_flow_inference_v0_run__org_id___flow_id__post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","title":"Flow Id"},"description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id)."},{"name":"version","in":"query","required":false,"schema":{"type":"integer","description":"Version of the flow","default":-1,"title":"Version"},"description":"Version of the flow"},{"name":"verbose","in":"query","required":false,"schema":{"type":"boolean","description":"Return the full model","default":true,"title":"Verbose"},"description":"Return the full model"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Input parameters for the flow","title":"Inputs"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Stream Deployed Flow

> Run a flow and get the result streamed while the flow is running.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/inference/v0/stream/{org_id}/{flow_id}":{"post":{"tags":["Run Flow"],"summary":"Stream Deployed Flow","description":"Run a flow and get the result streamed while the flow is running.","operationId":"stream_deployed_flow_inference_v0_stream__org_id___flow_id__post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","title":"Flow Id"},"description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id)."},{"name":"version","in":"query","required":false,"schema":{"type":"integer","description":"Version of the flow. -1 for the latest published version.","default":-1,"title":"Version"},"description":"Version of the flow. -1 for the latest published version."},{"name":"prefix","in":"query","required":false,"schema":{"type":"boolean","description":"Add a prefix to the output","default":false,"title":"Prefix"},"description":"Add a prefix to the output"},{"name":"delta","in":"query","required":false,"schema":{"type":"boolean","description":"Stream deltas instead of full output","default":true,"title":"Delta"},"description":"Stream deltas instead of full output"},{"name":"sse","in":"query","required":false,"schema":{"type":"boolean","description":"Use server sent events instead of streaming response","default":false,"title":"Sse"},"description":"Use server sent events instead of streaming response"},{"name":"verbose","in":"query","required":false,"schema":{"type":"boolean","description":"Return the full model","default":true,"title":"Verbose"},"description":"Return the full model"},{"name":"run_draft","in":"query","required":false,"schema":{"type":"boolean","description":"Run the draft version of the flow instead of the published one.","default":false,"title":"Run Draft"},"description":"Run the draft version of the flow instead of the published one."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Input parameters for the flow","title":"Inputs"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Stream Deployed Flow With Sso

> Run a flow and get the result streamed while the flow is running.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/inference/v0/sso/stream/{org_id}/{flow_id}":{"post":{"tags":["Run Flow"],"summary":"Stream Deployed Flow With Sso","description":"Run a flow and get the result streamed while the flow is running.","operationId":"stream_deployed_flow_with_sso_inference_v0_sso_stream__org_id___flow_id__post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}},{"name":"version","in":"query","required":false,"schema":{"type":"integer","description":"Version of the flow. -1 for the latest published version.","default":-1,"title":"Version"},"description":"Version of the flow. -1 for the latest published version."},{"name":"prefix","in":"query","required":false,"schema":{"type":"boolean","description":"Add a prefix to the output","default":false,"title":"Prefix"},"description":"Add a prefix to the output"},{"name":"delta","in":"query","required":false,"schema":{"type":"boolean","description":"Stream deltas instead of full output","default":true,"title":"Delta"},"description":"Stream deltas instead of full output"},{"name":"sse","in":"query","required":false,"schema":{"type":"boolean","description":"Use server sent events instead of streaming response","default":false,"title":"Sse"},"description":"Use server sent events instead of streaming response"},{"name":"verbose","in":"query","required":false,"schema":{"type":"boolean","description":"Return the full model","default":true,"title":"Verbose"},"description":"Return the full model"},{"name":"run_draft","in":"query","required":false,"schema":{"type":"boolean","description":"Run the draft version of the flow instead of the published one.","default":false,"title":"Run Draft"},"description":"Run the draft version of the flow instead of the published one."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"description":"Input parameters for the flow","title":"Inputs"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Give Feedback

> Send a feedback message for a given run.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"servers":[{"url":"https://api.stack-ai.com","description":"StackAI API Server"}],"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"schemas":{"FeedbackAPIParams":{"properties":{"run_id":{"type":"string","title":"Run Id"},"feedback":{"type":"string","title":"Feedback"}},"type":"object","required":["run_id","feedback"],"title":"FeedbackAPIParams"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/inference/v0/feedback/{org_id}/{flow_id}":{"post":{"tags":["Run Flow"],"summary":"Give Feedback","description":"Send a feedback message for a given run.","operationId":"give_feedback_inference_v0_feedback__org_id___flow_id__post","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id).","title":"Flow Id"},"description":"The flow ID. [Learn how to get it](/docs/api-reference/how-to-get-flow-id)."},{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackAPIParams","description":"Input parameters: feedback, inputs, outputs"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Give Feedback Inference V0 Feedback  Org Id   Flow Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
