# List target executions

`GET /workspaces/:workspace/targets/:target_id/execs`

List recent executions for the target (most recent first).

**Required Scopes:** `TARGET_INFO`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** Target unique identifier (hash ID) */
  target_id: string; // Example: "tgt-1234567890abcdef"
}
```

## Query Parameters

```typescript
interface QueryParameters {
  /** Maximum number of executions to return (most recent first). Default: 50, max: 200. */
  limit?: number; // Example: 50
}
```

## 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;
  /** The ID of the execution */
  execution_id?: string;
  /** The ID of the target */
  target_id?: string;
  /** The type of the target */
  target_type?: "FTP" | "SSH" | "MATCH" | "MATCH_ID" | "VULTR" | "DIGITAL_OCEAN" | "UPCLOUD" | "GIT" | "ARTIFACT_VERSION" | "GKE" | "EKS" | "AKS" | "DOKS" | "K8S_CLUSTER" | "EC2" | "AGENT" | "SANDBOX" | "MYSQL" | "PROJECT_REPO" | "POSTGRESQL" | "MONGO" | "MSSQL" | "RDS_MSSQL";
  /** User/member reference */
  invoker?: MemberView;
  /** User/member reference */
  cancelled_by?: MemberView;
  /** The ID of the proxy target used to tunnel the connection */
  proxy_target_id?: string;
  /** The executed command */
  command?: string;
  /** The date and time when the execution started */
  started_at?: string;
  /** The date and time when the execution finished */
  finished_at?: string;
  /** The status of the execution. One of: INPROGRESS, SUCCESSFUL, FAILED, CANCELLED */
  status?: string;
  /** Platform-level reason a FAILED execution failed (absent for an ordinary non-zero exit): TIMEOUT (hard time cap reached), SPAWN_FAILED (execution could not be started), BASTION_FAILED (SSH bastion tunnel failed) */
  failure_reason?: string;
  /** The exit code of the executed command */
  exit_code?: number;
  /** The size of the execution output in bytes */
  bytes_out?: number;
  /** Indicates if the execution output was truncated */
  truncated?: boolean;
  /** The error message if the execution failed */
  error_message?: string;
  /** The URL to fetch the execution log */
  log_url?: string;
}
```

## Type Definitions

```typescript
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 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;
}

```

## Response Example

**Status:** `200 OK`

```json
[
  {
    "url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/9214386e-7633-4d2b-ac66-fcfbaf5ea99b",
    "log_url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/9214386e-7633-4d2b-ac66-fcfbaf5ea99b/log",
    "execution_id": "9214386e-7633-4d2b-ac66-fcfbaf5ea99b",
    "target_id": "tg-b185vd3ct4chv",
    "target_type": "MYSQL",
    "invoker": {
      "url": "https://api.buddy.works/workspaces/my-workspace/members/1",
      "id": 1,
      "name": "John Doe"
    },
    "command": "mysql sql=SELECT 1 AS ok, NOW() AS ts",
    "started_at": "2026-05-28T08:00:09.820Z",
    "finished_at": "2026-05-28T08:00:10.412Z",
    "status": "SUCCESSFUL",
    "exit_code": 0
  },
  {
    "url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/7a1e3b9c-2d4f-4e8a-9c5b-1f6d7e2a4b3c",
    "log_url": "https://api.buddy.works/workspaces/my-workspace/targets/execs/7a1e3b9c-2d4f-4e8a-9c5b-1f6d7e2a4b3c/log",
    "execution_id": "7a1e3b9c-2d4f-4e8a-9c5b-1f6d7e2a4b3c",
    "target_id": "tg-b185vd3ct4chv",
    "target_type": "MYSQL",
    "invoker": {
      "url": "https://api.buddy.works/workspaces/my-workspace/members/1",
      "id": 1,
      "name": "John Doe"
    },
    "command": "mysql sql=SHOW TABLES",
    "started_at": "2026-05-28T07:55:12.103Z",
    "finished_at": "2026-05-28T07:55:12.711Z",
    "status": "SUCCESSFUL",
    "exit_code": 0
  }
]
```

---
Original source: https://buddy.works/docs/api/targets/execs/list