# List issues (https://docs.capy.ai/api-reference/issues/list-issues)

`GET https://api.capy.ai/api/v1/issues`

## Authorization

Send an API key as a bearer token: `Authorization: Bearer $CAPY_API_KEY`. See https://docs.capy.ai/api-reference/authentication.md.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | query | string | no |  |
| `status` | query | `open` \| `closed` \| `all` | no |  |
| `stateIds` | query | string \| string[] | no |  |
| `priorities` | query | `urgent` \| `high` \| `normal` \| `low` \| `urgent` \| `high` \| `normal` \| `low`[] | no |  |
| `assignee` | query | string | no |  |
| `creator` | query | string | no |  |
| `mentioned` | query | string \| string[] | no |  |
| `mentionedNot` | query | `true` | no |  |
| `labelIds` | query | string \| string[] | no |  |
| `parent` | query | string | no |  |
| `due` | query | `today` \| `tomorrow` \| `this_week` \| `next_week` \| `this_month` \| `overdue` \| `none` \| `today` \| `tomorrow` \| `this_week` \| `next_week` \| `this_month` \| `overdue` \| `none`[] | no |  |
| `dueFrom` | query | string | no |  |
| `dueTo` | query | string | no |  |
| `dueNot` | query | `true` | no |  |
| `today` | query | string | no |  |
| `hasPullRequest` | query | `true` \| `false` | no |  |
| `search` | query | string | no |  |
| `limit` | query | integer | no |  |
| `cursor` | query | string | no |  |

## Responses

- `200` IssuePage: `IssuePageEncoded`
- `400` capy/InvalidRequest: `capy_InvalidRequestEncoded`
- `401` capy/Unauthorized: `capy_UnauthorizedEncoded`
- `403` capy/Forbidden: `capy_ForbiddenEncoded \| capy_ForbiddenEncoded`
- `404` capy/IssueNotFound: `capy_IssueNotFoundEncoded`
- `429` capy/RateLimited: `capy_RateLimitedEncoded`

## Example

```bash
curl -X GET "https://api.capy.ai/api/v1/issues" \
  -H "Authorization: Bearer $CAPY_API_KEY"
```

## Referenced schemas

```json
{
  "IssuePageEncoded": {
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IssueEncoded"
        }
      },
      "cursor": {
        "anyOf": [
          {
            "type": "string",
            "pattern": "^[0-3]:\\d{1,10}$"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "items",
      "cursor"
    ],
    "additionalProperties": false
  },
  "IssueEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "code": {
        "type": "string"
      },
      "number": {
        "type": "integer"
      },
      "projectId": {
        "type": "string"
      },
      "title": {
        "type": "string"
      },
      "state": {
        "$ref": "#/components/schemas/IssueStateRefEncoded"
      },
      "priority": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "urgent",
              "high",
              "normal",
              "low"
            ]
          },
          {
            "$ref": "#/components/schemas/UnsupportedMember_2"
          }
        ]
      },
      "dueAt": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "parentId": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      },
      "visibility": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "org",
              "private"
            ]
          },
          {
            "$ref": "#/components/schemas/UnsupportedMember_3"
          }
        ]
      },
      "assignees": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IssueActorEncoded"
        }
      },
      "labels": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IssueLabelRefEncoded"
        }
      },
      "subIssueCount": {
        "type": "integer"
      },
      "closedSubIssueCount": {
        "type": "integer"
      },
      "openBlockerCount": {
        "type": "integer",
        "description": "Open issues the key can read that block this one."
      },
      "createdAt": {
        "type": "string"
      },
      "updatedAt": {
        "type": "string"
      },
      "closedAt": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ]
      }
    },
    "required": [
      "id",
      "code",
      "number",
      "projectId",
      "title",
      "state",
      "priority",
      "dueAt",
      "parentId",
      "visibility",
      "assignees",
      "labels",
      "subIssueCount",
      "closedSubIssueCount",
      "openBlockerCount",
      "createdAt",
      "updatedAt",
      "closedAt"
    ],
    "additionalProperties": false
  },
  "IssueStateRefEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "type": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "open",
              "closed"
            ]
          },
          {
            "$ref": "#/components/schemas/UnsupportedMember_1"
          }
        ]
      }
    },
    "required": [
      "id",
      "name",
      "type"
    ],
    "additionalProperties": false
  },
  "UnsupportedMember_1": {
    "type": "string"
  },
  "UnsupportedMember_2": {
    "type": "string"
  },
  "UnsupportedMember_3": {
    "type": "string"
  },
  "IssueActorEncoded": {
    "type": "object",
    "properties": {
      "kind": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "user",
              "thread"
            ]
          },
          {
            "$ref": "#/components/schemas/UnsupportedMember_4"
          }
        ]
      },
      "id": {
        "type": "string",
        "description": "A user id for `user`, resolved by `GET /users`, or a thread id for `thread`."
      },
      "code": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "description": "The thread's reference, such as `SCO-123`; null for a user or a thread the key cannot read."
      }
    },
    "required": [
      "kind",
      "id",
      "code"
    ],
    "additionalProperties": false
  },
  "UnsupportedMember_4": {
    "type": "string"
  },
  "IssueLabelRefEncoded": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string"
      },
      "name": {
        "type": "string"
      }
    },
    "required": [
      "id",
      "name"
    ],
    "additionalProperties": false
  },
  "capy_InvalidRequestEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/InvalidRequest"
        ]
      },
      "message": {
        "type": "string"
      }
    },
    "required": [
      "_tag",
      "message"
    ],
    "additionalProperties": false
  },
  "capy_UnauthorizedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Unauthorized"
        ]
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_ForbiddenEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/Forbidden"
        ]
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_IssueNotFoundEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/IssueNotFound"
        ]
      }
    },
    "required": [
      "_tag"
    ],
    "additionalProperties": false
  },
  "capy_RateLimitedEncoded": {
    "type": "object",
    "properties": {
      "_tag": {
        "type": "string",
        "enum": [
          "capy/RateLimited"
        ]
      },
      "retryAfterSeconds": {
        "type": "integer"
      }
    },
    "required": [
      "_tag",
      "retryAfterSeconds"
    ],
    "additionalProperties": false
  }
}
```

Full document: https://docs.capy.ai/openapi.json