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

# API

> API reference for Codacy: every `codacy.api.*` operation with input and output types.

Every `codacy.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Account

### get

`account.get`

Get account details

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.account.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: number,
>   name?: string,
>   mainEmail: string,
>   otherEmails: string[],
>   isAdmin: boolean,
>   isActive: boolean,
>   created: string,
>   intercomHash?: string,
>   zendeskHash?: string,
>   pylonHash?: string,
>   shouldDoClientQualification?: boolean
> }
> ```

***

## Analysis

### getConfig

`analysis.getConfig`

Get repository analysis configuration

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.analysis.getConfig({ provider: 'gh', organization_name: 'codacy', repository_name: 'codacy-analysis-cli' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Git provider (e.g. gh, gl, bb) |
| `organization_name` | `string` | Yes | Organization name on the Git provider |
| `repository_name` | `string` | Yes | Repository name on the Git provider |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   uuid: string,
>   name: string,
>   isClientSide: boolean,
>   settings?: any
> }[]
> ```

***

## Organizations

### get

`organizations.get`

Get organization

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.organizations.get({ provider: 'gh', organization_name: 'codacy' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Git provider (e.g. gh, gl, bb) |
| `organization_name` | `string` | Yes | Organization name on the Git provider |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   organization: {
>     identifier?: number,
>     remoteIdentifier: string,
>     name: string,
>     avatar?: string,
>     created?: string,
>     provider: string,
>     joinMode?: string,
>     type?: string,
>     joinStatus?: string,
>     singleProviderLogin: boolean,
>     hasDastAccess: boolean,
>     hasScaEnabled: boolean,
>     imageSbomEnabled: boolean,
>     hasAiInventoryEnabled?: boolean,
>     hasFalsePositiveAccess?: boolean,
>     hasSilentFalsePositiveDetection?: boolean
>   },
>   membership?: {
>     userRole: string
>   },
>   analysisConfigurationMinimumPermission?: string
> }
> ```

***

### list

`organizations.list`

List organizations

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.organizations.list({ provider: 'gh', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | No | Restrict to a single Git provider (e.g. gh). Omit to list across providers. |
| `cursor` | `string` | No | Pagination cursor from a previous response |
| `limit` | `number` | No | Results per page (max 1000, default 100) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `pagination` | `object` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   identifier?: number,
>   remoteIdentifier: string,
>   name: string,
>   avatar?: string,
>   created?: string,
>   provider: string,
>   joinMode?: string,
>   type?: string,
>   joinStatus?: string,
>   singleProviderLogin: boolean,
>   hasDastAccess: boolean,
>   hasScaEnabled: boolean,
>   imageSbomEnabled: boolean,
>   hasAiInventoryEnabled?: boolean,
>   hasFalsePositiveAccess?: boolean,
>   hasSilentFalsePositiveDetection?: boolean
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   cursor?: string,
>   limit?: number,
>   total?: number
> }
> ```

***

## Patterns

### get

`patterns.get`

Get tool pattern

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.patterns.get({ tool_uuid: 'f8b29663-2cb2-498d-b923-a10c6a8c05cd', pattern_id: 'ESLint8_accessor-pairs' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tool_uuid` | `string` | Yes | Tool UUID |
| `pattern_id` | `string` | Yes | Pattern ID (unique per tool) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   title?: string,
>   category: string,
>   subCategory?: string,
>   level: string,
>   severityLevel: string,
>   description?: string,
>   explanation?: string,
>   enabled?: boolean,
>   languages?: string[],
>   timeToFix?: number,
>   parameters?: any,
>   rationale?: string,
>   solution?: string,
>   goodExamples?: string[],
>   badExamples?: string[],
>   tags?: string[]
> }
> ```

***

### list

`patterns.list`

List tool patterns

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.patterns.list({ tool_uuid: 'f8b29663-2cb2-498d-b923-a10c6a8c05cd', enabled: true, limit: 50 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tool_uuid` | `string` | Yes | Tool UUID |
| `enabled` | `boolean` | No | true: only patterns on by default; false: only those off |
| `cursor` | `string` | No | Pagination cursor from a previous response |
| `limit` | `number` | No | Results per page (max 1000, default 100) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `pagination` | `object` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   title?: string,
>   category: string,
>   subCategory?: string,
>   level: string,
>   severityLevel: string,
>   description?: string,
>   explanation?: string,
>   enabled?: boolean,
>   languages?: string[],
>   timeToFix?: number,
>   parameters?: any,
>   rationale?: string,
>   solution?: string,
>   goodExamples?: string[],
>   badExamples?: string[],
>   tags?: string[]
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   cursor?: string,
>   limit?: number,
>   total?: number
> }
> ```

***

## Repositories

### get

`repositories.get`

Get repository

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.repositories.get({ provider: 'gh', organization_name: 'codacy', repository_name: 'codacy-analysis-cli' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Git provider (e.g. gh, gl, bb) |
| `organization_name` | `string` | Yes | Organization name on the Git provider |
| `repository_name` | `string` | Yes | Repository name on the Git provider |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   repositoryId?: number,
>   provider: string,
>   owner: string,
>   name: string,
>   fullPath?: string,
>   visibility?: string,
>   remoteIdentifier?: string,
>   lastUpdated?: string,
>   permission?: string,
>   languages?: string[]
> }
> ```

***

### languages

`repositories.languages`

Get repository languages

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.repositories.languages({ provider: 'gh', organization_name: 'codacy', repository_name: 'codacy-analysis-cli' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Git provider (e.g. gh, gl, bb) |
| `organization_name` | `string` | Yes | Organization name on the Git provider |
| `repository_name` | `string` | Yes | Repository name on the Git provider |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `languages` | `object[]` | Yes | — |

> [accordion] languages full type
>
> ```ts theme={null}
> {
>   name: string,
>   codacyDefaults: string[],
>   extensions: string[],
>   defaultFiles: string[],
>   enabled: boolean,
>   detected: boolean
> }[]
> ```

***

### list

`repositories.list`

List repositories

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.repositories.list({ provider: 'gh', organization_name: 'codacy', search: 'analysis', limit: 20 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider` | `string` | Yes | Git provider (e.g. gh, gl, bb) |
| `organization_name` | `string` | Yes | Organization name on the Git provider |
| `search` | `string` | No | Filter repositories by name |
| `cursor` | `string` | No | Pagination cursor from a previous response |
| `limit` | `number` | No | Results per page (max 1000, default 100) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `pagination` | `object` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   repositoryId?: number,
>   provider: string,
>   owner: string,
>   name: string,
>   fullPath?: string,
>   visibility?: string,
>   remoteIdentifier?: string,
>   lastUpdated?: string,
>   permission?: string,
>   languages?: string[]
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   cursor?: string,
>   limit?: number,
>   total?: number
> }
> ```

***

## Tools

### list

`tools.list`

List analysis tools

**Risk:** `read`

```ts theme={null}
await corsair.codacy.api.tools.list({ limit: 100 });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `cursor` | `string` | No | Pagination cursor from a previous response |
| `limit` | `number` | No | Results per page (max 1000, default 100) |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `pagination` | `object` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   uuid: string,
>   name: string,
>   version?: string,
>   shortName?: string,
>   documentationUrl?: string,
>   sourceCodeUrl?: string,
>   prefix?: string,
>   needsCompilation?: boolean,
>   configurationFilenames?: string[],
>   description?: string,
>   dockerImage?: string,
>   languages?: string[]
> }[]
> ```

> [accordion] pagination full type
>
> ```ts theme={null}
> {
>   cursor?: string,
>   limit?: number,
>   total?: number
> }
> ```

***


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