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

# Create Ad Set Enhanced

> Create a new ad set with advanced validation and helpful error messages. Specify campaign, name, budget (daily or lifetime), optimization goal, billing event, targeting, and promoted object if required by the campaign objective. The build is validated against known Meta platform rules (objective x conversion-event compatibility, campaign-level vs ad-set budget, EU/DSA requirements) before any API call — a validation failure explains the fix. Omit the ad-set budget when the campaign holds the budget (CBO). Returns the new ad set ID and summary, or detailed error guidance if creation fails.



## OpenAPI

````yaml /api-reference/openapi.yaml post /meta/mcp#create_ad_set_enhanced
openapi: 3.1.0
info:
  title: Multi-Source Ads API
  version: 1.0.0
  description: >-
    Unified API for managing ad campaigns across Meta, LinkedIn, and Google. MCP
    tools are accessed via JSON-RPC 2.0 over HTTP (`POST /{source}/mcp`). Google
    Sheets/Drive endpoints use standard REST.
servers:
  - url: https://api.adside.ai
    description: Production
  - url: http://localhost:3100
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: ''
  - name: Ads
    description: ''
  - name: Analytics
    description: ''
  - name: Asset Groups
    description: ''
  - name: Assets
    description: ''
  - name: Audiences
    description: ''
  - name: Campaign Groups
    description: ''
  - name: Campaigns
    description: ''
  - name: Conversions
    description: ''
  - name: Creatives
    description: ''
  - name: Drive
    description: ''
  - name: Google
    description: ''
  - name: Google Ads
    description: ''
  - name: Google Tag Manager
    description: ''
  - name: Keywords
    description: ''
  - name: Linkedin
    description: ''
  - name: Meta
    description: ''
  - name: Meta Reporting
    description: ''
  - name: OAuth
    description: ''
  - name: Other
    description: ''
  - name: Reports
    description: ''
  - name: Sheets
    description: ''
  - name: Targeting
    description: ''
  - name: Tiktok
    description: ''
  - name: Workspace
    description: ''
paths:
  /meta/mcp#create_ad_set_enhanced:
    post:
      tags:
        - Meta
        - Ads
      summary: Create Ad Set Enhanced
      description: >-
        Create a new ad set with advanced validation and helpful error messages.
        Specify campaign, name, budget (daily or lifetime), optimization goal,
        billing event, targeting, and promoted object if required by the
        campaign objective. The build is validated against known Meta platform
        rules (objective x conversion-event compatibility, campaign-level vs
        ad-set budget, EU/DSA requirements) before any API call — a validation
        failure explains the fix. Omit the ad-set budget when the campaign holds
        the budget (CBO). Returns the new ad set ID and summary, or detailed
        error guidance if creation fails.
      operationId: meta_create_ad_set_enhanced
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  const: '2.0'
                id:
                  type: string
                  example: '1'
                method:
                  type: string
                  const: tools/call
                params:
                  type: object
                  required:
                    - name
                    - arguments
                  properties:
                    name:
                      type: string
                      const: create_ad_set_enhanced
                    arguments:
                      $ref: '#/components/schemas/meta_create_ad_set_enhanced_input'
      responses:
        '200':
          description: JSON-RPC response with tool result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpToolResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Channel not connected or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    meta_create_ad_set_enhanced_input:
      type: object
      properties:
        campaign_id:
          type: string
          description: Campaign ID for the ad set
        name:
          type: string
          minLength: 1
          description: Ad set name
        daily_budget:
          description: Daily budget in account-currency cents (e.g. 1000 = $10.00).
          type: number
          exclusiveMinimum: 0
        lifetime_budget:
          description: Lifetime budget in account-currency cents (e.g. 20000 = $200.00).
          type: number
          exclusiveMinimum: 0
        optimization_goal:
          type: string
          description: Optimization goal (e.g., LINK_CLICKS, CONVERSIONS)
        billing_event:
          type: string
          description: Billing event (e.g., LINK_CLICKS, IMPRESSIONS)
        bid_amount:
          description: >-
            Bid amount in account-currency cents (e.g. 100 = $1.00). For ads
            with IMPRESSIONS or REACH billing_event the bid is per 1,000
            occurrences; for other billing_events it is per occurrence. REQUIRED
            by Meta when the parent campaign's bid_strategy is
            LOWEST_COST_WITH_BID_CAP, COST_CAP, or TARGET_COST — pass an
            explicit value to set a deliberate cap; if omitted the tool defaults
            it to the budget (budget-as-cap), which is rarely the intended bid.
          type: number
          exclusiveMinimum: 0
        start_time:
          description: Ad set start time (ISO 8601 format)
          type: string
        end_time:
          description: Ad set end time (ISO 8601 format)
          type: string
        promoted_object:
          description: >-
            Object being promoted - required for certain campaign objectives
            like OUTCOME_TRAFFIC
          type: object
          properties:
            page_id:
              description: Facebook Page ID to promote
              type: string
            pixel_id:
              description: Facebook Pixel ID for tracking
              type: string
            application_id:
              description: Application ID for app promotion
              type: string
            object_store_url:
              description: App store URL for app promotion
              type: string
            custom_event_type:
              description: >-
                Conversion event to optimise towards, paired with pixel_id. Note
                the past-tense spelling INITIATED_CHECKOUT — the pixel calls the
                same event InitiateCheckout and reporting calls it
                initiate_checkout, and neither is accepted here.
              type: string
              enum:
                - AD_IMPRESSION
                - RATE
                - TUTORIAL_COMPLETION
                - CONTACT
                - CUSTOMIZE_PRODUCT
                - DONATE
                - FIND_LOCATION
                - SCHEDULE
                - START_TRIAL
                - SUBMIT_APPLICATION
                - SUBSCRIBE
                - ADD_TO_CART
                - ADD_TO_WISHLIST
                - INITIATED_CHECKOUT
                - ADD_PAYMENT_INFO
                - PURCHASE
                - LEAD
                - COMPLETE_REGISTRATION
                - CONTENT_VIEW
                - SEARCH
                - SERVICE_BOOKING_REQUEST
                - MESSAGING_CONVERSATION_STARTED_7D
                - LEVEL_ACHIEVED
                - ACHIEVEMENT_UNLOCKED
                - SPENT_CREDITS
                - LISTING_INTERACTION
                - D2_RETENTION
                - D7_RETENTION
                - OTHER
        attribution_spec:
          description: Attribution specification for tracking conversions
          type: array
          items:
            type: object
            properties:
              event_type:
                default: CLICK_THROUGH
                type: string
                enum:
                  - CLICK_THROUGH
                  - VIEW_THROUGH
              window_days:
                default: 1
                type: number
                minimum: 1
                maximum: 90
        destination_type:
          description: Destination type for traffic campaigns
          type: string
          enum:
            - WEBSITE
            - ON_AD
            - FACEBOOK
            - INSTAGRAM
            - MESSENGER
            - WHATSAPP
            - UNDEFINED
        is_dynamic_creative:
          description: Whether to use dynamic creative optimization
          type: boolean
        use_new_app_click:
          description: Whether to use new app click attribution
          type: boolean
        configured_status:
          description: Configured status field
          type: string
          enum:
            - ACTIVE
            - PAUSED
        optimization_sub_event:
          description: Optimization sub-event
          type: string
          enum:
            - NONE
            - VIDEO_PLAY
            - APP_INSTALL
            - LINK_CLICK
            - LEAD_GROUPED
            - PURCHASE
        recurring_budget_semantics:
          description: Recurring budget semantics
          type: boolean
        targeting:
          default:
            geo_locations:
              countries:
                - US
              location_types:
                - home
                - recent
          description: Targeting parameters - defaults to US if not specified
          type: object
          properties:
            age_min:
              description: Minimum age for targeting
              type: number
              minimum: 13
              maximum: 65
            age_max:
              description: Maximum age for targeting
              type: number
              minimum: 13
              maximum: 65
            genders:
              description: Gender targeting (1=male, 2=female)
              type: array
              items:
                type: number
                minimum: 1
                maximum: 2
            geo_locations:
              description: Geographic targeting
              type: object
              properties:
                countries:
                  description: Country codes for targeting
                  type: array
                  items:
                    type: string
                location_types:
                  default:
                    - home
                    - recent
                  description: Location types for targeting - REQUIRED by Meta API
                  type: array
                  items:
                    type: string
                    enum:
                      - home
                      - recent
                regions:
                  description: Region targeting
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                    required:
                      - key
                cities:
                  description: City targeting with optional radius
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                      radius:
                        type: number
                      distance_unit:
                        type: string
                        enum:
                          - mile
                          - kilometer
                    required:
                      - key
            interests:
              description: Interest targeting
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
            behaviors:
              description: Behavior targeting
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                required:
                  - id
            custom_audiences:
              description: Custom audience IDs
              type: array
              items:
                type: string
            lookalike_audiences:
              description: Lookalike audience IDs
              type: array
              items:
                type: string
            device_platforms:
              description: Device platform targeting
              type: array
              items:
                type: string
                enum:
                  - mobile
                  - desktop
            publisher_platforms:
              description: Publisher platform targeting
              type: array
              items:
                type: string
                enum:
                  - facebook
                  - instagram
                  - messenger
                  - whatsapp
            targeting_optimization:
              description: Targeting optimization setting
              type: string
              enum:
                - none
                - expansion_all
        status:
          default: PAUSED
          description: Initial ad set status
          type: string
          enum:
            - ACTIVE
            - PAUSED
      required:
        - campaign_id
        - name
        - optimization_goal
        - billing_event
      $schema: http://json-schema.org/draft-07/schema#
    McpToolResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          const: '2.0'
        id:
          type: string
        result:
          type: object
          properties:
            content:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: text
                  text:
                    type: string
                    description: JSON-stringified tool result
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - RATE_LIMITED
            - INTERNAL_ERROR
          description: Error code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key (sk_live_*) — SHA256 hashed, looked up in Redis. Generate via
        the web app's workspace settings.

````