Content Publishing API

The Content Publishing API is in closed beta with Facebook Marketing Partners and Instagram Partners only. We are not accepting new applicants at this time.

The Content Publishing API is a subset of Instagram Graph API endpoints that allow you to publish media objects. Publishing media objects with this API is a two step process — you first create a media object container, then publish the container on your Business Account.

Currently, the API can only be used to publish photos.

Endpoints

The API consists of the following endpoints:

Refer to each endpoint's reference documentation for parameter and permission requirements.

Publishing Photos

Publishing photos is a two-step process:

  1. Use the /user/media edge to create a media object container, then
  2. Use the /user/media_publish edge to publish that container

For example, let's say you have a photo at...

https://www.example.com/images/bronz-fonz.jpg

... that you want to publish it with the hashtag "#BronzFonz" as its caption. You could use the /user/media edge to create the container like this:

Sample Request

POST graph.facebook.com 
  /17841400008460056/media?
    image_url=https%3A%2F%2Fwww.example.com%2Fimages%2Fbronz-fonz.jpg&
    caption=%23BronzFonz

This would return a container ID (let's say 17889455560051444), which you would then publish using the /user/media_publish edge, like this:

Sample Request

POST graph.facebook.com
  /17841405822304914/media_publish
    ?creation_id=17889455560051444

Image Requirements

  • We will cURL your image using the passed in URL so it must be on a public image server
  • Maximum file size: 8MB
  • We support JPEG, PNG, BMP, and non-animated GIFs
  • Must be within a 4:5 to 1.91:1 aspect ratio range
  • Minimum resolution: 150x150 (lower resolutions will be scaled up to the minimum)
  • Maximum resolution: 1920x1080 (higher resolutions will be scaled down to the maximum)

We do not support:

  • Videos
  • Locations
  • User tags
  • Shopping tags
  • Branded content tag
  • Filters
  • Multi-image posts

Errors

  • If you run into errors generating a container, it's safe to retry until you successfully receive a containder ID.
  • If your run into errors publishing a container, retry with the same container ID until you succeed. To prevent duplicate posts, avoid creating and publishing a new container ID.