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

# Create Insight Template Group

> Create a new insight group



## OpenAPI

````yaml /openapi/source/external/inference/inference-embedding.json post /ai/conversations/insight-groups
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: Chat
    description: Generate text with LLMs
  - name: Assistants
    description: Configure AI assistant specifications
  - name: Conversations
    description: Manage historical AI assistant conversations
  - name: File-based Text-to-Speech
    description: Turn audio into text or text into audio.
  - name: Embeddings
    description: Embed documents and perform text searches
  - name: Clusters
    description: Identify common themes and patterns in your embedded documents
  - name: Fine Tuning
    description: Customize LLMs for your unique needs
  - name: OpenAI Embeddings
    description: >-
      OpenAI-compatible embeddings endpoints for generating vector
      representations of text
paths:
  /ai/conversations/insight-groups:
    post:
      tags:
        - Conversations
      summary: Create Insight Template Group
      description: Create a new insight group
      operationId: create_insight_group
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InsightTemplateGroupCreateReq'
            example:
              name: Name
              description: Description
              webhook: ''
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateGroupDetailRespData'
              example:
                data:
                  id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                  name: Name
                  description: Description
                  created_at: '2024-01-23T18:10:02.574Z'
                  insights:
                    - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
                      instructions: Instructions
                      created_at: '2024-01-23T18:10:02.574Z'
                      insight_type: custom
                      name: ''
                      webhook: ''
                      json_schema: string
                  webhook: ''
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const insightTemplateGroupDetail = await
            client.ai.conversations.insightGroups.insightGroups({
              name: 'name',
            });


            console.log(insightTemplateGroupDetail.data);
        - lang: Python
          source: >
            import os

            from telnyx import Telnyx


            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )

            insight_template_group_detail =
            client.ai.conversations.insight_groups.insight_groups(
                name="name",
            )

            print(insight_template_group_detail.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tinsightTemplateGroupDetail, err := client.AI.Conversations.InsightGroups.InsightGroups(context.TODO(), telnyx.AIConversationInsightGroupInsightGroupsParams{\n\t\tName: \"name\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", insightTemplateGroupDetail.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.ai.conversations.insightgroups.InsightGroupInsightGroupsParams;

            import
            com.telnyx.sdk.models.ai.conversations.insightgroups.InsightTemplateGroupDetail;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    InsightGroupInsightGroupsParams params = InsightGroupInsightGroupsParams.builder()
                        .name("name")
                        .build();
                    InsightTemplateGroupDetail insightTemplateGroupDetail = client.ai().conversations().insightGroups().insightGroups(params);
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            insight_template_group_detail =
            telnyx.ai.conversations.insight_groups.insight_groups(name: "name")


            puts(insight_template_group_detail)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $insightTemplateGroupDetail = $client
                ->ai
                ->conversations
                ->insightGroups
                ->insightGroups(
                name: 'name', description: 'description', webhook: 'webhook'
              );

              var_dump($insightTemplateGroupDetail);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:conversations:insight-groups insight-groups \
              --api-key 'My API Key' \
              --name name
components:
  schemas:
    InsightTemplateGroupCreateReq:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        webhook:
          type: string
          title: Webhook
          default: ''
      type: object
      required:
        - name
      title: InsightTemplateGroupCreateReq
    InsightTemplateGroupDetailRespData:
      properties:
        data:
          $ref: '#/components/schemas/InsightTemplateGroupResp'
      type: object
      required:
        - data
      title: InsightTemplateGroupDetailRespData
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
      example:
        detail:
          - loc:
              - body
              - name
            msg: Field required
            type: missing
    InsightTemplateGroupResp:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        created_at:
          type: string
          format: date-time
          title: Created At
        insights:
          items:
            $ref: '#/components/schemas/InsightTemplateResp'
          type: array
          title: Insights
        webhook:
          type: string
          title: Webhook
          default: ''
      type: object
      required:
        - id
        - name
        - created_at
      title: InsightTemplateGroupResp
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    InsightTemplateResp:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        instructions:
          type: string
          title: Instructions
        created_at:
          type: string
          format: date-time
          title: Created At
        insight_type:
          $ref: '#/components/schemas/TemplateType'
          default: custom
        name:
          type: string
          title: Name
          default: ''
        webhook:
          type: string
          title: Webhook
          default: ''
        json_schema:
          anyOf:
            - type: string
            - type: object
              title: JsonSchemaObject
          title: Json Schema
          description: If specified, the output will follow the JSON schema.
      type: object
      required:
        - id
        - instructions
        - created_at
      title: InsightTemplateResp
    TemplateType:
      type: string
      enum:
        - custom
        - default
      title: TemplateType
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````