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

# Have the AI Campaign Builder assemble a complete Meta campaign (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE and publishes nothing. Returns a jobId; poll get_campaign_build until phase is preview_ready, show the preview to the user, then call launch_campaign. Use get_launch_options first for pixel/Page ids.

> Have the AI Campaign Builder assemble a complete Meta campaign (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE and publishes nothing. Returns a jobId; poll get_campaign_build until phase is preview_ready, show the preview to the user, then call launch_campaign. Use get_launch_options first for pixel/Page ids.



## OpenAPI

````yaml /openapi.json post /tools/build_campaign
openapi: 3.1.0
info:
  title: AdStellar API
  version: 1.0.0
  description: >-
    Public REST API for AdStellar — creative generation, video generation,
    campaign management, and analytics. Every endpoint maps 1:1 to an AdStellar
    MCP tool.
servers:
  - url: https://app.adstellar.ai/api/v1
security: []
paths:
  /tools/build_campaign:
    post:
      summary: >-
        Have the AI Campaign Builder assemble a complete Meta campaign
        (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE
        and publishes nothing. Returns a jobId; poll get_campaign_build until
        phase is preview_ready, show the preview to the user, then call
        launch_campaign. Use get_launch_options first for pixel/Page ids.
      description: >-
        Have the AI Campaign Builder assemble a complete Meta campaign
        (audiences, ad sets, ads, copy, creatives) as a reviewable draft. FREE
        and publishes nothing. Returns a jobId; poll get_campaign_build until
        phase is preview_ready, show the preview to the user, then call
        launch_campaign. Use get_launch_options first for pixel/Page ids.
      operationId: build_campaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                adAccountId:
                  type: string
                  minLength: 1
                  description: Meta ad account id from list_ad_accounts.
                objective:
                  type: string
                  enum:
                    - OUTCOME_SALES
                    - OUTCOME_LEADS
                    - OUTCOME_TRAFFIC
                    - OUTCOME_AWARENESS
                    - OUTCOME_ENGAGEMENT
                    - OUTCOME_APP_PROMOTION
                  description: Campaign objective.
                dailyBudget:
                  type: number
                  minimum: 1
                  maximum: 100000
                  description: Daily budget in the ad account's currency (major units).
                destinationUrl:
                  description: >-
                    Landing page of the product being advertised, from the user
                    or list_products; never an app or Page URL from
                    get_launch_options. Required for website / instant_form
                    campaigns; recommended for all because the copywriter writes
                    every ad from this page.
                  type: string
                  format: uri
                destination:
                  description: >-
                    Where ads send people. Defaults to the objective's default
                    (website, or app for App Promotion).
                  type: string
                  enum:
                    - website
                    - instant_form
                    - app
                    - whatsapp
                    - messenger
                    - instagram_direct
                    - messenger_instagram
                conversionLocation:
                  description: >-
                    Leads only: WEBSITE (pixel + landing page) or INSTANT_FORMS
                    (no pixel). Default WEBSITE.
                  type: string
                  enum:
                    - WEBSITE
                    - INSTANT_FORMS
                conversionEvent:
                  description: >-
                    Pixel event to optimise for on Sales/Leads, e.g. "Purchase",
                    "Lead", "StartTrial". Default follows the objective.
                  type: string
                  maxLength: 60
                pixelId:
                  description: >-
                    Pixel id or exact name from get_launch_options.
                    Auto-selected when the account has exactly one.
                  type: string
                pageId:
                  description: >-
                    Facebook Page id or exact name from get_launch_options.
                    Auto-selected when the account has exactly one.
                  type: string
                appId:
                  description: 'App Promotion only: app id from get_launch_options.'
                  type: string
                welcomeMessage:
                  description: >-
                    Messaging destinations only: greeting shown when the
                    conversation opens.
                  type: string
                  maxLength: 500
                campaignName:
                  description: Campaign name. Omit to let the builder name it.
                  type: string
                  maxLength: 200
                creativeAssetIds:
                  description: >-
                    Up to 10 media asset ids (from search_assets or
                    get_generation_status) to use as the ad creatives. Omit to
                    let the builder pick from the library.
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                approvedCopy:
                  description: >-
                    Up to 5 ad copy variants the user already approved (e.g.
                    from generate_ad_copy). Used verbatim.
                  maxItems: 5
                  type: array
                  items:
                    type: object
                    properties:
                      headline:
                        type: string
                        minLength: 1
                      primaryText:
                        type: string
                        minLength: 1
                      description:
                        type: string
                      cta:
                        type: string
                    required:
                      - headline
                      - primaryText
                    additionalProperties: false
                geos:
                  description: >-
                    Countries to target (names or ISO codes). Omit for the
                    builder default.
                  maxItems: 25
                  type: array
                  items:
                    type: string
                    maxLength: 60
                languages:
                  description: >-
                    Audience languages, e.g. ["English"]. Omit for all
                    languages.
                  maxItems: 10
                  type: array
                  items:
                    type: string
                    maxLength: 60
                instructions:
                  description: >-
                    Free-text guidance for the builder: audience angle, offer,
                    tone, exclusions.
                  type: string
                  maxLength: 2000
                workspaceId:
                  description: >-
                    Workspace to act in (must be granted to this credential).
                    Omit for the primary workspace.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - adAccountId
                - objective
                - dailyBudget
              additionalProperties: false
      responses:
        '200':
          description: Tool result
        '401':
          description: Missing or invalid API key
        '403':
          description: Missing required scope
        '429':
          description: Rate limit exceeded
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: AdStellar API key (ast_live_...)

````

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