> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CodeScansClient

## Constructor

```typescript
CodeScansClient(options: BaseClientOptions): CodeScansClient
```

### Parameters

**options** `BaseClientOptions` *required*

### Returns

`CodeScansClient`

## Methods

### getCodeScanMetrics()

```typescript
getCodeScanMetrics(request: GetCodeScanMetricsCodeScansRequest, requestOptions?: RequestOptions): HttpResponsePromise<CodeScanMetricsResponse>
```

Get aggregated code scan metrics for the organization.

Returns scan, finding, and remediation-PR metrics for code scans created
within the specified time range.

```ts
await client.codeScans.getCodeScanMetrics({
        org_id: "org-abc123def456",
        time_before: 1,
        time_after: 1
    })
```

#### Parameters

**request** `GetCodeScanMetricsCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<CodeScanMetricsResponse>`

### getCodeScanProfile()

```typescript
getCodeScanProfile(request: GetCodeScanProfileCodeScansRequest, requestOptions?: RequestOptions): HttpResponsePromise<CodeScanProfileDetailResponse>
```

Get a code scan profile by ID.

Returns the profile's metadata, visibility (org-owned or shared
account-wide), and all of its guidance fields. Returns `404` when the
profile does not exist or is not visible to the organization.

```ts
await client.codeScans.getCodeScanProfile({
        org_id: "org-abc123def456",
        profile_id: "profile_id"
    })
```

#### Parameters

**request** `GetCodeScanProfileCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<CodeScanProfileDetailResponse>`

### listCodeScanFindings()

```typescript
listCodeScanFindings(request: ListCodeScanFindingsCodeScansRequest, requestOptions?: RequestOptions): Promise<Page<CodeScanFindingResponse, PaginatedResponseCodeScanFindingResponse>>
```

List code scan findings for the organization.

Findings are returned newest first. Optionally filter by `scan_id`,
`repo_name`, `severity`, and `status` (`severity` and `status`
accept multiple values); results are paginated with an opaque cursor
(`after` / `first`).

```ts
await client.codeScans.listCodeScanFindings({
        org_id: "org-abc123def456"
    })
```

#### Parameters

**request** `ListCodeScanFindingsCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`Promise<Page<CodeScanFindingResponse, PaginatedResponseCodeScanFindingResponse>>`

### listCodeScanProfiles()

```typescript
listCodeScanProfiles(request: ListCodeScanProfilesCodeScansRequest, requestOptions?: RequestOptions): Promise<Page<CodeScanProfileSummaryResponse, PaginatedResponseCodeScanProfileSummaryResponse>>
```

List code scan profiles for the organization.

Returns profile summaries (without guidance) newest first, including both
org-owned and account-shared profiles. Results are paginated with an
opaque cursor (`after` / `first`).

```ts
await client.codeScans.listCodeScanProfiles({
        org_id: "org-abc123def456"
    })
```

#### Parameters

**request** `ListCodeScanProfilesCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`Promise<Page<CodeScanProfileSummaryResponse, PaginatedResponseCodeScanProfileSummaryResponse>>`

### listCodeScans()

```typescript
listCodeScans(request: ListCodeScansCodeScansRequest, requestOptions?: RequestOptions): Promise<Page<CodeScanResponse, PaginatedResponseCodeScanResponse>>
```

List code scans for the organization.

Scans are returned newest first. Optionally filter by `repo_name` and
creation time (`time_after` / `time_before`); results are paginated
with an opaque cursor (`after` / `first`).

```ts
await client.codeScans.listCodeScans({
        org_id: "org-abc123def456"
    })
```

#### Parameters

**request** `ListCodeScansCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`Promise<Page<CodeScanResponse, PaginatedResponseCodeScanResponse>>`

### remediateCodeScanFinding()

```typescript
remediateCodeScanFinding(request: RemediateCodeScanFindingCodeScansRequest, requestOptions?: RequestOptions): HttpResponsePromise<RemediateFindingResponse>
```

Launch a Devin session to remediate a code scan finding.

The session analyzes the vulnerable code, implements a fix, and opens a
pull request. The session is attributed to the calling principal (the
service user or PAT that made the request). Returns `409` if the finding
already has a remediation session.

```ts
await client.codeScans.remediateCodeScanFinding({
        org_id: "org-abc123def456",
        scan_id: "scan_id",
        finding_id: "finding_id"
    })
```

#### Parameters

**request** `RemediateCodeScanFindingCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<RemediateFindingResponse>`

### startCodeScan()

```typescript
startCodeScan(request: StartCodeScanCodeScansRequest, requestOptions?: RequestOptions): HttpResponsePromise<CodeScanResponse>
```

Start a new code scan on a repository in the organization.

The scan is enqueued and launched asynchronously by the scan dispatcher.
The scan is attributed to the calling principal (the service user or PAT
that made the request). Returns `409` when the organization's scan
backlog is at capacity.

```ts
await client.codeScans.startCodeScan({
        org_id: "org-abc123def456",
        body: {
            repo_name: "repo_name"
        }
    })
```

#### Parameters

**request** `StartCodeScanCodeScansRequest` *required*

**requestOptions** `RequestOptions`

Request-specific configuration.

#### Returns

`HttpResponsePromise<CodeScanResponse>`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.