# List Fetches

`GET /workspaces/:workspace/sandboxes/:sandbox_id/fetches`

Get the sources fetched into a sandbox

**Required Scopes:** `SANDBOX_READ`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The ID of the sandbox */
  sandbox_id: string; // Example: "sb-1234567890abcdef"
}
```

## 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;
  fetches?: SandboxFetchView[];
}
```

## Type Definitions

```typescript
interface SandboxFetchView {
  /** The auto-generated ID of the fetch */
  id?: string;
  /** The type of the fetch item: PROJECT_REPO, PUBLIC_REPO, or ARTIFACT */
  type?: "PROJECT_REPO" | "PUBLIC_REPO" | "ARTIFACT";
  /** The URL of the git repository (for PUBLIC_REPO type) */
  repository?: string;
  /** The branch, tag, or commit to checkout. Defaults to the default branch */
  ref?: string;
  /** The target directory where the item is cloned/downloaded. It identifies the fetch, so two entries cannot share it. Defaults to the app directory */
  path?: string;
  /** The path inside the artifact to fetch instead of its whole content (for ARTIFACT type) */
  source_path?: string;
  /** The revision currently checked out in the sandbox (for repository fetches) */
  current_revision?: string;
  /** How many commits the fetched revision is behind the configured ref, null when it cannot be measured */
  behind?: number;
  /** Whether the fetched artifact version differs from the current one, null when it cannot be measured */
  outdated?: boolean;
  /** When the source was last fetched into the sandbox, null when it has not been fetched yet */
  fetched_date?: string;
  /** State of this entry: FETCHING, FETCHED, ERROR after a failed run, STALE when it needs a refetch: it was changed, added while the sandbox was not running, or its fetch was interrupted. Only Refetch brings a STALE entry up to date */
  status?: "FETCHING" | "FETCHED" | "ERROR" | "STALE";
  /** Why the last fetch failed, null unless the status is ERROR */
  error_message?: string;
  /** The command to run after fetching */
  build_command?: string;
  /** The artifact identifier in format pkg:version (for ARTIFACT type) */
  artifact?: string;
}

```

## Response Example

**Status:** `200 OK`


---
Original source: https://buddy.works/docs/api/sandboxes/list-fetches