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

# Link a task to an issue

> Link an existing task in the connected Linear, Jira, or GitHub workspace to an issue. The issue shows the task and follows its status like a task Sazabi filed. Linking is idempotent.



## OpenAPI

````yaml /openapi.json post /issues/{issueId}/tasks
openapi: 3.1.1
info:
  title: Sazabi Public API
  version: 1.0.0
  description: >
    Public REST API for Sazabi. Authenticate using a secret API key in the
    Authorization header.


    ## Pagination


    This API uses two pagination strategies depending on the endpoint type:


    ### Cursor-Based Pagination (List Endpoints)


    List endpoints (threads, messages, keys) use cursor-based pagination for
    efficient, consistent results:


    - **Parameters**: `limit` (items per page, default 50, max 100), `cursor`
    (opaque pagination token)

    - **Response**: Includes `nextCursor` field - pass this as `cursor` in the
    next request

    - **End of results**: When `nextCursor` is `null`, there are no more results

    - **Example**: `GET
    /v1/threads?limit=20&cursor=01234567-89ab-cdef-0123-456789abcdef`


    ### Page-Based Pagination (Search Endpoints)


    Search endpoints use page-based pagination due to the underlying search
    engine:


    - **Parameters**: `limit` (items per page, default 20, max 100), `page`
    (1-indexed page number)

    - **Response**: Includes `pagination` object with `page`, `limit`,
    `totalResults`, `totalPages`

    - **Example**: `GET /v1/search/threads?q=error&limit=10&page=2`
servers:
  - url: https://api.sazabi.com/v1
    description: Production
security: []
paths:
  /issues/{issueId}/tasks:
    post:
      tags:
        - Issues
      summary: Link a task to an issue
      description: >-
        Link an existing task in the connected Linear, Jira, or GitHub workspace
        to an issue. The issue shows the task and follows its status like a task
        Sazabi filed. Linking is idempotent.
      operationId: issues.linkTask
      parameters:
        - name: issueId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Issue to link the task to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                task:
                  type: string
                  minLength: 1
                  description: >-
                    The task's identifier (for example `ENG-123`), provider id,
                    or URL in the connected Linear, Jira, or GitHub workspace.
              required:
                - task
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  taskLink:
                    type: object
                    properties:
                      provider:
                        enum:
                          - linear
                          - jira
                          - github
                        type: string
                      identifier:
                        type: string
                      url:
                        type: string
                        format: uri
                    required:
                      - provider
                      - identifier
                      - url
                  created:
                    type: boolean
                    description: False when the task was already linked to this issue.
                required:
                  - taskLink
                  - created

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.