---
title: "GET /api/v2/owner/{owner}/defect"
method: GET
path: "/api/v2/owner/{owner}/defect"
tags: ["defect"]
---

# GET /api/v2/owner/{owner}/defect

`GET /api/v2/owner/{owner}/defect`

## Path parameters

- `owner` string, required

## Query parameters

- `branch_name` string, nullable
- `defect_type` unknown
- `last_seen_gte` string, date-time
- `last_seen_lt` string, date-time
- `latest_defects_only` boolean
- `no_branch` boolean
- `offset` integer
- `per_page` integer
- `project_slug` string[]
- `q` string
- `run` unknown
- `severity` string[]
- `sorted_by` string[]
- `status` 'open' | 'closed'
- `target_slug` string[]
- `target_type` 'code' | 'api'

## Response `200`

Get defects for a owner, optionally filtered by project/target.

    The target to filter on is determined by the target slug passed in the query
    parameter `target`.

    The run to filter on is determined by the run number passed in the query
    parameter `run`. A value of "latest" here will return defects for the most
    recent run based on the run's created_at time.

    Pagination defaults to 10 per page and starts on offset 0.

    :param owner: the owner
    :param offset: the offset of the results to retrieve, 0-indexed
    :param per_page: how many results to retrieve per page
    :param project: an optional filter on the project
    :param target: an optional filter on the target
    :param run: an optional filter on the run number
    :param defect_type: an optional filter on the defect CWE number
    :param branch_name: an optional filter used to select the defect state for the
                        given branch. If not specified, the Project default branch
                        is used.
    :param no_branch: an explicit boolean that filters defect state details to
                      runs without branch information. When this is true,
                      branch_name cannot be set.

    :returns: A dict where the `defects` key contains a list of the desired defects

- DefectList
  - `api_count` integer
  - `code_count` integer
  - `count` integer
  - `defects` Defect[], required
    - `branch` string, nullable
    - `created_at` string, date-time
    - `cwe_description` string
    - `cwe_link` string
    - `cwe_number` integer, nullable
    - `cwe_type` string
    - `defect_class` string
    - `defect_class_full_description` string
    - `defect_class_name` string
    - `defect_class_short_description` string
    - `defect_number` integer
    - `description` string
    - `first_seen` string, date-time
    - `from_valgrind` boolean
    - `jira_issue_id` string, nullable
    - `jira_issue_url` string, nullable
    - `last_seen` string, date-time
    - `last_seen_run_id` integer
    - `last_seen_run_number` integer
    - `project_slug` string, required
    - `severity` number
    - `severity_level` 'low' | 'medium' | 'high'
    - `source` 'code' | 'api'
    - `state` 'open' | 'closed'
    - `target_slug` string, required
    - `title` string
    - `type` 'crash' | 'valgrind' | 'mapi' | 'zap'
    - `updated_at` string, date-time

## Other responses

- `400` — Input parameters are referencing incorrect/non-existing objects.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Resource not found.
- `409` — Resource exists.
- `422` — Input parameters fail validation.
- `429` — Too many requests

---

[API](https://skmtc.dev/mayhem/apis/mayhem-api.md) · [All operations](https://skmtc.dev/mayhem/apis/mayhem-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mayhem/mayhem-api/revisions/7bc7386815cd/schema)
