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

# Link an item to a survey theme

> Link a bug / feature request (`ticketId`) or a Kai Code session (`cloudSessionId`, or the `clientLaunchId`
of a Kai Code draft that is not sent yet) to an AI theme (`themeId`) and/or a finding of the brief
(`finding`: its title). The ticket or session must belong to the survey's project. Linking the same item
twice returns the existing link. Returns `{ link }`; `GET /insights` returns every link as `links` and
per theme as `themes[].links`.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json post /engagement/surveys/{surveyId}/insights/links
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /engagement/surveys/{surveyId}/insights/links:
    post:
      tags:
        - Engagement Survey
      summary: Link an item to a survey theme
      description: >-
        Link a bug / feature request (`ticketId`) or a Kai Code session
        (`cloudSessionId`, or the `clientLaunchId`

        of a Kai Code draft that is not sent yet) to an AI theme (`themeId`)
        and/or a finding of the brief

        (`finding`: its title). The ticket or session must belong to the
        survey's project. Linking the same item

        twice returns the existing link. Returns `{ link }`; `GET /insights`
        returns every link as `links` and

        per theme as `themes[].links`.
      operationId: LinkThemeItem
      parameters:
        - in: path
          name: surveyId
          required: true
          schema:
            type: string
        - in: header
          name: project
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema: {}
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema: {}
      security:
        - jwt: []
components:
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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