> ## 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.

# Attribution Task

> Endpoint for Attribution of Products for a Specific Sales Channel, it provides attribution for products, specifically tailored to the requirements of different sales channels. It extracts the desired attributes for a product, based on its description and the specified sales channel.



## OpenAPI

````yaml post /tasks/attribution
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/attribution:
    post:
      summary: Attribution Task
      description: >-
        Endpoint for Attribution of Products for a Specific Sales Channel, it
        provides attribution for products, specifically tailored to the
        requirements of different sales channels. It extracts the desired
        attributes for a product, based on its description and the specified
        sales channel.
      operationId: attribution_task_tasks_attribution_post
      parameters:
        - name: category_identifier
          in: query
          required: true
          schema:
            type: string
            description: The category assigned to the item
            title: Category Identifier
          description: The category assigned to the item
        - name: add_recommended
          in: query
          required: false
          schema:
            type: boolean
            description: Flag indicating if to add recommended attributes to the process
            default: false
            title: Add Recommended
          description: Flag indicating if to add recommended attributes to the process
        - name: add_optional
          in: query
          required: false
          schema:
            type: boolean
            description: Flag indicating if to add optional attributes to the process
            default: false
            title: Add Optional
          description: Flag indicating if to add optional attributes to the process
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductDescriptionBody'
      responses:
        '200':
          description: Product with extracted attributes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttributionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
          OpenAIKey: []
        - APIKey: []
components:
  schemas:
    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
    AttributionResponse:
      properties:
        message:
          type: string
          title: Message
        category_identifier:
          type: string
          title: Category Identifier
        product_description:
          type: string
          title: Product Description
        context_language:
          type: string
          title: Context Language
        extraction:
          items:
            $ref: '#/components/schemas/ExtractedAttributeValue'
          type: array
          title: Extraction
        attribute_count:
          type: integer
          title: Attribute Count
        attributes:
          items:
            $ref: '#/components/schemas/AttributeWithValues'
          type: array
          title: Attributes
      type: object
      required:
        - message
        - category_identifier
        - product_description
        - context_language
        - extraction
        - attribute_count
        - attributes
      title: AttributionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExtractedAttributeValue:
      properties:
        attribute_identifier:
          type: string
          title: Attribute Identifier
        requirement_level:
          type: string
          title: Requirement Level
        value_identifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Value Identifier
        value_raw:
          anyOf:
            - type: string
            - type: 'null'
          title: Value Raw
        value_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Value Unit
        value_source:
          $ref: '#/components/schemas/ValueSource'
        reasoning:
          type: string
          title: Reasoning
        confidence:
          $ref: '#/components/schemas/ConfidenceScore'
      type: object
      required:
        - attribute_identifier
        - requirement_level
        - value_identifier
        - value_raw
        - value_unit
        - value_source
        - reasoning
        - confidence
      title: ExtractedAttributeValue
    AttributeWithValues:
      properties:
        identifier:
          type: string
          title: Identifier
        requirement_level:
          type: string
          title: Requirement Level
        languages:
          $ref: '#/components/schemas/Languages'
        value_count:
          type: integer
          title: Value Count
        values:
          items:
            $ref: '#/components/schemas/Value'
          type: array
          title: Values
      type: object
      required:
        - identifier
        - requirement_level
        - languages
        - value_count
        - values
      title: AttributeWithValues
    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
    ValueSource:
      type: string
      enum:
        - PROVIDED_VALUES
        - PROVIDED_CONTEXT
        - AI_PREDICTED
        - NOT_FOUND
      title: ValueSource
    ConfidenceScore:
      type: string
      enum:
        - LOW
        - MEDIUM
        - HIGH
      title: ConfidenceScore
    Languages:
      properties:
        en:
          anyOf:
            - $ref: '#/components/schemas/LanguageDetails'
            - type: 'null'
        de:
          anyOf:
            - $ref: '#/components/schemas/LanguageDetails'
            - type: 'null'
        fr:
          anyOf:
            - $ref: '#/components/schemas/LanguageDetails'
            - type: 'null'
        it:
          anyOf:
            - $ref: '#/components/schemas/LanguageDetails'
            - type: 'null'
      type: object
      title: Languages
    Value:
      properties:
        identifier:
          type: string
          title: Identifier
        languages:
          $ref: '#/components/schemas/Languages'
      type: object
      required:
        - identifier
        - languages
      title: Value
    LanguageDetails:
      properties:
        name:
          type: string
          title: Name
      type: object
      required:
        - name
      title: LanguageDetails
  securitySchemes:
    APIKey:
      type: apiKey
      in: header
      name: X-Api-Key
    OpenAIKey:
      type: apiKey
      in: header
      name: X-OpenAI-Key

````