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

# Update a tracked keyword



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/tracked-keywords/{id}
openapi: 3.0.0
info:
  title: Amazonomics API
  version: 0.0.1
  description: The Amazonomics REST API. All endpoints need an API key.
servers:
  - url: https://api.amazonomics.com
security:
  - bearerAuth: []
paths:
  /v1/tracked-keywords/{id}:
    patch:
      tags:
        - TrackedKeywords
      summary: Update a tracked keyword
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                notes:
                  type: string
                  nullable: true
                priorityRule:
                  $ref: '#/components/schemas/PriorityRule'
                priorityEnabled:
                  type: boolean
                isActive:
                  type: boolean
      responses:
        '200':
          description: Tracked keyword updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/TrackedKeyword'
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      hint:
                        type: string
                      docs:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - data
                  - error
        '400':
          description: Invalid parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      hint:
                        type: string
                      docs:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - data
                  - error
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      hint:
                        type: string
                      docs:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - data
                  - error
        '404':
          description: Tracked keyword not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      hint:
                        type: string
                      docs:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - data
                  - error
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      hint:
                        type: string
                      docs:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - data
                  - error
components:
  schemas:
    PriorityRule:
      type: object
      nullable: true
      properties:
        field:
          $ref: '#/components/schemas/PriorityRuleField'
        operator:
          $ref: '#/components/schemas/PriorityRuleOperator'
        value:
          type: integer
      required:
        - field
        - operator
        - value
    TrackedKeyword:
      type: object
      properties:
        id:
          type: string
          format: uuid
        created_at:
          type: string
        updated_at:
          type: string
        notes:
          type: string
          nullable: true
        is_active:
          type: boolean
        priority_enabled:
          type: boolean
        priority_rule:
          $ref: '#/components/schemas/PriorityRule'
        search_term:
          type: object
          properties:
            id:
              type: integer
            original_term:
              type: string
          required:
            - id
            - original_term
        snapshot:
          type: object
          nullable: true
          properties:
            latest_period:
              type: string
              nullable: true
            latest_rank:
              type: integer
              nullable: true
            previous_rank:
              type: integer
              nullable: true
            rank_change:
              type: integer
              nullable: true
            best_rank:
              type: integer
              nullable: true
            worst_rank:
              type: integer
              nullable: true
            avg_rank:
              type: number
              nullable: true
            total_periods:
              type: integer
              nullable: true
            history:
              type: array
              items:
                type: object
                properties:
                  period:
                    type: string
                  rank:
                    type: integer
                    nullable: true
                required:
                  - period
                  - rank
              default: []
          required:
            - latest_period
            - latest_rank
            - previous_rank
            - rank_change
            - best_rank
            - worst_rank
            - avg_rank
            - total_periods
      required:
        - id
        - created_at
        - updated_at
        - notes
        - is_active
        - priority_enabled
        - priority_rule
        - search_term
        - snapshot
    PriorityRuleField:
      type: string
      enum:
        - latest_rank
        - rank_change
    PriorityRuleOperator:
      type: string
      enum:
        - <
        - <=
        - '='
        - '>='
        - '>'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````