Facebook Business Manager Campaigns API

Manage advertising campaigns including creation, updating, and status management.

OpenAPI Specification

facebook-business-manager-campaigns-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Facebook Business Manager Facebook Marketing Ad Accounts Campaigns API
  description: Create and manage ad campaigns, analyze performance, and automate advertising workflows across Meta platforms. The Marketing API provides programmatic access to Facebook's advertising system, enabling businesses to create campaigns, ad sets, and ads, manage budgets and bidding strategies, define targeting audiences, and retrieve performance metrics.
  version: '25.0'
  contact:
    name: Meta Developer Support
    url: https://developers.facebook.com/support
  termsOfService: https://developers.facebook.com/terms
servers:
- url: https://graph.facebook.com/v25.0
  description: Facebook Graph API Production Server
security:
- bearerAuth: []
tags:
- name: Campaigns
  description: Manage advertising campaigns including creation, updating, and status management.
paths:
  /act_{ad_account_id}/campaigns:
    get:
      operationId: listCampaigns
      summary: Facebook Business Manager List campaigns
      description: Retrieves all campaigns for the specified ad account. Returns a paginated list of campaign objects with their configurations and status information.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/adAccountId'
      - $ref: '#/components/parameters/fields'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/after'
      - name: filtering
        in: query
        description: Filters to apply to the campaign list. Accepts JSON array of filter objects with field, operator, and value.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Successfully retrieved list of campaigns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createCampaign
      summary: Facebook Business Manager Create a campaign
      description: Creates a new advertising campaign in the specified ad account. Requires at minimum a name, objective, and status.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/adAccountId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignCreate'
      responses:
        '200':
          description: Campaign created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /{campaign_id}:
    get:
      operationId: getCampaign
      summary: Facebook Business Manager Get a campaign
      description: Retrieves the details of a specific campaign by its ID, including configuration, status, and objective.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId'
      - $ref: '#/components/parameters/fields'
      responses:
        '200':
          description: Successfully retrieved campaign details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      operationId: updateCampaign
      summary: Facebook Business Manager Update a campaign
      description: Updates an existing campaign. Supports modifying name, status, budget, and other campaign-level settings.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignUpdate'
      responses:
        '200':
          description: Campaign updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    delete:
      operationId: deleteCampaign
      summary: Facebook Business Manager Delete a campaign
      description: Deletes an advertising campaign. This sets the campaign status to DELETED and it will no longer serve ads.
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/campaignId'
      responses:
        '200':
          description: Campaign deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    PagingCursors:
      type: object
      properties:
        before:
          type: string
          description: Cursor pointing to the start of the current page
        after:
          type: string
          description: Cursor pointing to the end of the current page
    CampaignUpdate:
      type: object
      properties:
        name:
          type: string
          description: Updated campaign name
        status:
          type: string
          enum:
          - ACTIVE
          - PAUSED
          - DELETED
          - ARCHIVED
        daily_budget:
          type: string
          description: Updated daily budget
        lifetime_budget:
          type: string
          description: Updated lifetime budget
    Campaign:
      type: object
      properties:
        id:
          type: string
          description: The ID of the campaign
        name:
          type: string
          description: The name of the campaign
        objective:
          type: string
          description: The campaign objective
          enum:
          - OUTCOME_AWARENESS
          - OUTCOME_ENGAGEMENT
          - OUTCOME_LEADS
          - OUTCOME_SALES
          - OUTCOME_TRAFFIC
          - OUTCOME_APP_PROMOTION
        status:
          type: string
          description: The configured status of the campaign
          enum:
          - ACTIVE
          - PAUSED
          - DELETED
          - ARCHIVED
        effective_status:
          type: string
          description: The effective status of the campaign taking into account parent statuses and schedule.
        daily_budget:
          type: string
          description: Daily budget amount in account currency smallest unit
        lifetime_budget:
          type: string
          description: Lifetime budget amount in account currency smallest unit
        budget_remaining:
          type: string
          description: Remaining budget for the campaign
        buying_type:
          type: string
          description: Buying type of the campaign
          enum:
          - AUCTION
          - RESERVED
        special_ad_categories:
          type: array
          items:
            type: string
          description: Special ad categories required for housing, employment, credit, or social issues ads.
        created_time:
          type: string
          format: date-time
          description: Time when the campaign was created
        updated_time:
          type: string
          format: date-time
          description: Time when the campaign was last updated
        start_time:
          type: string
          format: date-time
          description: Scheduled start time of the campaign
        stop_time:
          type: string
          format: date-time
          description: Scheduled stop time of the campaign
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error message
            type:
              type: string
              description: Error type classification
            code:
              type: integer
              description: Numeric error code
            error_subcode:
              type: integer
              description: Numeric error subcode for more specific categorization
            fbtrace_id:
              type: string
              description: Unique trace ID for debugging with Facebook support
    CampaignList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Campaign'
        paging:
          $ref: '#/components/schemas/Paging'
    CampaignCreate:
      type: object
      required:
      - name
      - objective
      - status
      - special_ad_categories
      properties:
        name:
          type: string
          description: The name of the campaign
        objective:
          type: string
          description: The campaign objective
          enum:
          - OUTCOME_AWARENESS
          - OUTCOME_ENGAGEMENT
          - OUTCOME_LEADS
          - OUTCOME_SALES
          - OUTCOME_TRAFFIC
          - OUTCOME_APP_PROMOTION
        status:
          type: string
          description: The initial status of the campaign
          enum:
          - ACTIVE
          - PAUSED
        special_ad_categories:
          type: array
          items:
            type: string
          description: Required special ad categories or empty array if none apply
        daily_budget:
          type: string
          description: Daily budget in smallest currency unit
        lifetime_budget:
          type: string
          description: Lifetime budget in smallest currency unit
        buying_type:
          type: string
          enum:
          - AUCTION
          - RESERVED
    Paging:
      type: object
      properties:
        cursors:
          $ref: '#/components/schemas/PagingCursors'
        next:
          type: string
          description: URL for the next page of results
        previous:
          type: string
          description: URL for the previous page of results
    CreateResponse:
      type: object
      properties:
        id:
          type: string
          description: The ID of the newly created object
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Whether the operation was successful
  responses:
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or expired access token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Invalid request parameters or malformed request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    adAccountId:
      name: ad_account_id
      in: path
      required: true
      description: The ID of the ad account (numeric, without the act_ prefix)
      schema:
        type: string
    campaignId:
      name: campaign_id
      in: path
      required: true
      description: The ID of the campaign
      schema:
        type: string
    limit:
      name: limit
      in: query
      required: false
      description: Maximum number of objects to return per page. Default is 25.
      schema:
        type: integer
        default: 25
        maximum: 100
    after:
      name: after
      in: query
      required: false
      description: Cursor for pagination to retrieve the next page of results
      schema:
        type: string
    fields:
      name: fields
      in: query
      required: false
      description: Comma-separated list of fields to include in the response. If omitted, default fields are returned.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 access token with ads_management or ads_read permissions. Obtain tokens via the Facebook Login flow.
externalDocs:
  description: Facebook Marketing API Documentation
  url: https://developers.facebook.com/docs/marketing-api