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

# Update mentions' smart category value

> <Info>Access to Smart Categories is required to use this endpoint. Contact [support@peakmetrics.com](mailto:support@peakmetrics.com) if you do not have access.</Info>

Overrides labels that the Smart Category AI model applied to existing mentions. Use it to correct a classification you disagree with, so the corrected label is the one used across filters, analytics, exports, the GET APIs, the MCP server, and the workspace UI.

Each update names the label being replaced and the label replacing it, so only that label changes and any other labels on the mention stay in place. You can update many mentions in a single request.

Updates are queued and applied asynchronously. The request is accepted when at least one update is queued, and the response summarizes what was queued alongside any updates that could not be, with an empty list when every update succeeded.

The endpoint is idempotent: sending the same request again leaves the mentions in the same state.

### Rate limits

A limit of **50 requests per minute** applies, scoped to the authenticated team. The minute is a fixed window of 60 seconds from the first request in the window, not a rolling one: once it ends, the count starts again.

Only **2xx responses** count toward the rate limit.

When the limit is exceeded, the endpoint returns a `429` response indicating when it resets.




## OpenAPI

````yaml /api/api_docs.yaml put /mentions/smartCategories
openapi: 3.1.0
info:
  title: PeakMetrics API
  description: >
    The PeakMetrics API provides programmatic access to narrative intelligence
    data.


    Access millions of mentions across news, social media, and online platforms,
    enriched with custom AI-powered

    smart categories and over 50 metadata properties. The API enables you to

    identify, analyze, and act on emerging narratives in real-time.
  version: 2.0.0
servers:
  - url: https://api.peakmetrics.com
    description: Main (production) server
security:
  - BearerAuth: []
tags:
  - name: Authorization
  - name: Workspaces
  - name: Explore
    description: >
      Run an ad-hoc [Explore](/help/get-started-with-peakmetrics/explore) query
      without creating a workspace, and get back Volume Over Time (`POST
      /explore/analytics/timeline`) or a Channel, Language, or Domain
      distribution (`POST /explore/analytics/distribution`).


      Both endpoints use the same Bearer JWT authentication as the rest of the
      API and take their parameters as a JSON body.


      ### Rate limits and quota


      - **5 queries per user per minute**, shared across both Explore endpoints.
      The minute is a fixed window of 60 seconds from the first request in the
      window. Exceeding it returns a `429` with `error: "rate_limited"` and
      `retryAfterSeconds`.

      - **1,000 queries per user per endpoint per month.** Each endpoint has its
      own monthly allowance, which resets at the start of each calendar month
      (UTC). Exceeding it returns a `429` with `error: "quota_exceeded"` and
      `retryAfterSeconds` set to the time until the reset.


      Every request counts toward the per-minute limit; only successful (`200`)
      requests count toward the monthly quota.


      Both limits are shared with the Explore tools in the [PeakMetrics MCP
      server](/mcp/capabilities), so queries your AI assistant runs there count
      toward the same totals.
  - name: Folders
  - name: Channels
  - name: Locations
    description: >
      PeakMetrics resolves a normalized location on mentions across every
      channel, using a

      six-level taxonomy: `region`, `subregion`, `country`, `state`, `county`,
      and `city`.

      `state` and `county` are United States only.


      Look locations up with `GET /locations`, read a mention's resolved
      location from the

      `location` object on `GET /workspaces/{workspaceId}/mentions`, filter the
      mentions,

      timeline, or distribution endpoints with the `locations.<level>`
      parameters, and

      break counts down with the matching `locations.<level>` `group_by` values.
  - name: Custom Channels
  - name: Enrichments
    description: >
      Smart Categories are AI-powered classifiers that label your mentions, such
      as sentiment models, topic classifiers, or violent rhetoric detection.
      List your team's Smart Categories and their labels with `GET
      /smartCategories`, and override a label the model applied to a mention
      with `PUT /mentions/smartCategories`.


      Custom enrichments let you push external context about mentions into
      PeakMetrics,

      attached to individual mentions and used alongside all other mention
      metadata across

      the platform. Once written, enrichment values feed into narrative
      analysis, workspace

      summaries, and notifications, and are available through the customer API
      and the MCP

      server.


      Your team manages its own custom enrichments through the API: create one
      with

      `POST /customEnrichments`, list them with `GET /customEnrichments`, rename
      one or

      replace its option list with `PUT /customEnrichments/{enrichmentId}`,
      retire one with

      `DELETE /customEnrichments/{enrichmentId}`, and push values for individual
      mentions

      with `PUT /mentions/customEnrichments`.
paths:
  /mentions/smartCategories:
    put:
      tags:
        - Enrichments
      summary: Update mentions' smart category value
      description: >
        <Info>Access to Smart Categories is required to use this endpoint.
        Contact [support@peakmetrics.com](mailto:support@peakmetrics.com) if you
        do not have access.</Info>


        Overrides labels that the Smart Category AI model applied to existing
        mentions. Use it to correct a classification you disagree with, so the
        corrected label is the one used across filters, analytics, exports, the
        GET APIs, the MCP server, and the workspace UI.


        Each update names the label being replaced and the label replacing it,
        so only that label changes and any other labels on the mention stay in
        place. You can update many mentions in a single request.


        Updates are queued and applied asynchronously. The request is accepted
        when at least one update is queued, and the response summarizes what was
        queued alongside any updates that could not be, with an empty list when
        every update succeeded.


        The endpoint is idempotent: sending the same request again leaves the
        mentions in the same state.


        ### Rate limits


        A limit of **50 requests per minute** applies, scoped to the
        authenticated team. The minute is a fixed window of 60 seconds from the
        first request in the window, not a rolling one: once it ends, the count
        starts again.


        Only **2xx responses** count toward the rate limit.


        When the limit is exceeded, the endpoint returns a `429` response
        indicating when it resets.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enrichments
              properties:
                enrichments:
                  type: array
                  maxItems: 100
                  minItems: 1
                  description: >
                    An array of up to 100 label overrides.


                    Within one request, each combination of `mention_id` and
                    `enrichment_id` may appear only once. A repeated combination
                    is rejected as an invalid item, and the rest of the batch
                    still queues.
                  items:
                    type: object
                    required:
                      - mention_id
                      - enrichment_id
                      - old_value
                      - new_value
                    properties:
                      mention_id:
                        type: integer
                        description: >-
                          The ID of the mention to update. This is the `id`
                          field from `GET /workspaces/{workspaceId}/mentions`.
                          The mention must already exist in PeakMetrics.
                        example: 7504398580
                      enrichment_id:
                        type: integer
                        description: >-
                          The identifier of the Smart Category, as returned by
                          `GET /smartCategories`. The Smart Category must be
                          accessible to the authenticated team.
                        example: 244
                      old_value:
                        type: string
                        description: >-
                          The category key of the label being replaced, from the
                          Smart Category's `options[].value` in `GET
                          /smartCategories`. The mention must currently carry
                          this label for this Smart Category.
                        example: c2
                      new_value:
                        type: string
                        description: >
                          The category key of the label that replaces
                          `old_value`, from the same Smart Category's
                          `options[].value` in `GET /smartCategories`. Must be
                          different from `old_value`.


                          If the mention already carries `new_value` and no
                          longer carries `old_value`, the update is treated as
                          already applied. It is counted in `queued_count` and
                          leaves the mention unchanged, so retrying a request is
                          safe.
                        example: c0
            examples:
              single:
                summary: Override one label on one mention
                value:
                  enrichments:
                    - mention_id: 7504398580
                      enrichment_id: 244
                      old_value: c2
                      new_value: c0
              bulk:
                summary: Override labels on several mentions
                value:
                  enrichments:
                    - mention_id: 7504398580
                      enrichment_id: 244
                      old_value: c2
                      new_value: c0
                    - mention_id: 7504391234
                      enrichment_id: 244
                      old_value: c0
                      new_value: c1
      responses:
        '202':
          description: >
            At least one update passed validation and has been queued for
            processing. Invalid items (if any) appear in the `errors` array.
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    type: object
                    properties:
                      queued_count:
                        type: integer
                        description: The number of updates successfully queued.
                        example: 12
                      invalid_count:
                        type: integer
                        description: The number of updates that failed validation.
                        example: 0
                  errors:
                    type: array
                    description: >-
                      Always present. Each entry describes a failed update. An
                      empty array when `invalid_count` is `0`.
                    items:
                      type: object
                      properties:
                        enrichment:
                          type: object
                          description: The original enrichment object from the request.
                          properties:
                            mention_id:
                              type: integer
                            enrichment_id:
                              type: integer
                            old_value:
                              type: string
                            new_value:
                              type: string
                        message:
                          type: string
                          description: Human-readable error message.
                          example: >-
                            `mention_id` 456 not found in the enrichable window
                            (mentions since 2025-10)
              examples:
                all_queued:
                  summary: Every update queued
                  value:
                    summary:
                      queued_count: 2
                      invalid_count: 0
                    errors: []
                partial_success:
                  summary: Partial success, some updates queued and one failed
                  value:
                    summary:
                      queued_count: 12
                      invalid_count: 1
                    errors:
                      - enrichment:
                          mention_id: 456
                          enrichment_id: 244
                          old_value: c2
                          new_value: c0
                        message: >-
                          `mention_id` 456 not found in the enrichable window
                          (mentions since 2025-10)
        '400':
          description: >
            Zero updates could be queued. All items in the request failed
            validation. Common causes:


            - `mention_id` is not found in the enrichable window

            - `enrichment_id` does not exist or is not accessible by the
            authenticated team

            - `old_value` or `new_value` is not one of the Smart Category's
            labels

            - The mention does not carry `old_value` (or `new_value`) for the
            Smart Category

            - `old_value` and `new_value` are the same
          content:
            application/json:
              schema:
                type: object
                properties:
                  summary:
                    type: object
                    properties:
                      queued_count:
                        type: integer
                        example: 0
                      invalid_count:
                        type: integer
                        example: 3
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        enrichment:
                          type: object
                          properties:
                            mention_id:
                              type: integer
                            enrichment_id:
                              type: integer
                            old_value:
                              type: string
                            new_value:
                              type: string
                        message:
                          type: string
              examples:
                all_invalid:
                  summary: All items failed validation
                  value:
                    summary:
                      queued_count: 0
                      invalid_count: 4
                    errors:
                      - enrichment:
                          mention_id: 7504398580
                          enrichment_id: 243
                          old_value: c2
                          new_value: c0
                        message: '`enrichment_id` 243 does not exist'
                      - enrichment:
                          mention_id: 456
                          enrichment_id: 244
                          old_value: c2
                          new_value: c0
                        message: >-
                          `mention_id` 456 not found in the enrichable window
                          (mentions since 2025-10)
                      - enrichment:
                          mention_id: 7504391234
                          enrichment_id: 244
                          old_value: c2
                          new_value: c9
                        message: '`new_value` c9 is not a label of `enrichment_id` 244'
                      - enrichment:
                          mention_id: 123
                          enrichment_id: 244
                          old_value: c2
                          new_value: c0
                        message: >-
                          `mention_id` 123 does not carry `old_value` c2 for
                          `enrichment_id` 244
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                unauthorized:
                  summary: Missing or invalid access token
                  value:
                    error: Missing or invalid access token
        '403':
          description: >-
            Your team does not have access to Smart Categories. Contact
            support@peakmetrics.com to request access.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                forbidden:
                  summary: No access to Smart Categories
                  value:
                    error: User does not have access to smart categories
        '413':
          description: >-
            The request body is larger than 2 MB. Split the updates across
            several requests.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                payload_too_large:
                  summary: Request body too large
                  value:
                    error: Request body is larger than 2 MB
        '429':
          description: >
            The team's rate limit of 50 requests per minute has been exceeded.
            The response indicates when the limit resets. Only 2xx responses
            count toward the rate limit.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  retryAfter:
                    type: integer
                    description: Seconds until the limit resets.
              examples:
                rate_limited:
                  summary: Per-minute rate limit exceeded
                  value:
                    error: 'Rate limit exceeded: 50 requests per minute'
                    retryAfter: 45
        '500':
          description: >-
            The update could not be completed. When none of the updates could be
            queued for processing, the response uses the same `summary` and
            `errors` envelope as `202` and `400`. When PeakMetrics cannot look
            up mentions, the response is a single `error`.
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.