> 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/rest-api-v2/runs/get-v2-runs.md).

# GET /v2/runs

## List Runs

> List runs in accessible projects newest first.\
> \
> \*\*How to use\*\*\
> \
> Use this for run history or reconciliation. Follow next\_cursor with unchanged filters. created\_by\_id is the exact returned actor ID; personal-key runs use the owner ID. Status filters use lowercase v2 values.\
> \
> \*\*Authentication and permissions\*\*\
> \
> Required permissions: \`analytics.read\`. Resource and owner access checks also apply.

```json
{"openapi":"3.1.0","info":{"title":"StackAI API","version":"0.1.0"},"tags":[{"name":"endpoint-listRunsV2"}],"servers":[{"url":"https://api.stack-ai.com","description":"Hosted API. Use your deployment-specific origin for private installations."}],"security":[{"HTTPBearer":[]}],"components":{"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer","description":"Personal API key (sk_...) or supported user access JWT. See Authentication and authorization for endpoint restrictions and scopes. Use exactly one Authorization header."}},"schemas":{"RunStatusV2":{"type":"string","enum":["queued","running","paused","succeeded","failed","cancelled"],"title":"RunStatusV2","description":"Lifecycle status exposed by the Runs v2 API."},"RunTypeV2":{"type":"string","enum":["workflow_builder","form","batch","chat_assistant","agent_assistant","trigger","scheduled","sub_workflow","api","eval","unknown"],"title":"RunTypeV2","description":"How the run was started. Unrecognized types appear as `unknown`."},"CursorPaginatedResponse_RunSummaryResponseV2_":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"data":{"items":{"$ref":"#/components/schemas/RunSummaryResponseV2"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"prev_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Cursor"},"current_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Cursor"}},"type":"object","title":"CursorPaginatedResponse[RunSummaryResponseV2]"},"RunSummaryResponseV2":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"ID of the run."},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project the run executed. Null for legacy runs."},"project_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Version","description":"Project version used for this run: -1 for a draft execution, a non-negative integer for a numbered version, or null when the version could not be determined."},"status":{"$ref":"#/components/schemas/RunStatusV2","description":"Lifecycle status of the run."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Failure message. Null when the run did not fail."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was recorded."},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When execution started. Null when unknown or not yet started."},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When execution finished. Null when unknown or not yet finished."},"run_type":{"anyOf":[{"$ref":"#/components/schemas/RunTypeV2"},{"type":"null"}],"description":"How the run was started. Null when not recorded."},"created_by":{"anyOf":[{"$ref":"#/components/schemas/RunCreatedByV2"},{"type":"null"}],"description":"Principal that started the run. Null when not recorded."},"usage":{"$ref":"#/components/schemas/RunUsageV2","description":"Token usage for the run."},"parent_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Run Id","description":"Run that started this one. Null unless this is a sub-workflow run."},"parent_project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Project Id","description":"Project of the parent run. Null unless this is a sub-workflow run."}},"additionalProperties":false,"type":"object","required":["run_id","project_id","status","error","created_at","started_at","completed_at","run_type","created_by","usage","parent_run_id","parent_project_id"],"title":"RunSummaryResponse","description":"A list row without its unbounded input, output, or citations."},"RunCreatedByV2":{"properties":{"type":{"$ref":"#/components/schemas/RunCreatedByTypeV2","description":"Kind of principal that started the run."},"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"ID of the principal identified by `type`: the user ID for `user` and `personal_api_key`, the organization ID for `org_api_key`, the end-user ID for `end_user`. Null if no ID is available."}},"additionalProperties":false,"type":"object","required":["type","id"],"title":"RunCreatedBy","description":"Who or what started the run."},"RunCreatedByTypeV2":{"type":"string","enum":["user","personal_api_key","org_api_key","system","end_user","unknown"],"title":"RunCreatedByTypeV2","description":"Type of user, API key, or system that started the run."},"RunUsageV2":{"properties":{"total_tokens":{"type":"integer","title":"Total Tokens","description":"Tokens used across every model call in the run."},"details":{"items":{"$ref":"#/components/schemas/RunUsageDetailV2"},"type":"array","title":"Details","description":"Usage aggregated per model and connection; models may appear more than once."}},"additionalProperties":false,"type":"object","required":["total_tokens","details"],"title":"RunUsage","description":"Total and per-model token usage for a run."},"RunUsageDetailV2":{"properties":{"provider":{"type":"string","title":"Provider","description":"Stable lowercase identifier of the model provider, e.g. `openai`."},"model_id":{"type":"string","title":"Model Id","description":"Identifier of the model the provider was called with."},"connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Connection Id","description":"ID of the connection used for the model calls. Null if no connection ID is available."},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens","description":"Tokens sent to the model. Null when the provider reported only a total."},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens","description":"Tokens returned by the model. Null when the provider reported only a total."}},"additionalProperties":false,"type":"object","required":["provider","model_id","connection_id","input_tokens","output_tokens"],"title":"RunUsageDetail","description":"Token usage for one provider, model, and connection."},"StackAIAPIErrorResponse":{"properties":{"response_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Code","description":"Machine-readable response code, when provided."},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata","default":{}},"errors":{"items":{"$ref":"#/components/schemas/StackAIAPIError"},"type":"array","title":"Errors","description":"List of errors"},"detail":{"items":{"type":"string"},"type":"array","title":"Detail","description":"Human-readable error messages. Use the HTTP status and error metadata to decide how to handle the failure.","readOnly":true}},"type":"object","required":["detail"],"title":"StackAIAPIErrorResponse","description":"Error response model with status code and error list."},"StackAIAPIError":{"properties":{"message":{"type":"string","title":"Message","description":"Message describing the error"}},"type":"object","required":["message"],"title":"StackAIAPIError","description":"Error detail model."},"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":{"/v2/runs":{"get":{"tags":["endpoint-listRunsV2"],"summary":"List Runs","description":"List runs in accessible projects newest first.\n\n**How to use**\n\nUse this for run history or reconciliation. Follow next_cursor with unchanged filters. created_by_id is the exact returned actor ID; personal-key runs use the owner ID. Status filters use lowercase v2 values.\n\n**Authentication and permissions**\n\nRequired permissions: `analytics.read`. Resource and owner access checks also apply.","operationId":"listRunsV2","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"project_id","description":"Only return runs of this project."},"description":"Only return runs of this project."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunStatusV2"},{"type":"null"}],"title":"status","description":"Only return runs currently in this status."},"description":"Only return runs currently in this status."},{"name":"run_type","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/RunTypeV2"},{"type":"null"}],"title":"run_type","description":"Only return runs started this way. `unknown` is not filterable because it represents an unpublished value."},"description":"Only return runs started this way. `unknown` is not filterable because it represents an unpublished value."},{"name":"created_by_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"created_by_id","description":"Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner's user ID."},"description":"Filter by the exact created_by.id returned on a run: a user ID, organization ID, or end-user ID. Personal API-key runs use the owner's user ID."},{"name":"created_at__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"created_at__gte","description":"Only return runs created at or after this time."},"description":"Only return runs created at or after this time."},{"name":"created_at__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"created_at__lte","description":"Only return runs created at or before this time."},"description":"Only return runs created at or before this time."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque identifier for the page to return, taken from a previous response's `next_cursor`. Omit it to read the first page.","title":"Cursor"},"description":"Opaque identifier for the page to return, taken from a previous response's `next_cursor`. Omit it to read the first page."},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of runs to return in the page.","default":50,"title":"Page Size"},"description":"Number of runs to return in the page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CursorPaginatedResponse_RunSummaryResponseV2_"}}}},"400":{"description":"Invalid cursor or filter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"403":{"description":"Analytics read permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StackAIAPIErrorResponse"}}}},"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/rest-api-v2/runs/get-v2-runs.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.
