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

# Update Recommendation

> Update a recommendation's text (only for Headlines and Descriptions).



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json put /api/v1/analysis/recommendations/{analysis_type}/{recommendation_id}/update
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/analysis/recommendations/{analysis_type}/{recommendation_id}/update:
    put:
      tags:
        - Analysis
      summary: Update Recommendation
      description: Update a recommendation's text (only for Headlines and Descriptions).
      operationId: >-
        update_recommendation_api_v1_analysis_recommendations__analysis_type___recommendation_id__update_put
      parameters:
        - name: analysis_type
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/AnalysisTypes'
        - name: recommendation_id
          in: path
          required: true
          schema:
            type: integer
            title: Recommendation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRecommendationSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseRecommendationSchemaUnion'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AnalysisTypes:
      type: string
      enum:
        - keyword_pause
        - negative_keyword
        - double_check_keywords_to_pause
        - headline
        - description
        - budget_migration
        - pause_hours
        - pause_locations
        - search_terms
      title: AnalysisTypes
      description: The types of analyses.
    UpdateRecommendationSchema:
      properties:
        user_updated_text:
          type: string
          title: User Updated Text
      type: object
      required:
        - user_updated_text
      title: UpdateRecommendationSchema
      description: The schema for updating a recommendation text.
    BaseRecommendationSchemaUnion:
      anyOf:
        - $ref: '#/components/schemas/RecommendedNegativeKeywordsSchema'
        - $ref: '#/components/schemas/RecommendKeywordPauseSchema'
        - $ref: '#/components/schemas/RecommendedHeadlineSchema'
        - $ref: '#/components/schemas/RecommendedDescriptionSchema'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RecommendedNegativeKeywordsSchema:
      properties:
        status:
          $ref: '#/components/schemas/RecommendationStatus'
          title: The status of the recommendation
        is_manually_generated:
          type: boolean
          title: Whether the recommendation was manually generated
        date_regenerated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was regenerated
        date_added:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was added
        date_updated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was updated
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        keyword:
          type: string
          title: The keyword
        match_type:
          type: string
          title: The match type
        reason:
          type: string
          title: The reason
        budget_saving:
          anyOf:
            - type: number
            - type: 'null'
          title: The estimated budget saving from applying this negative keyword
        campaign:
          $ref: '#/components/schemas/KeywordCampaignSchema'
          title: The campaign
      type: object
      required:
        - status
        - is_manually_generated
        - keyword
        - match_type
        - reason
        - campaign
      title: RecommendedNegativeKeywordsSchema
      description: The schema for recommended negative keywords.
    RecommendKeywordPauseSchema:
      properties:
        status:
          $ref: '#/components/schemas/RecommendationStatus'
          title: The status of the recommendation
        is_manually_generated:
          type: boolean
          title: Whether the recommendation was manually generated
        date_regenerated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was regenerated
        date_added:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was added
        date_updated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was updated
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        keyword_id:
          type: integer
          title: The ID of the keyword
        keyword_text:
          type: string
          title: The text of the keyword
        reason:
          type: string
          title: The reason for the recommendation
        budget_saving:
          anyOf:
            - type: number
            - type: 'null'
          title: The estimated budget saving from pausing this keyword
        metrics_snapshot:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: The metrics snapshot
        campaign:
          $ref: '#/components/schemas/KeywordCampaignSchema'
          title: The campaign
        is_rejected_by_gemini:
          type: boolean
          title: Whether the recommendation was rejected by Gemini
        gemini_rejected_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for rejection by Gemini
        is_rejected_by_user:
          type: boolean
          title: Whether the recommendation was rejected by the user
        user_rejected_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for rejection by the user
      type: object
      required:
        - status
        - is_manually_generated
        - keyword_id
        - keyword_text
        - reason
        - campaign
        - is_rejected_by_gemini
        - is_rejected_by_user
      title: RecommendKeywordPauseSchema
      description: The schema for a recommended keyword pause.
    RecommendedHeadlineSchema:
      properties:
        status:
          $ref: '#/components/schemas/RecommendationStatus'
          title: The status of the recommendation
        is_manually_generated:
          type: boolean
          title: Whether the recommendation was manually generated
        date_regenerated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was regenerated
        date_added:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was added
        date_updated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was updated
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        ad:
          anyOf:
            - $ref: '#/components/schemas/AdSchema'
            - type: 'null'
          title: The ad
        text:
          type: string
          title: The text of the headline
        reason:
          type: string
          title: The reason for the recommendation
        user_updated_text:
          anyOf:
            - type: string
            - type: 'null'
          title: The user updated text
      type: object
      required:
        - status
        - is_manually_generated
        - ad
        - text
        - reason
      title: RecommendedHeadlineSchema
      description: The schema for a recommended headline.
    RecommendedDescriptionSchema:
      properties:
        status:
          $ref: '#/components/schemas/RecommendationStatus'
          title: The status of the recommendation
        is_manually_generated:
          type: boolean
          title: Whether the recommendation was manually generated
        date_regenerated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was regenerated
        date_added:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was added
        date_updated:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The date the recommendation was updated
        id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Id
        ad:
          anyOf:
            - $ref: '#/components/schemas/AdSchema'
            - type: 'null'
          title: The ad
        text:
          type: string
          title: The text of the headline
        reason:
          type: string
          title: The reason for the recommendation
        user_updated_text:
          anyOf:
            - type: string
            - type: 'null'
          title: The user updated text
      type: object
      required:
        - status
        - is_manually_generated
        - ad
        - text
        - reason
      title: RecommendedDescriptionSchema
      description: The schema for a recommended description.
    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
    RecommendationStatus:
      type: string
      enum:
        - pending
        - applied
        - auto_applied
        - rejected
      title: RecommendationStatus
      description: The status of a recommendation.
    KeywordCampaignSchema:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        channel_type:
          anyOf:
            - $ref: '#/components/schemas/GoogleCampaignChannelType'
            - type: 'null'
      type: object
      required:
        - id
        - name
      title: KeywordCampaignSchema
      description: Schema for campaign information related to a keyword
    AdSchema:
      properties:
        id:
          type: integer
          title: The ID of the ad
        google_ads_ad_group:
          $ref: '#/components/schemas/api__chat__schemas__AdGroupSchema'
          title: The ad group to which the ad belongs
        type:
          type: string
          title: The type of the ad
        final_url:
          type: string
          title: The final URL of the ad
      type: object
      required:
        - id
        - google_ads_ad_group
        - type
        - final_url
      title: AdSchema
      description: Schema for Ad data
    GoogleCampaignChannelType:
      type: string
      enum:
        - SEARCH
        - DISPLAY
        - SHOPPING
        - VIDEO
        - APP
        - PERFORMANCE_MAX
        - LOCAL
        - SMART
        - LOCAL_SERVICES
        - DEMAND_GEN
        - DISCOVERY
      title: GoogleCampaignChannelType
    api__chat__schemas__AdGroupSchema:
      properties:
        id:
          type: integer
          title: The ID of the ad group
        google_ads_campaign:
          $ref: '#/components/schemas/CampaignSchema'
          title: The campaign to which the ad group belongs
        name:
          type: string
          title: The name of the ad group
        status:
          type: string
          title: The status of the ad group
        type:
          type: string
          title: The type of the ad group
      type: object
      required:
        - id
        - google_ads_campaign
        - name
        - status
        - type
      title: AdGroupSchema
      description: Schema for Ad Group data
    CampaignSchema:
      properties:
        id:
          type: integer
          title: The ID of the campaign
        google_ads_customer_id:
          type: integer
          title: The ID of the Google Ads customer
        name:
          type: string
          title: The name of the campaign
        status:
          type: string
          title: The status of the campaign
        channel_type:
          anyOf:
            - type: string
            - type: 'null'
          title: The channel type of the campaign
        start_date:
          type: string
          format: date-time
          title: The start date of the campaign
        end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The end date of the campaign
      type: object
      required:
        - id
        - google_ads_customer_id
        - name
        - status
        - start_date
      title: CampaignSchema
      description: Schema for Campaign data
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````