# List workflow runs

```
GET /api/v1/runs
```

<CodeGroup>
```bash cURL
curl --request GET \
  --url '/api/v1/runs' \
  --header 'Authorization: Bearer <token>'
```

```javascript JavaScript
const response = await fetch('/api/v1/runs', {
  method: 'GET',
  headers: {
    "Authorization": "Bearer <token>"
  }
});

const data = await response.json();
```

```python Python
import requests

response = requests.request(
    "GET",
    "/api/v1/runs",
    headers={
      "Authorization": "Bearer <token>"
    },
)

print(response.json())
```

```php PHP
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', '/api/v1/runs', [
    'headers' => [
        'Authorization' => 'Bearer <token>',
    ],
]);

echo $response->getBody();
```

```go Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "/api/v1/runs", nil)
	req.Header.Add("Authorization", "Bearer <token>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, _ := io.ReadAll(res.Body)
	fmt.Println(string(data))
}
```

```ruby Ruby
require "net/http"

uri = URI("/api/v1/runs")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer <token>"

response = http.request(request)
puts response.body
```

```java Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("/api/v1/runs"))
    .header("Authorization", "Bearer <token>")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
```
</CodeGroup>

## Authorization

A bearer token in the `Authorization` header.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | string | No | Opaque cursor returned by the preceding list response. |
| `per_page` | integer | No | Number of records to return.<br /> Default: `25` |
| `status` | string | No | One of: `pending`, `running`, `waiting`, `finished`, `failed`, `canceled` |
| `workflow_id` | string | No |  |

## Responses

<AccordionGroup>
<Accordion title="200 · Runs in the token workspace.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of Run | Yes |  |
| `data[].id` | string | Yes |  |
| `data[].object` | string | Yes |  |
| `data[].workflow_id` | string or null | Yes |  |
| `data[].status` | string | Yes | One of: `pending`, `running`, `waiting`, `finished`, `failed`, `canceled` |
| `data[].current_node_key` | string or null | No |  |
| `data[].output` | any | Yes | Redacted workflow output. |
| `data[].error` | null | Yes |  |
| `data[].execution_ms` | integer or null | No |  |
| `data[].started_at` | string (date-time) or null (date-time) | No |  |
| `data[].finished_at` | string (date-time) or null (date-time) | No |  |
| `data[].created_at` | string (date-time) or null (date-time) | Yes |  |
| `data[].updated_at` | string (date-time) or null (date-time) | Yes |  |
| `meta` | CursorMeta | Yes |  |
| `meta.next_cursor` | string or null | Yes |  |
| `meta.previous_cursor` | string or null | Yes |  |
| `meta.has_more` | boolean | Yes |  |
| `request_id` | string | Yes |  |

```json
{
  "data": [
    {
      "id": "string",
      "object": "run",
      "workflow_id": "string",
      "status": "pending",
      "current_node_key": "string",
      "output": null,
      "error": null,
      "execution_ms": 0,
      "started_at": "2024-01-01T00:00:00Z",
      "finished_at": "2024-01-01T00:00:00Z",
      "created_at": "2024-01-01T00:00:00Z",
      "updated_at": "2024-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "next_cursor": "string",
    "previous_cursor": "string",
    "has_more": true
  },
  "request_id": "string"
}
```
</Accordion>
<Accordion title="401 · The Bearer token is missing, malformed, expired, or revoked.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | Yes |  |
| `error.code` | string | Yes |  |
| `error.message` | string | Yes |  |
| `error.details` | object | No |  |
| `request_id` | string | Yes |  |

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "request_id": "string"
}
```
</Accordion>
<Accordion title="403 · The token lacks the required ability.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | Yes |  |
| `error.code` | string | Yes |  |
| `error.message` | string | Yes |  |
| `error.details` | object | No |  |
| `request_id` | string | Yes |  |

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "request_id": "string"
}
```
</Accordion>
<Accordion title="422 · The request is invalid or the workspace cannot perform the operation.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | Yes |  |
| `error.code` | string | Yes |  |
| `error.message` | string | Yes |  |
| `error.details` | object | No |  |
| `request_id` | string | Yes |  |

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "request_id": "string"
}
```
</Accordion>
<Accordion title="429 · A per-token rate limit was exceeded.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | Yes |  |
| `error.code` | string | Yes |  |
| `error.message` | string | Yes |  |
| `error.details` | object | No |  |
| `request_id` | string | Yes |  |

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "request_id": "string"
}
```
</Accordion>
<Accordion title="503 · The site administrator has disabled the Workspace API.">
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | Yes |  |
| `error.code` | string | Yes |  |
| `error.message` | string | Yes |  |
| `error.details` | object | No |  |
| `request_id` | string | Yes |  |

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "request_id": "string"
}
```
</Accordion>
</AccordionGroup>
