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

# Create an ad campaign

> Starts an asynchronous campaign of static ad creatives, with the same choices as the campaign creator: a recipe or several ad types, an audience, angles and an optional brief (guided), or a brief alone (prompt).



## OpenAPI

````yaml /api/openapi.yaml post /campaigns
openapi: 3.1.0
info:
  title: LocalAds API
  version: 1.0.0
  description: Public API for LocalAds customer integrations.
servers:
  - url: https://makelocalads.com/api/v1
security:
  - apiKey: []
tags:
  - name: Account
    description: Your organization, balance and prices.
  - name: Set up
    description: Brands, products, audiences and image uploads.
  - name: Ad campaigns
    description: Campaigns and their creatives.
  - name: Listing images
    description: Amazon listing image ideas and renders.
  - name: Photoshoots
    description: Photoshoots, templates and moodboards.
  - name: ChatGPT ads
    description: ChatGPT ad groups and ads.
  - name: UGC videos
    description: Recipes, concepts, voices and videos.
  - name: Creatives
    description: The cross-type list of finished images and videos.
paths:
  /campaigns:
    post:
      tags:
        - Ad campaigns
      summary: Create an ad campaign
      description: >-
        Starts an asynchronous campaign of static ad creatives, with the same
        choices as the campaign creator: a recipe or several ad types, an
        audience, angles and an optional brief (guided), or a brief alone
        (prompt).
      operationId: createCampaign
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
            examples:
              guided:
                summary: One recipe, with an audience and angles
                value:
                  product_id: a1516a75-9be5-461a-93af-c1896a0a3127
                  blueprint_id: viral-pattern-interrupt
                  audience_id: 0f0c5a4e-54f7-4f0e-9d4e-1a8c3a6b5d11
                  angles:
                    - Setup takes half the time
                  creative_count: 10
              custom:
                summary: Several ad types, split evenly
                value:
                  product_id: a1516a75-9be5-461a-93af-c1896a0a3127
                  audience_id: null
                  blueprint_ids:
                    - viral-pattern-interrupt
                    - us-vs-competition
                    - direct-offer-social-proof
                  creative_count: 9
                  aspect_ratio: '4:5'
              prompt:
                summary: Describe it yourself
                value:
                  product_id: a1516a75-9be5-461a-93af-c1896a0a3127
                  mode: prompt
                  brief: A premium campaign on the craftsmanship and gift appeal.
                  creative_count: 10
      responses:
        '202':
          description: Campaign accepted.
          headers:
            Location:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Optional caller-generated value that prevents duplicate generation when
        retrying the same request.
      schema:
        type: string
        minLength: 1
        maxLength: 255
  schemas:
    CampaignCreate:
      type: object
      additionalProperties: false
      required:
        - product_id
      description: >-
        Mirrors the campaign creator. Guided mode (the default) starts, as the
        creator does, with the audience: `audience_id` is required, either a
        saved audience or `null` for a deliberately broad campaign. It then
        takes one recipe (`blueprint_id`) or several ad types (`blueprint_ids`),
        plus optional angles and a brief. With no recipe, one is chosen for the
        product, as in the app. Prompt mode takes a `brief` instead and has no
        audience step.
      properties:
        product_id:
          type: string
          format: uuid
        mode:
          type: string
          enum:
            - guided
            - prompt
          default: guided
        blueprint_id:
          type: string
          description: One recipe from GET /campaign-blueprints.
        blueprint_ids:
          type: array
          minItems: 1
          maxItems: 30
          uniqueItems: true
          items:
            type: string
          description: >-
            Several ad types for a custom campaign. The creatives are split
            evenly across them, so `creative_count` must be a multiple of the
            number of types.
        audience_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            Required in guided mode. A saved audience of the product, from GET
            /products/{product_id}/audiences, or `null` for a broad campaign.
            Prompt mode takes no audience (omit it or send `null`).
        angles:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: string
            maxLength: 300
          description: >-
            Angles for a single recipe, usually from POST /campaign-angles. Not
            allowed with `blueprint_ids`.
        brief:
          type: string
          minLength: 1
          maxLength: 2000
          description: >-
            Optional in guided mode. Required in prompt mode, where it is the
            whole direction.
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          deprecated: true
          description: >-
            Deprecated. The original prompt-only field: sending it means prompt
            mode with this brief, and keeps the original counts (3 to 30). Use
            `mode: prompt` and `brief`.
        aspect_ratio:
          type: string
          enum:
            - '1:1'
            - '4:5'
            - '9:16'
            - '16:9'
          default: '1:1'
        language:
          type: string
          description: Defaults to the brand's saved language, else English.
          enum:
            - English
            - Hindi
            - Hinglish
            - Tamil
            - Telugu
            - Marathi
            - Bengali
            - Kannada
            - Malayalam
            - Gujarati
            - Punjabi
            - Odia
            - Assamese
            - Urdu
            - Spanish
            - French
            - German
            - Portuguese
            - Italian
            - Dutch
            - Russian
            - Arabic
            - Mandarin Chinese
            - Japanese
            - Korean
            - Vietnamese
            - Thai
            - Indonesian
            - Filipino
            - Turkish
            - Polish
            - Ukrainian
            - Greek
            - Hebrew
            - Swedish
            - Norwegian
            - Danish
            - Finnish
            - Romanian
            - Czech
            - Hungarian
            - Swahili
        creative_count:
          type: integer
          description: >-
            5, 10, 15 or 20 (default 10). For `blueprint_ids`, a multiple of the
            number of ad types, up to 30 (default: the multiple nearest 10).
        max_credits:
          type: integer
          minimum: 1
          description: >-
            Refuse the request with 422 credit_limit_exceeded, before anything
            is charged, if it would cost more than this many credits.
    Campaign:
      type: object
      additionalProperties: false
      required:
        - id
        - brand_id
        - product_id
        - name
        - status
        - credits_charged
        - requested_creative_count
        - completed_creative_count
        - failed_creative_count
        - creatives
        - created_at
        - updated_at
      properties:
        credits_charged:
          type: integer
          description: >-
            Net credits charged so far. Refunds for failed renders are
            subtracted.
        id:
          type: string
          format: uuid
        brand_id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - canceled
        requested_creative_count:
          type: integer
        completed_creative_count:
          type: integer
        failed_creative_count:
          type: integer
        creatives:
          type: array
          items:
            $ref: '#/components/schemas/CampaignCreative'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    CampaignCreative:
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - image_url
        - width
        - height
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - canceled
        image_url:
          type:
            - string
            - 'null'
          format: uri
        width:
          type:
            - integer
            - 'null'
        height:
          type:
            - integer
            - 'null'
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
        request_id:
          type: string
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Forbidden:
      description: >-
        The API key lacks the required permission (`insufficient_permission`),
        the organization's plan does not include API access
        (`plan_upgrade_required`; Pro and Enterprise only), or the organization
        is suspended (`org_suspended`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    NotFound:
      description: Resource not found.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Conflict:
      description: >-
        Idempotency key conflict, an identical request still in progress, or a
        brand already exists for the requested website.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Unprocessable:
      description: >-
        A product rule, plan limit, or credit limit blocked the request: not
        enough credits (`insufficient_credits`), an API key's monthly credit
        budget (`key_budget_exceeded`), a request costing more than its
        `max_credits` (`credit_limit_exceeded`), a plan without the feature
        (`plan_required`), or a rule the app enforces too (`request_rejected`,
        with the reason in `detail`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    RateLimited:
      description: API key rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: lads_...

````