# List

> For AI agents: the complete documentation index is at https://buddy.works/llms.txt

`GET /workspaces/:workspace/projects/:project_name/unit-tests/suites/:suite_id/sessions`

Get all test sessions for a suite

**Required Scopes:** `UNIT_TEST_READ`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The human-readable ID of the project */
  project_name: string; // Example: "my-project"
  /** The ID of the unit test suite */
  suite_id: string; // Example: "MNbyVedg"
}
```

## Query Parameters

```typescript
interface QueryParameters {
  /** The number of the successive pages (results are split into pages of per_page elements each). */
  page?: number; // Example: 1
  /** Specifies the number of returned elements on the page. The default value is 20. */
  per_page?: number; // Example: 20
  /** Filter sessions by branch name */
  branch?: string; // Example: "main"
}
```

## Response Body

```typescript
interface ResponseBody {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  sessions?: TestSessionView[];
}
```

## Type Definitions

```typescript
interface TestSessionView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** Unique identifier of the test session */
  id?: string;
  /** Sequential ID within the suite */
  relative_id?: number;
  /** Timestamp when the session was created */
  create_date?: string;
  /** Timestamp when the session started */
  start_date?: string;
  /** Timestamp when the session finished */
  finish_date?: string;
  /** User/member reference */
  created_by?: MemberView;
  /** CI provider that initiated the test session */
  ci_provider?: "NONE" | "BUDDY" | "GITHUB_ACTION" | "CIRCLE_CI";
  /** URL to the external CI/CD run */
  ci_run_url?: string;
  /** Ending revision/commit hash for the test range */
  revision?: string;
  /** Type of Git reference */
  ref_type?: "BRANCH" | "TAG" | "PULL_REQUEST";
  /** Name of the Git reference (branch name, tag name, etc.). May be null if ref_type is not provided. */
  ref_name?: string;
  /** Execution hash ID. Set when session is a result of BUDDY action execution */
  execution_id?: string;
  /** Action execution hash ID. Set when session is a result of BUDDY action execution */
  action_execution_id?: string;
  /** Current status of the session */
  status?: "IN_PROGRESS" | "SUCCESSFUL" | "ERROR" | "SKIPPED";
  /** Error message if the session failed. Set when status is ERROR. */
  error_message?: string;
  /** Total duration in seconds */
  duration?: number;
  /** Total number of tests */
  tests_count?: number;
  /** Number of failed tests */
  failed_count?: number;
  /** Number of skipped tests */
  skipped_count?: number;
  /** Number of tests with errors */
  error_count?: number;
}

interface MemberView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the user */
  id?: number;
  /** The name of the user */
  name?: string;
  /** The unique username of the user */
  username?: string;
  /** The avatar URL of the user */
  avatar_url?: string;
  /** The email address of the user */
  email?: string;
  /** Whether the user has admin privileges */
  admin?: boolean;
  /** Whether the user is workspace owner */
  workspace_owner?: boolean;
}

```

## Request Example

```bash
curl -X GET "https://api.buddy.works/workspaces/:workspace/projects/:project_name/unit-tests/suites/:suite_id/sessions" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json"
```

## Response Example

**Status:** `200 OK`

```json
{
  "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/unit-tests/suites/MNbyVedg/sessions",
  "html_url": "https://app.buddy.works/my-workspace/my-project/unit-tests/MNbyVedg",
  "sessions": [
    {
      "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/unit-tests/suites/MNbyVedg/sessions/YDnagwGk",
      "html_url": "https://app.buddy.works/my-workspace/my-project/unit-tests/MNbyVedg/YDnagwGk",
      "id": "YDnagwGk",
      "relative_id": 2,
      "create_date": "2025-10-21T06:42:16Z",
      "start_date": "2025-10-21T06:42:16Z",
      "created_by": {
        "url": "https://api.buddy.works/workspaces/my-workspace/members/1",
        "html_url": "https://app.buddy.works/my-workspace/-/profile/1",
        "id": 1,
        "name": "John Doe",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png?ts=1760014081477",
        "email": "john.doe@company.com",
        "admin": true,
        "workspace_owner": true
      },
      "ci_provider": "BUDDY",
      "revision": "755b691cfff32e08aba35f2c9b1451ed76cfd583",
      "ref_type": "BRANCH",
      "ref_name": "master",
      "execution_id": "68f72b4466907cbc77887a08",
      "action_execution_id": "68f72b4466907cbc77887a0a",
      "status": "SUCCESSFUL",
      "duration": 0,
      "tests_count": 109,
      "failed_count": 0,
      "skipped_count": 0,
      "error_count": 0
    },
    {
      "url": "https://api.buddy.works/workspaces/my-workspace/projects/my-project/unit-tests/suites/MNbyVedg/sessions/r4nBYXVq",
      "html_url": "https://app.buddy.works/my-workspace/my-project/unit-tests/MNbyVedg/r4nBYXVq",
      "id": "r4nBYXVq",
      "relative_id": 1,
      "create_date": "2025-10-21T06:42:08Z",
      "start_date": "2025-10-21T06:42:08Z",
      "created_by": {
        "url": "https://api.buddy.works/workspaces/my-workspace/members/1",
        "html_url": "https://app.buddy.works/my-workspace/-/profile/1",
        "id": 1,
        "name": "John Doe",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png?ts=1760014081477",
        "email": "john.doe@company.com",
        "admin": true,
        "workspace_owner": true
      },
      "ci_provider": "BUDDY",
      "revision": "755b691cfff32e08aba35f2c9b1451ed76cfd583",
      "ref_type": "BRANCH",
      "ref_name": "master",
      "execution_id": "68f72b3d66907cbc77887986",
      "action_execution_id": "68f72b3d66907cbc77887988",
      "status": "SUCCESSFUL",
      "duration": 1,
      "tests_count": 109,
      "failed_count": 0,
      "skipped_count": 0,
      "error_count": 0
    }
  ]
}
```

---
Original source: https://buddy.works/docs/api/unit-tests/sessions/list