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

# Get task relations

> Get every relation where the task is the source or the target, each with a summary of both linked tasks. Relations pointing outside the caller's workspace are omitted.



## OpenAPI

````yaml /openapi.json get /task-relation/{taskId}
openapi: 3.1.0
info:
  title: Kaneo API
  version: 1.0.0
  description: Kaneo Project Management API - Manage projects, tasks, labels, and more
servers:
  - url: https://cloud.kaneo.app/api
    description: Kaneo API Server
security:
  - bearerAuth: []
paths:
  /task-relation/{taskId}:
    get:
      tags:
        - Task Relations
      summary: Get task relations
      description: >-
        Get every relation where the task is the source or the target, each with
        a summary of both linked tasks. Relations pointing outside the caller's
        workspace are omitted.
      operationId: getTaskRelations
      parameters:
        - schema:
            type: string
          required: true
          name: taskId
          in: path
      responses:
        '200':
          description: Task relations with the linked task summaries
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskRelationWithTasks'
        '400':
          description: Unknown task, or its workspace could not be determined
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: Missing or invalid credentials
        '403':
          description: No access to the task's workspace
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    TaskRelationWithTasks:
      allOf:
        - $ref: '#/components/schemas/TaskRelation'
        - type: object
          properties:
            sourceTask:
              $ref: '#/components/schemas/RelatedTask'
            targetTask:
              $ref: '#/components/schemas/RelatedTask'
          required:
            - sourceTask
            - targetTask
    TaskRelation:
      type: object
      properties:
        id:
          type: string
        sourceTaskId:
          type: string
        targetTaskId:
          type: string
        relationType:
          type: string
          description: 'How the two tasks relate: `subtask`, `blocks`, or `related`.'
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - sourceTaskId
        - targetTaskId
        - relationType
        - createdAt
    RelatedTask:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
        title:
          type: string
        status:
          type: string
        priority:
          type:
            - string
            - 'null'
        number:
          type:
            - number
            - 'null'
        projectId:
          type: string
        userId:
          type:
            - string
            - 'null'
        assigneeName:
          type:
            - string
            - 'null'
      required:
        - id
        - title
        - status
        - priority
        - number
        - projectId
        - userId
        - assigneeName
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or session token (Bearer)

````