> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-api/legacy-inference-and-analytics/analytics/get-analytics-org-org_id-flows-flow_id.md).

# GET /analytics/org/{org\_id}/flows/{flow\_id}

## List Flow Runs

> List flow run logs matching the given filters.\
> \
> \*\*How to use\*\*\
> \
> Use this for existing legacy exports. Read the response as a list. \`page\` starts at 0; dates should include a timezone. \`state\` uses uppercase legacy states and may contain comma-separated values. Use a personal key or legacy private organization key, not the legacy public key.\
> \
> \*\*Authentication and permissions\*\*\
> \
> Authentication: personal API key or supported legacy private organization key in the Bearer header. This legacy route does not declare a separate endpoint permission scope in the checked contract.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"tags":[{"name":"endpoint-getAnalyticsDataApi"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations."}],"security":[{"LegacyAPIKeyBearer":[]}],"components":{"securitySchemes":{"LegacyAPIKeyBearer":{"type":"http","scheme":"bearer","description":"Personal API key or the endpoint-specific legacy organization API key. Legacy inference uses the public organization key; legacy analytics uses the private organization key. This is not a password-grant login flow."}},"schemas":{"ProjectRunSummary":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"date":{"type":"string","format":"date-time","title":"Date"},"is_flow_successful":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Flow Successful"},"state":{"anyOf":[{"$ref":"#/components/schemas/WorkflowState"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"latency":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency"},"total_tokens":{"type":"integer","title":"Total Tokens"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"inputs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inputs"},"outputs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outputs"},"llms":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llms"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"cache_metrics":{"anyOf":[{"$ref":"#/components/schemas/CacheMetrics"},{"type":"null"}]},"llm_usage":{"items":{"$ref":"#/components/schemas/LLMUsageData"},"type":"array","title":"Llm Usage"},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunType"},{"type":"null"}],"description":"How the run was initiated."},"ran_by_type":{"anyOf":[{"$ref":"#/components/schemas/RanByType"},{"type":"null"}],"description":"Who authenticated the run."},"ran_by_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ran By Id","description":"Principal the run is attributed to: profiles.id for user and personal_api_key (the key owner), organizations.org_id for org_api_key, end_users.id for end_user. NULL for system runs and legacy rows."},"ran_by_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ran By Display Name","description":"Display name of the principal: the profile email for user and personal_api_key runs, the organization name for org_api_key runs."},"project_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version Id","description":"Project version that executed the run. Non-positive values mean the draft."},"base_version_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Version Id","description":"For draft runs, the project's published version at run time. Lets the UI label a draft against the version it was based on (e.g. 'Draft (v3)')."},"deployment_stage":{"anyOf":[{"$ref":"#/components/schemas/DeploymentStage"},{"type":"null"}],"description":"Stage the run executed against (draft/development/staging/production). Lets the UI tell a preview run (draft) from a deployed run for form and batch runs, which otherwise share the same project_version_id sentinel."},"parent_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Run Id","description":"Run ID of the parent workflow for sub-workflow runs."},"parent_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Id","description":"Project ID of the parent workflow for sub-workflow runs."},"parent_project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Name","description":"Name of the parent project for sub-workflow runs."}},"type":"object","required":["run_id","date","is_flow_successful","state","error","latency","total_tokens","user_id","inputs","outputs","llms","feedback"],"title":"ProjectRunSummary","description":"Summary of a single workflow run."},"WorkflowState":{"type":"string","enum":["PENDING","RUNNING","PAUSED","RESUMED","COMPLETED","FAILED","CANCELLED"],"title":"WorkflowState","description":"Enum representing the possible states of a workflow."},"CacheMetrics":{"properties":{"read_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Read Input Tokens"},"observed_input_tokens":{"type":"integer","minimum":0,"title":"Observed Input Tokens","default":0},"known_input_tokens":{"type":"integer","minimum":0,"title":"Known Input Tokens","default":0},"missing_input_usage_records":{"type":"integer","minimum":0,"title":"Missing Input Usage Records","default":0},"cached_input_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Input Percent","description":"Return cache-read share for precisely the measured subset.","readOnly":true},"input_coverage_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Coverage Percent","description":"Return observed share of recorded input, not provider-attempt coverage.","readOnly":true}},"type":"object","required":["cached_input_percent","input_coverage_percent"],"title":"CacheMetrics","description":"Weighted cache reads over measured input, including writes but excluding output."},"LLMUsageData":{"properties":{"cache_metrics":{"anyOf":[{"$ref":"#/components/schemas/CacheMetrics"},{"type":"null"}]},"provider":{"$ref":"#/components/schemas/LLMProviderEnum"},"model_id":{"type":"string","title":"Model Id"},"tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Tokens"},"input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Input Tokens","description":"Total prompt tokens processed, INCLUDING any prompt-cache writes and reads (Anthropic reports those outside its raw input counter; they are folded back in before this record is built)."},"output_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Output Tokens"},"cache_creation_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cache Creation Input Tokens","description":"Subset of input_tokens written to the provider prompt cache this call. Kept separate so billing can later discount cache traffic (writes bill at a premium, reads at a fraction). None when the provider reported no cache counters."},"cache_read_input_tokens":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Cache Read Input Tokens","description":"Subset of input_tokens served from the provider prompt cache this call. None when the provider reported no cache counters."},"cache_measurement":{"anyOf":[{"$ref":"#/components/schemas/CacheMeasurement"},{"type":"null"}]},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id"},"connection_origin":{"anyOf":[{"$ref":"#/components/schemas/LLMConnectionOrigin"},{"type":"null"}]},"is_local_model":{"type":"boolean","title":"Is Local Model","description":"Whether this usage record is from a local model.","readOnly":true},"should_charge":{"type":"boolean","title":"Should Charge","description":"Whether this usage record should be charged.","readOnly":true}},"type":"object","required":["provider","model_id","is_local_model","should_charge"],"title":"LLMUsageData","description":"Token usage for a single LLM call within a run."},"LLMProviderEnum":{"type":"string","enum":["Anthropic","Azure","Baseten","Bedrock","Cerebras","Core42","FireworksAI","Google","Google_service_account","Groq","Local","Meta","Mistral","Modular","OpenAI","OpenRouter","Perplexity","Replicate","TogetherAI","XAI"],"title":"LLMProviderEnum","description":"LLM provider identifiers."},"CacheMeasurement":{"properties":{"version":{"type":"integer","const":1,"title":"Version","default":1},"read_input_tokens":{"type":"integer","minimum":0,"title":"Read Input Tokens"},"observed_input_tokens":{"type":"integer","minimum":0,"title":"Observed Input Tokens"}},"type":"object","required":["read_input_tokens","observed_input_tokens"],"title":"CacheMeasurement","description":"A measured subset of provider input, excluding unobserved calls."},"LLMConnectionOrigin":{"type":"string","enum":["stack_ai","external_db","external_ephemeral"],"title":"LLMConnectionOrigin"},"RunType":{"type":"string","enum":["workflow_builder","form","batch","chat_assistant","agent_assistant","trigger","scheduled","sub_workflow","api","eval"],"title":"RunType","description":"How a workflow run was initiated."},"RanByType":{"type":"string","enum":["user","personal_api_key","org_api_key","system","end_user"],"title":"RanByType","description":"Who or what authenticated the run."},"DeploymentStage":{"type":"string","enum":["draft","development","staging","production"],"title":"DeploymentStage","description":"Stages a workflow passes through before production."},"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":{"/analytics/org/{org_id}/flows/{flow_id}":{"get":{"tags":["endpoint-getAnalyticsDataApi"],"summary":"List Flow Runs","description":"List flow run logs matching the given filters.\n\n**How to use**\n\nUse this for existing legacy exports. Read the response as a list. `page` starts at 0; dates should include a timezone. `state` uses uppercase legacy states and may contain comma-separated values. Use a personal key or legacy private organization key, not the legacy public key.\n\n**Authentication and permissions**\n\nAuthentication: personal API key or supported legacy private organization key in the Bearer header. This legacy route does not declare a separate endpoint permission scope in the checked contract.","operationId":"getAnalyticsDataApi","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"string","title":"Flow Id"}},{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":25,"title":"Page Size"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED","title":"State"},"description":"Comma-separated list of statuses to filter by. Accepted values: PENDING, RUNNING, PAUSED, RESUMED, COMPLETED, FAILED, CANCELLED"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectRunSummary"},"title":"Response Getanalyticsdataapi"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-api/legacy-inference-and-analytics/analytics/get-analytics-org-org_id-flows-flow_id.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
