> ## 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.

# List platform integration campaigns for a given account

> 
    Make a call to external platform API to retrieve a list of campaigns available for the given account.

    **Response Format:**
    - **Google Ads**: Returns asset groups (campaigns). The `details` field is `null`.
    - **TikTok**: Returns campaigns with their associated ad groups. Each item represents one search campaign.
      The `details` field contains:
      ```json
      {
        "ad_groups": [
          {
            "id": "string",
            "name": "string"
          }
        ]
      }
      ```

    **TikTok Response Structure:**
    - `id`: Campaign ID (unique identifier for the campaign)
    - `name`: Campaign name
    - `campaign_id`: Campaign ID
    - `details.ad_groups`: List of ad group objects, each containing:
      - `id`: Ad group ID
      - `name`: Ad group name

    Note: Campaigns with no ad groups are skipped for TikTok.
    



## OpenAPI

````yaml https://openapi.shareofmodel.ai/swagger.json post /v1/organizations/{organization_id}/workspaces/{workspace_id}/platform_integrations/{id}/campaigns
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}/platform_integrations/{id}/campaigns:
    post:
      tags:
        - Platform Integrations
      summary: List platform integration campaigns for a given account
      description: |2-

            Make a call to external platform API to retrieve a list of campaigns available for the given account.

            **Response Format:**
            - **Google Ads**: Returns asset groups (campaigns). The `details` field is `null`.
            - **TikTok**: Returns campaigns with their associated ad groups. Each item represents one search campaign.
              The `details` field contains:
              ```json
              {
                "ad_groups": [
                  {
                    "id": "string",
                    "name": "string"
                  }
                ]
              }
              ```

            **TikTok Response Structure:**
            - `id`: Campaign ID (unique identifier for the campaign)
            - `name`: Campaign name
            - `campaign_id`: Campaign ID
            - `details.ad_groups`: List of ad group objects, each containing:
              - `id`: Ad group ID
              - `name`: Ad group name

            Note: Campaigns with no ad groups are skipped for TikTok.
            
      operationId: getPlatformIntegrationCampaigns
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this platform integration.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying the organization.
          required: true
        - in: path
          name: workspace_id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying the workspace.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account_id:
                  type: string
                  description: The ID of the account.
              required:
                - account_id
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ExternalPlatformCampaign'
          description: >-
            A list of campaigns associated with the account. For TikTok, each
            campaign includes its ad groups in the details field.
        '400':
          description: Platform integration ID or account ID is required.
        '404':
          description: Workspace or platform integration not found.
        '500':
          description: An error occurred while fetching campaigns.
      security:
        - Bearer: []
components:
  schemas:
    ExternalPlatformCampaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        platform:
          type: string
        account_id:
          type: string
        campaign_id:
          type: string
        platform_integration_id:
          type: string
          description: The ID of the platform integration associated with this account.
        details:
          type: object
          additionalProperties: {}
          nullable: true
      required:
        - account_id
        - campaign_id
        - id
        - name
        - platform
        - platform_integration_id
  securitySchemes:
    Bearer:
      type: apiKey
      in: header
      name: Authorization

````