# List a repository's audit areas

GET

/projects/{projectId}/repositories/{repositoryId}/audit-areas

```js
const url = 'https://zkao.io/api/v1/projects/example/repositories/example/audit-areas';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url https://zkao.io/api/v1/projects/example/repositories/example/audit-areas \
  --header 'Authorization: Bearer <token>'
```

* Production`zkao.io/api/v1/projects/{projectId}/repositories/{repositoryId}/audit-areas`
* Staging`staging.zkao.io/api/v1/projects/{projectId}/repositories/{repositoryId}/audit-areas`

Requires scope: `read`. Audit areas are the named subsystems a scan can be scoped to (`auditAreaKeys` on launch). Each scan that maps the repository keeps the list current; sizes come from one branch’s map, so an area that map no longer names is returned without one.

## Authorizations

* **[bearerAuth](https://docs.staging.zkao.io/api/#bearerauth)**

## Parameters

### Path Parameters

* **projectId**

  required

  string

* **repositoryId**

  required

  string

### Query Parameters

* **branch**

  string

  Branch whose map the sizes come from. Defaults to the repository’s default branch.

## Responses

### 200

OK

application/json

object

* **repositoryId**

  required

  string

* **branch**

  required

  Branch the sizes were read from.

  string | null

* **mapped**

  required

  Whether that branch has a stored map at all.

  boolean

* **totalFiles**

  required

  integer | null

* **totalLines**

  required

  integer | null

* **areas**

  required

  The map’s own audit order first, then the areas it no longer names.

  Array\<object>

  object

  * **key**

    required

    Stable slug, unique per repository. Pass it in `auditAreaKeys` when launching a scan.

    string

  * **name**

    required

    string

  * **description**

    required

    string | null

  * **source**

    required

    `discovered` was named by a scan’s map of the repository; `custom` was added through this API or the app.

    string

    Allowed values: discovered custom

  * **inLatestMap**

    required

    Whether the branch’s latest map still names this area.

    boolean

  * **files**

    required

    Files this area covers at that map. Null when the map does not name it.

    integer | null

  * **lines**

    required

    Lines this area covers at that map. Null when the map does not name it.

    integer | null

##### Example

```json
{
  "areas": [
    {
      "source": "discovered"
    }
  ]
}
```

### 401

Missing, malformed, expired, or revoked token

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 403

The token lacks the required scope

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```

### 404

Resource not in this token’s project or repo allowlist

application/json

object

* **error**

  required

  object

  * **code**

    required

    string

    Allowed values: unauthorized forbidden not_found bad_request conflict insufficient_credits budget_below_minimum repository_initializing diff_base_required diff_base_not_allowed diff_base_invalid diff_empty rate_limited internal

  * **message**

    required

    string

  * **minimumCredits**

    Budget_below_minimum only: the least the launch could have reserved, in credits. A diff scan’s first scan of a repository also builds its overview, so its minimum is higher.

    integer

##### Example

```json
{
  "error": {
    "code": "unauthorized"
  }
}
```
