# Get target execution

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

Get the status of a single execution.

**Required Scopes:** `TARGET_INFO`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** Execution ID returned by the execute endpoint */
  exec_id: string; // Example: "9214386e-7633-4d2b-ac66-fcfbaf5ea99b"
}
```

## Query Parameters

```typescript
interface QueryParameters {
  /** Long-poll budget in ms. Omit to use the server default: the request is held until the execution reaches a terminal status, returning the current status once the budget elapses. Send 0 to return immediately. Clamped server-side. */
  wait?: number; // Example: 10000
}
```

## 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,
  "bytes_out": 156,
  "truncated": false
}
```

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