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

`GET https://api.capy.ai/api/v1/issues/{code}/relations`

## 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 |
| --- | --- | --- | --- | --- |
| `code` | path | string | yes |  |
| `offset` | query | string | no |  |
| `limit` | query | string | no |  |

## Responses

- `200` IssueRelationPage: `IssueRelationPageEncoded`
- `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/{code}/relations" \
  -H "Authorization: Bearer $CAPY_API_KEY"
```

## Referenced schemas

```json
{
  "IssueRelationPageEncoded": {
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IssueRelationEncoded"
        }
      },
      "total": {
        "type": "integer"
      }
    },
    "required": [
      "items",
      "total"
    ],
    "additionalProperties": false
  },
  "IssueRelationEncoded": {
    "type": "object",
    "properties": {
      "relation": {
        "anyOf": [
          {
            "type": "string",
            "enum": [
              "blocked_by",
              "blocks",
              "related"
            ]
          },
          {
            "$ref": "#/components/schemas/UnsupportedMember_7"
          }
        ],
        "description": "How the listed issue relates to the one in the path: `blocks` means the path issue blocks it, `blocked_by` that it blocks the path issue."
      },
      "issue": {
        "$ref": "#/components/schemas/IssueEncoded"
      }
    },
    "required": [
      "relation",
      "issue"
    ],
    "additionalProperties": false
  },
  "UnsupportedMember_7": {
    "type": "string"
  },
  "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