> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.rightbrain.ai/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rightbrain.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rightbrain.ai/_mcp/server.

# List Project Recent Task Runs By Task

GET https://app.rightbrain.ai/api/v1/org/{org_id}/project/{project_id}/task_run/recent_by_task

List visible tasks in a project with recent visible task runs nested under each task.

This endpoint paginates tasks, not task runs. Each task includes up to `runs_per_task`
recent runs visible to the requesting user, ordered newest first. Tasks with no visible
runs are still included with an empty `recent_runs` array.

Visibility follows the same task-run visibility rules used by the project task-run list:
users may see all runs for some tasks, only their own runs for others, or no runs at all
while still being able to view the task itself.

Reference: https://docs.rightbrain.ai/api-reference/api-reference/tasks/tasks/list-project-recent-task-runs-by-task

## Authentication

- `Authorization` header (bearer token, required) — API key or access token, sent as `Authorization: Bearer <token>`. The simplest option: create an API key in your dashboard under Settings, then paste it here.

## Servers

- `https://app.rightbrain.ai/api/v1` (Production, default)
- `https://app.rightbrain.ai/api/v1` (Staging API)
- `https://app.rblocal.dev/api/v1` (Local development)

## Request

### Path parameters

- `org_id` (string, required) — The unique identifier of the organization.
- `project_id` (string, required) — The unique identifier of the project.

### Query parameters

- `page_limit` (integer, optional, default: 100) — Maximum number of tasks to return per page.
- `cursor` (string, optional, nullable) — Pagination cursor for the next page of tasks.
- `runs_per_task` (integer, optional, default: 30) — Maximum number of recent visible task runs to include for each task.

## Response

### 200

Paginated list of tasks with recent visible task runs.

- `results` (list of TaskRecentRunsSummary, required) — The list of items returned for the current page.
- `pagination` (PaginationDetails, optional, nullable) — Contains pagination information for the result set.

## Errors

### 400 Bad Request Error

Bad Request

- `detail` (MalformedResourceIdentifierErrorPayload, required) — The error payload.

### 401 Unauthorized Error

Unauthorized - Authentication failed **Common causes:** - Missing `Authorization` header - Expired access token - Invalid or malformed token - Using API key in wrong format **Resolution:** Ensure you're including a valid Bearer token or API key in the Authorization header.

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 403 Forbidden Error

Forbidden - Insufficient permissions for project **Common causes:** - Your role lacks the required permission for this action - The project belongs to a different organization or project - The action requires admin or owner privileges **Resolution:** Contact your organization admin to request appropriate access.

- `ListProjectRecentTaskRunsByTaskRequestForbiddenError`
  - PermissionCheckFailedErrorResponse: PermissionCheckFailedErrorResponse
  - MissingAuthenticationErrorResponse: MissingAuthenticationErrorResponse

### 404 Not Found Error

Project not found

- `detail` (ErrorResponseDetail, required) — A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### TaskRecentRunsSummary

- `task_id` (string, required) — The unique identifier of the Task.
- `task_name` (string, required) — Name of the Task.
- `recent_runs` (list of ProjectTaskRecentRunSummary, required) — Recent visible Task Runs for this Task, newest first.

### PaginationDetails

- `next_cursor` (string, optional, nullable) — A token used to retrieve the next page of results. If `null`, there are no more results.
- `has_next` (boolean, optional, nullable, default: false) — Indicates whether there are more results available in the next page.
- `page_limit` (integer, optional, nullable, default: 0) — The maximum number of items returned per page.

### MalformedResourceIdentifierErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `MALFORMED_RESOURCE_IDENTIFIER`
- `malformedResourceIdentifierError` (MalformedResourceIdentifierErrorDetails, required) — Metadata detailing more information about the error.

### ErrorResponseDetail

A plain error message, a list of field-level validation errors, a service validation error, or a domain error object with `reason` and `message`.

- string
- list of ErrorResponseDetailOneOf1Items
- ErrorResponseDetail2
- ErrorResponseDetail3
- ErrorResponseDetail4

### PermissionCheckFailedErrorResponse

- `detail` (PermissionCheckFailedErrorPayload, required) — The error payload.

### MissingAuthenticationErrorResponse

- `detail` (MissingAuthenticationErrorPayload, required) — The error payload.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ProjectTaskRecentRunSummary

- `id` (string, required) — The unique identifier of the Task Run.
- `status` (enum, required) — Compact run outcome derived from is_error.
  - Allowed values: `success`, `error`
- `created` (string, required) — The timestamp when the Task Run was created.

### MalformedResourceIdentifierErrorDetails

- `field` (string, required)
- `value` (any, required)
- `expected_format` (string, required)

### ErrorResponseDetailOneOf1Items

- `type` (string, required) — Error type identifier
- `loc` (list of ErrorResponseDetailOneOf1ItemsLocItems, optional) — Path to the error location. Integer segments index into a list.
- `msg` (string, optional) — Human-readable error message. Present on errors produced by FastAPI's own request validation.
- `message` (string, optional) — Human-readable error message. Used instead of `msg` by Rightbrain's own validators.

### ErrorResponseDetail2

Validation error returned by a service after request parsing, such as a Task clone dependency failure.

- `type` ("validation_error", required)
- `errors` (list of ErrorResponseDetailOneOf2ErrorsItems, required)

### ErrorResponseDetail3

Domain error raised via a brain.exc.BaseError subclass. The exact extra field name and shape vary by error type.

- `reason` (string, required) — Machine-readable, upper-snake-case error reason, e.g. RESOURCE_NOT_FOUND, PERMISSION_CHECK_FAILED, TAG_NAME_CONFLICT.
- `message` (string, required) — Human-readable error message

### ErrorResponseDetail4

Integration precondition failure. Uses `code` rather than `reason`, and carries no extra field. Raised by the Gmail trigger routes when the underlying integration is not authorized.

- `code` (string, required) — Machine-readable code, e.g. GMAIL_INTEGRATION_AUTH_REQUIRED.
- `message` (string, required) — Human-readable error message

### PermissionCheckFailedErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `PERMISSION_CHECK_FAILED`
- `permissionCheckFailedError` (PermissionCheckFailedErrorDetails, required) — Metadata detailing more information about the error.

### MissingAuthenticationErrorPayload

- `message` (string, required) — Human readable representation of the error
- `reason` (enum, required) — The machine-readable error reason.
  - Allowed values: `MISSING_AUTHENTICATION`
- `missingAuthenticationError` (EmptyErrorDetails, required) — Metadata detailing more information about the error.

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

### ErrorResponseDetailOneOf1ItemsLocItems

- string
- integer

### ErrorResponseDetailOneOf2ErrorsItems

- `type` (string, required) — Error type identifier
- `loc` (list of ErrorResponseDetailOneOf2ErrorsItemsLocItems, optional) — Path to the error location. Integer segments index into a list.
- `msg` (string, optional) — Human-readable error message. Present on errors produced by FastAPI's own request validation.
- `message` (string, optional) — Human-readable error message. Used instead of `msg` by Rightbrain's own validators.

### PermissionCheckFailedErrorDetails

- `permission` (string, required)
- `subject` (IAMObjectErrorDetails, optional, nullable)
- `resource` (IAMObjectErrorDetails, optional, nullable)

### EmptyErrorDetails

### ErrorResponseDetailOneOf2ErrorsItemsLocItems

- string
- integer

### IAMObjectErrorDetails

- `type` (string, required)
- `id` (string, optional, nullable)

## Examples

**Response**

```json
{
  "results": [
    {
      "task_id": "019f8a00-1c3d-7e42-b8f1-2a5c9d4e7b60",
      "task_name": "Support Ticket Triage",
      "recent_runs": [
        {
          "id": "019f8a05-9f71-7c96-b048-7fa0c25f9ab5",
          "status": "success",
          "created": "2026-07-24T11:47:03+00:00"
        },
        {
          "id": "019f8a04-8e60-7b85-af37-6e9fb14d8fa4",
          "status": "success",
          "created": "2026-07-24T10:02:17+00:00"
        }
      ]
    },
    {
      "task_id": "019f8a02-6c4e-7f63-8d15-4c7e9f2b6d82",
      "task_name": "Invoice Line-Item Extractor",
      "recent_runs": []
    }
  ],
  "pagination": {
    "next_cursor": "0190a234-8dc6-6d08-aea9-928fcecad8f2",
    "has_next": true,
    "page_limit": 25
  }
}
```

**SDK Code**

```python Tasks_listProjectRecentTaskRunsByTask_example
import requests

url = "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Tasks_listProjectRecentTaskRunsByTask_example
const url = 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Tasks_listProjectRecentTaskRunsByTask_example
package main

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

func main() {

	url := "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Tasks_listProjectRecentTaskRunsByTask_example
require 'uri'
require 'net/http'

url = URI("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

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

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

```java Tasks_listProjectRecentTaskRunsByTask_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Tasks_listProjectRecentTaskRunsByTask_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Tasks_listProjectRecentTaskRunsByTask_example
using RestSharp;

var client = new RestClient("https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Tasks_listProjectRecentTaskRunsByTask_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.rightbrain.ai/api/v1/org/org_id/project/project_id/task_run/recent_by_task")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```