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

# Categorization Task

> Endpoint for Categorization of Products for a Specific Sales Channel, it provides categorization for products, specifically tailored to the requirements of different sales channels. It identifies the most appropriate category for a product, based on its description and the specified sales channel.



## OpenAPI

````yaml post /tasks/categorization
openapi: 3.1.0
info:
  title: Lynks AI External API
  description: External API documentation for Lynks AI.
  version: 1.0.0
servers:
  - url: https://ai.getlynks.io/api
security: []
paths:
  /tasks/categorization:
    post:
      summary: Categorization Task
      description: >-
        Endpoint for Categorization of Products for a Specific Sales Channel, it
        provides categorization for products, specifically tailored to the
        requirements of different sales channels. It identifies the most
        appropriate category for a product, based on its description and the
        specified sales channel.
      operationId: categorization_task_tasks_categorization_post
      parameters:
        - name: sales_channel
          in: query
          required: true
          schema:
            allOf:
              - $ref: '#/components/schemas/SalesChannelEnum'
            description: >-
              The name of the sales channel for which the categorization is
              being performed. This is a required field.
            title: Sales Channel
          description: >-
            The name of the sales channel for which the categorization is being
            performed. This is a required field.
        - name: use_rag
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              A boolean value indicating whether the categorization should be
              performed precisely or not. This is an optional field with a
              default value of True.
            default: true
            title: Use Rag
          description: >-
            A boolean value indicating whether the categorization should be
            performed precisely or not. This is an optional field with a default
            value of True.
        - name: results_limit
          in: query
          required: false
          schema:
            type: integer
            description: >-
              The maximum number of category suggestions to return. It's an
              optional field with a default value of 10.
            default: 10
            title: Results Limit
          description: >-
            The maximum number of category suggestions to return. It's an
            optional field with a default value of 10.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductDescriptionBody'
      responses:
        '200':
          description: Product with predicted category.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategorizationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
          OpenAIKey: []
        - APIKey: []
components:
  schemas:
    SalesChannelEnum:
      type: string
      enum:
        - galaxus
        - manor
      title: SalesChannelEnum
    ProductDescriptionBody:
      properties:
        product_description:
          type: string
          title: Product Description
          description: >-
            A textual description of the item being categorized. This
            description is utilized to extract the available attributes.
      type: object
      required:
        - product_description
      title: ProductDescriptionBody
    CategorizationResponse:
      properties:
        message:
          type: string
          title: Message
        product_description:
          type: string
          title: Product Description
        sales_channel:
          $ref: '#/components/schemas/SalesChannelEnum'
        context_language:
          $ref: '#/components/schemas/LanguageEnum'
        best_prediction:
          $ref: '#/components/schemas/PredictedCategory'
        predicted_categories:
          items:
            $ref: '#/components/schemas/PredictedCategory'
          type: array
          title: Predicted Categories
      type: object
      required:
        - message
        - product_description
        - sales_channel
        - context_language
        - best_prediction
        - predicted_categories
      title: CategorizationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LanguageEnum:
      type: string
      enum:
        - en
        - de
        - fr
        - it
      title: LanguageEnum
    PredictedCategory:
      properties:
        identifier:
          type: string
          title: Identifier
        languages:
          additionalProperties:
            type: string
          type: object
          title: Languages
      type: object
      required:
        - identifier
        - languages
      title: PredictedCategory
    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
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-Api-Key
    OpenAIKey:
      type: apiKey
      in: header
      name: X-OpenAI-Key

````