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

# Update Competitor



## OpenAPI

````yaml /openapi.json patch /api/v1/brands/{brand_id}/competitors/{comp_id}
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/competitors/{comp_id}:
    patch:
      tags:
        - Brands
        - Brands
      summary: Update Competitor
      operationId: update_competitor_api_v1_brands__brand_id__competitors__comp_id__patch
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Brand Id
        - name: comp_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Comp Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BrandCompetitorUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MergedCompetitorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BrandCompetitorUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Name
        website_url:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 5
            - type: 'null'
          title: Website Url
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        content_url:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 5
            - type: 'null'
          title: Content Url
        youtube_channel_url:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 5
            - type: 'null'
          title: Youtube Channel Url
        is_starred:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Starred
      type: object
      title: BrandCompetitorUpdate
    MergedCompetitorResponse:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        brand_id:
          type: string
          format: uuid
          title: Brand Id
        name:
          type: string
          title: Name
        website_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Website Url
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        content_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Url
        youtube_channel_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Youtube Channel Url
        is_starred:
          type: boolean
          title: Is Starred
          default: false
        social_links:
          additionalProperties: true
          type: object
          title: Social Links
        analysis_data:
          additionalProperties: true
          type: object
          title: Analysis Data
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        source:
          type: string
          enum:
            - seo_discovery
            - brand_kit
          title: Source
          default: seo_discovery
      type: object
      required:
        - brand_id
        - name
      title: MergedCompetitorResponse
      description: |-
        A competitor entry merged from SEO discoveries and brand-kit names.

        Brand-kit-sourced entries lack id, website_url, description, notes, and
        timestamps — they're synthesized from a string in BrandKit.competitors.
        The frontend should branch on ``source`` to decide which actions to
        expose (star/edit/delete only work on entries with an ``id``).

        ``source`` defaults to ``"seo_discovery"`` so this schema can also be
        returned directly from add/update routes that operate on the
        ``brand_competitors`` table — those endpoints always produce SEO rows.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````