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

# Implement suggestions for a campaign optimization

> 
Implements the latest optimization suggestions for a campaign optimization.
Required permission: `write:analysis`.

**Platform-Specific Behavior:**

**Google Ads:**
- The `details` field is optional and can contain an `asset_groups` array to filter which asset groups to process.
- If `details.asset_groups` is provided, only suggestions for the specified asset groups will be implemented.
- If `details` is omitted or `asset_groups` is not specified, all suggestions will be implemented.
- Partial failures are handled gracefully: if one asset group fails, the others still proceed.

**TikTok:**
- The `details` field is not used and can be omitted.
- All ad groups specified in `campaign_optimization.campaign.ad_group_ids` will be updated.

**Response Body (Google Ads):**
```json
{
  "updated_count": 2,
  "total_asset_groups": 3,
  "results": [
    { "asset_group_id": "6476435676", "status": "success" },
    { "asset_group_id": "6481074503", "status": "success" },
    { "asset_group_id": "6477355033", "status": "failed", "error": "Failed to add search theme 'xyz'" }
  ]
}
```
Response fields:
- `updated_count` (int): Number of asset groups where all suggestions were applied successfully.
- `total_asset_groups` (int): Total number of asset groups in the suggestion (not just those requested via `details`).
- `results` (array): Per-asset-group outcome.
  - `asset_group_id` (string): The asset group ID.
  - `status` (string): `success` or `failed`.
  - `error` (string, optional): Error message, only present when `status` is `failed`.




## OpenAPI

````yaml https://openapi.shareofmodel.ai/swagger.json post /v1/organizations/{organization_id}/workspaces/{workspace_id}/campaign_optimizations/{id}/implement_suggestions
openapi: 3.0.3
info:
  title: Share Of Model API
  version: v1
  description: >-
    ## Model Context Protocol (MCP)


    In addition to this REST API, Share of Model exposes a **Model Context
    Protocol** server that lets AI assistants (Claude Desktop, Claude Code, MCP
    Inspector, custom agents…) call our endpoints directly as tools. Any
    MCP-compatible client can interact with Share of Model without writing
    custom integration code — connect once with your usual login and start
    asking the assistant to query the data for you.


    ### Connecting from Claude Desktop


    Open **Settings → Connectors**, scroll to the bottom and click **Add custom
    connector**, then paste `https://mcp.shareofmodel.ai/mcp/`. A browser window
    opens for you to log in with your Share of Model account (same login as the
    web app), and the assistant gains access to the tools.


    ### Connecting from Claude Code


    ```bash

    claude mcp add --transport http share-of-model
    https://mcp.shareofmodel.ai/mcp/

    ```


    The first time you call a tool, Claude Code opens your browser to complete
    the login.


    ### Connecting from MCP Inspector


    ```bash

    npx @modelcontextprotocol/inspector

    ```


    In the Inspector UI, pick **Streamable HTTP** as transport, paste
    `https://mcp.shareofmodel.ai/mcp/`, and click **Connect**. The first
    connection prompts you to log in.


    ### Available tools


    Only endpoints tagged `mcp` in this OpenAPI spec are exposed as MCP tools,
    and only read-only (`GET`) routes are exposed. Everything tagged `mcp` below
    is callable from any compliant MCP client.


    ### Example prompts


    Once connected, try asking your assistant things like:


    - _"List the workspaces I have access to."_

    - _"Show me the latest searches in workspace X."_

    - _"Compare the share of model between brand A and brand B over the last 30
    days."_


    For more details on the protocol itself, see the [Model Context Protocol
    specification](https://modelcontextprotocol.io/).
servers:
  - description: Production API
    url: https://api.shareofmodel.ai/
  - description: Development API
    url: https://api.dev.shareofmodel.ai/
security: []
tags:
  - name: Auth
    description: Endpoints needed for API authentication.
  - name: Organizations
    description: Endpoints related to organizations, to list all available organizations.
  - name: Workspaces
    description: Endpoints related to workspaces, to list all available workspaces.
  - name: Analyses
    description: Endpoints related to analyses and analyses management.
  - name: Asset Evaluations
    description: Endpoints related to assets and asset evaluations.
  - name: Brand Catalog
    description: Endpoints related to general brand information.
  - name: Content Briefs
    description: Endpoints related to content briefs generation and optimisation.
  - name: Metrics
    description: >+
      Endpoints related to brand metrics.


      **LEXICON**



      **Brand Awareness**: What opinion the LLMs have concerning specific
      brands, related to certain categories.



      **Brand Perception**: The general sentiment of the LLMs towards a brand,

      based on the pros and cons they mention.

paths:
  /v1/organizations/{organization_id}/workspaces/{workspace_id}/campaign_optimizations/{id}/implement_suggestions:
    post:
      tags:
        - Campaign Optimizations
      summary: Implement suggestions for a campaign optimization
      description: >

        Implements the latest optimization suggestions for a campaign
        optimization.

        Required permission: `write:analysis`.


        **Platform-Specific Behavior:**


        **Google Ads:**

        - The `details` field is optional and can contain an `asset_groups`
        array to filter which asset groups to process.

        - If `details.asset_groups` is provided, only suggestions for the
        specified asset groups will be implemented.

        - If `details` is omitted or `asset_groups` is not specified, all
        suggestions will be implemented.

        - Partial failures are handled gracefully: if one asset group fails, the
        others still proceed.


        **TikTok:**

        - The `details` field is not used and can be omitted.

        - All ad groups specified in
        `campaign_optimization.campaign.ad_group_ids` will be updated.


        **Response Body (Google Ads):**

        ```json

        {
          "updated_count": 2,
          "total_asset_groups": 3,
          "results": [
            { "asset_group_id": "6476435676", "status": "success" },
            { "asset_group_id": "6481074503", "status": "success" },
            { "asset_group_id": "6477355033", "status": "failed", "error": "Failed to add search theme 'xyz'" }
          ]
        }

        ```

        Response fields:

        - `updated_count` (int): Number of asset groups where all suggestions
        were applied successfully.

        - `total_asset_groups` (int): Total number of asset groups in the
        suggestion (not just those requested via `details`).

        - `results` (array): Per-asset-group outcome.
          - `asset_group_id` (string): The asset group ID.
          - `status` (string): `success` or `failed`.
          - `error` (string, optional): Error message, only present when `status` is `failed`.
      operationId: implement_suggestions
      parameters:
        - in: path
          name: campaign_optimization_id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying the campaign optimization.
          required: true
        - in: query
          name: format
          schema:
            type: string
            enum:
              - csv
              - json
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this campaign optimization.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          required: true
        - in: path
          name: workspace_id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImplementSuggestionsRequest'
            examples:
              GoogleAds-AllAssetGroups:
                value: {}
                summary: Implement suggestions for all asset groups (Google Ads)
              GoogleAds-FilteredAssetGroups:
                value:
                  details:
                    asset_groups:
                      - '6574388623'
                      - '9876543210'
                summary: Implement suggestions for specific asset groups (Google Ads)
              TikTok-AllAdGroups:
                value: {}
                summary: Implement suggestions for all ad groups (TikTok)
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ImplementSuggestionsRequest'
            examples:
              GoogleAds-AllAssetGroups:
                value: {}
                summary: Implement suggestions for all asset groups (Google Ads)
              GoogleAds-FilteredAssetGroups:
                value:
                  details:
                    asset_groups:
                      - '6574388623'
                      - '9876543210'
                summary: Implement suggestions for specific asset groups (Google Ads)
              TikTok-AllAdGroups:
                value: {}
                summary: Implement suggestions for all ad groups (TikTok)
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImplementSuggestionsRequest'
            examples:
              GoogleAds-AllAssetGroups:
                value: {}
                summary: Implement suggestions for all asset groups (Google Ads)
              GoogleAds-FilteredAssetGroups:
                value:
                  details:
                    asset_groups:
                      - '6574388623'
                      - '9876543210'
                summary: Implement suggestions for specific asset groups (Google Ads)
              TikTok-AllAdGroups:
                value: {}
                summary: Implement suggestions for all ad groups (TikTok)
          '*/*':
            schema:
              $ref: '#/components/schemas/ImplementSuggestionsRequest'
            examples:
              GoogleAds-AllAssetGroups:
                value: {}
                summary: Implement suggestions for all asset groups (Google Ads)
              GoogleAds-FilteredAssetGroups:
                value:
                  details:
                    asset_groups:
                      - '6574388623'
                      - '9876543210'
                summary: Implement suggestions for specific asset groups (Google Ads)
              TikTok-AllAdGroups:
                value: {}
                summary: Implement suggestions for all ad groups (TikTok)
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImplementSuggestionsResponse'
            text/csv:
              schema:
                $ref: '#/components/schemas/ImplementSuggestionsResponse'
          description: >-
            Suggestions implemented. Body: updated_count, total_asset_groups,
            results[].
        '400':
          description: Invalid input data.
        '404':
          description: Campaign Optimization not found.
        '500':
          description: Failed to implement suggestions.
      security:
        - Bearer: []
components:
  schemas:
    ImplementSuggestionsRequest:
      type: object
      properties:
        details:
          description: Platform-specific details for implementing suggestions.
    ImplementSuggestionsResponse:
      type: object
      properties:
        updated_count:
          type: integer
        total_asset_groups:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/ImplementSuggestionsResultItem'
      required:
        - results
        - total_asset_groups
        - updated_count
    ImplementSuggestionsResultItem:
      type: object
      properties:
        asset_group_id:
          type: string
        status:
          enum:
            - success
            - failed
          type: string
          description: |-
            * `success` - success
            * `failed` - failed
          x-spec-enum-id: 80b52ca865e0262f
        error:
          type: string
      required:
        - asset_group_id
        - status
  securitySchemes:
    Bearer:
      type: apiKey
      in: header
      name: Authorization

````