# Search files

`GET /workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/files/search`

Searches files in the pipeline filesystem by path and content filters

**Required Scopes:** `EXECUTION_MANAGE`

## 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 pipeline */
  pipeline_id: number; // Example: 123
}
```

## Query Parameters

```typescript
interface QueryParameters {
  /** Glob pattern to filter files by path */
  path_filter?: string; // Example: "**/*.pdf"
  /** Pattern to filter files by content */
  content_filter?: string; // Example: "my phrase"
}
```

## 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 list of files matching the filters */
  files?: FileMatch[];
}
```

## Type Definitions

```typescript
interface FileMatch {
  /** The path of the matched file relative to the pipeline filesystem root */
  path?: string;
  /** The lines matching the content filter; returned only when the content filter is set */
  matched_lines?: MatchedLine[];
}

interface MatchedLine {
  /** The number of the matched line */
  line_number?: number;
  /** The text of the matched line */
  line_text?: string;
}

```

## Response Example

**Status:** `200 OK`

```json
{
  "files": [
    {
      "path": "app/docs/report.txt",
      "matched_lines": [
        {
          "line_number": 2,
          "line_text": "line with pattern Y"
        }
      ]
    }
  ]
}
```

---
Original source: https://buddy.works/docs/api/pipelines/files/search