Facebook Business Manager Ad Images API

Upload and manage images used in ad creatives.

OpenAPI Specification

facebook-business-manager-ad-images-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Facebook Business Manager Facebook Marketing Ad Accounts Ad Images 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: Ad Images
  description: Upload and manage images used in ad creatives.
paths:
  /act_{ad_account_id}/adimages:
    post:
      operationId: uploadAdImage
      summary: Facebook Business Manager Upload an ad image
      description: Uploads an image to the ad account image library for use in ad creatives. Accepts image file bytes.
      tags:
      - Ad Images
      parameters:
      - $ref: '#/components/parameters/adAccountId'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  format: binary
                  description: The image file to upload
      responses:
        '200':
          description: Image uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  images:
                    type: object
                    description: Map of uploaded image details keyed by filename
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Invalid request parameters or malformed request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or expired access token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    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
  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
  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