Graph API Version

Photo

Represents an individual photo on Facebook.

Reading

This represents a Photo on Facebook

Permissions

  • Any valid access token can read photos on a public Page.
  • A page access token can read all photos posted to or posted by that Page.
  • A user access token can read any photo your application created on behalf of that user.
  • A user's photos can be read if the owner has granted the user_photos or user_posts permission.
  • A user access token may read a photo that user is tagged in if they have granted the user_photos or user_posts permission. However, in some cases the photo's owner's privacy settings may not allow your application to access it.

Examples

Graph API Explorer
GET /v2.7/{photo-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{photo-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{photo-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{photo-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{photo-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription

id

numeric string

The photo ID

album

The album this photo is in

backdated_time

datetime

A user-specified time for when this object was created

backdated_time_granularity

enum

How accurate the backdated time is

can_backdate

bool

Indicates whether the viewer can backdate the photo

can_delete

bool

Indicates whether the viewer can delete the photo

can_tag

bool

Indicates whether the viewer can tag the photo

created_time

datetime

The time this photo was published

event

If this object has a place, the event associated with the place

from

User|Page

The profile (user or page) that uploaded this photo

height

unsigned int32

The height of this photo in pixels

icon

string

The icon that Facebook displays when photos are published to News Feed

images

The different stored representations of the photo. Can vary in number based upon the size of the original photo.

link

string

A link to the photo on Facebook

name

string

The user-provided caption given to this photo. Corresponds to caption when creating photos

name_tags

An array containing an array of objects mentioned in the name field which contain the id, name, and type of each object as well as the offset and length which can be used to match it up with its corresponding string in the name field

page_story_id

string

ID of the page story this corresponds to. May not be on all photos. Applies only to published photos

picture

string

Link to the 100px wide representation of this photo

place

Location associated with the photo, if any

position

unsigned int32

Deprecated. Returns 0

Deprecated

source

string

Deprecated. Use images instead

Deprecated

target

The target this photo is published to

updated_time

datetime

The last time the photo was updated

webp_images

The different stored representations of the photo in webp format. Can vary in number based upon the size of the original photo.

width

unsigned int32

The width of this photo in pixels

Edges

EdgeDescription

insights

Insights data

likes

People who like this

reactions

People who reacted on this

sharedposts

The posts in which this photo is shared

sponsor_tags

Sponsor pages tagged in the photo.

tags

The Users tagged in the photo

comments

Comments on an object

Validation Rules

ErrorDescription
100Invalid parameter
3001Invalid query
210User not visible

Creating

Note: the post_id value is not returned for photos added to Albums.

You can make a POST request to photos edge from the following paths:
When posting to this edge, a Photo will be created.

Permissions

Developers usually request these permissions for this endpoint:
  • manage_pages
  • publish_pages

Parameters

NameDescription
allow_spherical_photo
boolean
Default value: false

Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true.

attempt
unsigned int32
Default value: 0

Number of attempts that have been made to upload this photo

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

caption
UTF-8 string

The description of the photo

Supports Emoji
composer_session_id
string

Composer session ID

feed_targeting
feed target

Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. feed_targeting applies to Pages only.

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>
locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

college_years
list<unsigned int32>

Array of integers. Represent graduation years from college.

education_statuses
list<unsigned int32>

Array of integers which represent current educational status. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).

interested_in
list<unsigned int32>

Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.

relationship_statuses
list<unsigned int32>

Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.

interests
list<unsigned int32>

One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.

relevant_until
unsigned int32

Specify time when story becomes irrelevant to show.

filter_type
unsigned int32
Default value: -1

Unused?

nectar_module
string

Nectar module. Internal apps only

no_story
boolean

If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story

offline_id
unsigned int32
Default value: 0

Offline ID

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

published
boolean
Default value: true

Set to false if you don't want the photo to be published immediately

qn
string

Photos waterfall ID

scheduled_publish_time
unsigned int32

Time at which an unpublished post should be published. Applies to Pages only

spherical_metadata
JSON object

A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. See Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata

ProjectionType
string
Required
CroppedAreaImageWidthPixels
integer
Required
CroppedAreaImageHeightPixels
integer
Required
FullPanoWidthPixels
integer
Required
FullPanoHeightPixels
integer
Required
CroppedAreaLeftPixels
integer
Required
CroppedAreaTopPixels
integer
Required
PoseHeadingDegrees
float
PosePitchDegrees
float
PoseRollDegrees
float
InitialViewHeadingDegrees
float
InitialViewPitchDegrees
float
InitialViewRollDegrees
float
PreProcessCropLeftPixels
integer
PreProcessCropRightPixels
integer
sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<Object>
Default value: Array

Tags on this photo

x
float

The x-axis offset for the tag

y
float

The y-axis offset for the tag

tag_uid
int

The user_id of the tagged person

tag_text
string

Text associated with the tag

targeting
target

Allows you to target posts to specific audiences. Applies to Pages only

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>

Values for targeted zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

excluded_countries
list<string>

Values for excluded countries. You can specify up to 25 countries. Use ISO 3166 format codes.

excluded_regions
list<unsigned int32>

Values for excluded regions. Use type of adregion and list of GLOBAL to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California&list=GLOBAL
excluded_cities
list<unsigned int32>

Values for excluded cities. Use type of adcity to find Targeting Options and use the returned key to specify.

excluded_zipcodes
list<string>

Values for excluded zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

excluded_locales
list<string>
timezones
list<unsigned int32>

ID for the timezone. See here.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

temporary
boolean
Default value: false

This is a temporary photo. published must be false, and you can't set scheduled_publish_time

unpublished_content_type
enum {SCHEDULED, DRAFT, ADS_POST}

Content type of the unpublished content type

url
URL

The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment

vault_image_id
numeric string or integer

A vault image ID to use for a photo. You can use only one of url, a file attachment, vault_image_id, or sync_object_uuid

Return Type

Struct {
id: numeric string,
post_id: string,
}
You can make a POST request to photos edge from the following paths:
When posting to this edge, a Photo will be created.

Permissions

Developers usually request these permissions for this endpoint:
  • publish_actions
  • user_photos
  • user_posts

Parameters

NameDescription
aid
string

Legacy album ID. Deprecated

Deprecated
allow_spherical_photo
boolean
Default value: false

Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true.

application_id
non-empty string

iTunes App ID. This is used by the native Share dialog that's part of iOS

audience_exp
boolean
Default value: false

Audience exp

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

caption
UTF-8 string

The description of the photo

Supports Emoji
composer_session_id
string

Composer session ID

feed_targeting
feed target

Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. feed_targeting applies to Pages only.

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>
locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

college_years
list<unsigned int32>

Array of integers. Represent graduation years from college.

education_statuses
list<unsigned int32>

Array of integers which represent current educational status. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).

interested_in
list<unsigned int32>

Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.

relationship_statuses
list<unsigned int32>

Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.

interests
list<unsigned int32>

One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.

relevant_until
unsigned int32

Specify time when story becomes irrelevant to show.

full_res_is_coming_later
boolean
Default value: false

Full res is coming later

is_explicit_location
boolean

Is this an explicit location?

is_explicit_place
boolean

If set to true, the tag is a place, not a person

manual_privacy
boolean
Default value: false

Manual privacy

message
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
name
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
no_story
boolean

If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story

offline_id
unsigned int32
Default value: 0

Offline ID

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_set_profile_badge
boolean
Default value: false

Flag to set if the post should create a profile badge

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

privacy
Privacy Parameter

Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted

profile_id
int

Deprecated. Use target_id instead

Deprecated
published
boolean
Default value: true

Set to false if you don't want the photo to be published immediately

qn
string

Photos waterfall ID

scheduled_publish_time
unsigned int32

Time at which an unpublished post should be published. Applies to Pages only

spherical_metadata
JSON object

A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. See Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata

ProjectionType
string
Required
CroppedAreaImageWidthPixels
integer
Required
CroppedAreaImageHeightPixels
integer
Required
FullPanoWidthPixels
integer
Required
FullPanoHeightPixels
integer
Required
CroppedAreaLeftPixels
integer
Required
CroppedAreaTopPixels
integer
Required
PoseHeadingDegrees
float
PosePitchDegrees
float
PoseRollDegrees
float
InitialViewHeadingDegrees
float
InitialViewPitchDegrees
float
InitialViewRollDegrees
float
PreProcessCropLeftPixels
integer
PreProcessCropRightPixels
integer
sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<Object>

Tags on this photo

x
float

The x-axis offset for the tag

y
float

The y-axis offset for the tag

tag_uid
int

The user_id of the tagged person

tag_text
string

Text associated with the tag

target_id
int

Don't use this. Specifying a target_id allows you to post the photo to an object that's not the user in the access token. It only works when posting directly to the /photos endpoint. Instead of using this parameter you should be using the edge on an object directly, like /page/photos.

targeting
target

Allows you to target posts to specific audiences. Applies to Pages only

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>

Values for targeted zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

excluded_countries
list<string>

Values for excluded countries. You can specify up to 25 countries. Use ISO 3166 format codes.

excluded_regions
list<unsigned int32>

Values for excluded regions. Use type of adregion and list of GLOBAL to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California&list=GLOBAL
excluded_cities
list<unsigned int32>

Values for excluded cities. Use type of adcity to find Targeting Options and use the returned key to specify.

excluded_zipcodes
list<string>

Values for excluded zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

excluded_locales
list<string>
timezones
list<unsigned int32>

ID for the timezone. See here.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

url
string

The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment

Return Type

Struct {
id: numeric string,
post_id: token with structure: Post ID,
}
You can make a POST request to photos edge from the following paths:
When posting to this edge, a Photo will be created.

Permissions

Developers usually request these permissions for this endpoint:
  • publish_actions
  • user_photos

Parameters

NameDescription
aid
string

Legacy album ID. Deprecated

Deprecated
allow_spherical_photo
boolean
Default value: false

Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true.

application_id
non-empty string

iTunes App ID. This is used by the native Share dialog that's part of iOS

audience_exp
boolean
Default value: false

Audience exp

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

caption
UTF-8 string

The description of the photo

Supports Emoji
composer_session_id
string

Composer session ID

feed_targeting
feed target

Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. feed_targeting applies to Pages only.

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>
locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

college_years
list<unsigned int32>

Array of integers. Represent graduation years from college.

education_statuses
list<unsigned int32>

Array of integers which represent current educational status. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).

interested_in
list<unsigned int32>

Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.

relationship_statuses
list<unsigned int32>

Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.

interests
list<unsigned int32>

One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.

relevant_until
unsigned int32

Specify time when story becomes irrelevant to show.

full_res_is_coming_later
boolean
Default value: false

Full res is coming later

is_explicit_location
boolean

Is this an explicit location?

is_explicit_place
boolean

If set to true, the tag is a place, not a person

manual_privacy
boolean
Default value: false

Manual privacy

message
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
name
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
no_story
boolean

If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story

offline_id
unsigned int32
Default value: 0

Offline ID

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_set_profile_badge
boolean
Default value: false

Flag to set if the post should create a profile badge

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

privacy
Privacy Parameter

Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted

profile_id
int

Deprecated. Use target_id instead

Deprecated
published
boolean
Default value: true

Set to false if you don't want the photo to be published immediately

qn
string

Photos waterfall ID

scheduled_publish_time
unsigned int32

Time at which an unpublished post should be published. Applies to Pages only

spherical_metadata
JSON object

A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. See Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata

ProjectionType
string
Required
CroppedAreaImageWidthPixels
integer
Required
CroppedAreaImageHeightPixels
integer
Required
FullPanoWidthPixels
integer
Required
FullPanoHeightPixels
integer
Required
CroppedAreaLeftPixels
integer
Required
CroppedAreaTopPixels
integer
Required
PoseHeadingDegrees
float
PosePitchDegrees
float
PoseRollDegrees
float
InitialViewHeadingDegrees
float
InitialViewPitchDegrees
float
InitialViewRollDegrees
float
PreProcessCropLeftPixels
integer
PreProcessCropRightPixels
integer
sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<Object>

Tags on this photo

x
float

The x-axis offset for the tag

y
float

The y-axis offset for the tag

tag_uid
int

The user_id of the tagged person

tag_text
string

Text associated with the tag

target_id
int

Don't use this. Specifying a target_id allows you to post the photo to an object that's not the user in the access token. It only works when posting directly to the /photos endpoint. Instead of using this parameter you should be using the edge on an object directly, like /page/photos.

targeting
target

Allows you to target posts to specific audiences. Applies to Pages only

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>

Values for targeted zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

excluded_countries
list<string>

Values for excluded countries. You can specify up to 25 countries. Use ISO 3166 format codes.

excluded_regions
list<unsigned int32>

Values for excluded regions. Use type of adregion and list of GLOBAL to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California&list=GLOBAL
excluded_cities
list<unsigned int32>

Values for excluded cities. Use type of adcity to find Targeting Options and use the returned key to specify.

excluded_zipcodes
list<string>

Values for excluded zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

excluded_locales
list<string>
timezones
list<unsigned int32>

ID for the timezone. See here.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

url
string

The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment

Return Type

Struct {
id: numeric string,
post_id: token with structure: Post ID,
}
You can make a POST request to photos edge from the following paths:
When posting to this edge, a Photo will be created.

Permissions

Developers usually request these permissions for this endpoint:
  • manage_pages
  • publish_pages

Parameters

NameDescription
aid
string

Legacy album ID. Deprecated

Deprecated
allow_spherical_photo
boolean
Default value: false

Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true.

application_id
non-empty string

iTunes App ID. This is used by the native Share dialog that's part of iOS

audience_exp
boolean
Default value: false

Audience exp

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

caption
UTF-8 string

The description of the photo

Supports Emoji
composer_session_id
string

Composer session ID

feed_targeting
feed target

Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. feed_targeting applies to Pages only.

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>
locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

college_years
list<unsigned int32>

Array of integers. Represent graduation years from college.

education_statuses
list<unsigned int32>

Array of integers which represent current educational status. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).

interested_in
list<unsigned int32>

Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.

relationship_statuses
list<unsigned int32>

Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.

interests
list<unsigned int32>

One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.

relevant_until
unsigned int32

Specify time when story becomes irrelevant to show.

full_res_is_coming_later
boolean
Default value: false

Full res is coming later

is_explicit_location
boolean

Is this an explicit location?

is_explicit_place
boolean

If set to true, the tag is a place, not a person

manual_privacy
boolean
Default value: false

Manual privacy

message
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
name
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
no_story
boolean

If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story

offline_id
unsigned int32
Default value: 0

Offline ID

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_set_profile_badge
boolean
Default value: false

Flag to set if the post should create a profile badge

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

privacy
Privacy Parameter

Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted

profile_id
int

Deprecated. Use target_id instead

Deprecated
published
boolean
Default value: true

Set to false if you don't want the photo to be published immediately

qn
string

Photos waterfall ID

scheduled_publish_time
unsigned int32

Time at which an unpublished post should be published. Applies to Pages only

spherical_metadata
JSON object

A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. See Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata

ProjectionType
string
Required
CroppedAreaImageWidthPixels
integer
Required
CroppedAreaImageHeightPixels
integer
Required
FullPanoWidthPixels
integer
Required
FullPanoHeightPixels
integer
Required
CroppedAreaLeftPixels
integer
Required
CroppedAreaTopPixels
integer
Required
PoseHeadingDegrees
float
PosePitchDegrees
float
PoseRollDegrees
float
InitialViewHeadingDegrees
float
InitialViewPitchDegrees
float
InitialViewRollDegrees
float
PreProcessCropLeftPixels
integer
PreProcessCropRightPixels
integer
sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<Object>

Tags on this photo

x
float

The x-axis offset for the tag

y
float

The y-axis offset for the tag

tag_uid
int

The user_id of the tagged person

tag_text
string

Text associated with the tag

target_id
int

Don't use this. Specifying a target_id allows you to post the photo to an object that's not the user in the access token. It only works when posting directly to the /photos endpoint. Instead of using this parameter you should be using the edge on an object directly, like /page/photos.

targeting
target

Allows you to target posts to specific audiences. Applies to Pages only

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>

Values for targeted zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

excluded_countries
list<string>

Values for excluded countries. You can specify up to 25 countries. Use ISO 3166 format codes.

excluded_regions
list<unsigned int32>

Values for excluded regions. Use type of adregion and list of GLOBAL to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California&list=GLOBAL
excluded_cities
list<unsigned int32>

Values for excluded cities. Use type of adcity to find Targeting Options and use the returned key to specify.

excluded_zipcodes
list<string>

Values for excluded zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

excluded_locales
list<string>
timezones
list<unsigned int32>

ID for the timezone. See here.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

url
string

The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment

Return Type

Struct {
id: numeric string,
post_id: token with structure: Post ID,
}
You can make a POST request to photos edge from the following paths:
When posting to this edge, a Photo will be created.

Permissions

Developers usually request these permissions for this endpoint:
  • publish_actions

Parameters

NameDescription
aid
string

Legacy album ID. Deprecated

Deprecated
allow_spherical_photo
boolean
Default value: false

Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true.

application_id
non-empty string

iTunes App ID. This is used by the native Share dialog that's part of iOS

audience_exp
boolean
Default value: false

Audience exp

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

caption
UTF-8 string

The description of the photo

Supports Emoji
composer_session_id
string

Composer session ID

feed_targeting
feed target

Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. feed_targeting applies to Pages only.

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>
locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

college_years
list<unsigned int32>

Array of integers. Represent graduation years from college.

education_statuses
list<unsigned int32>

Array of integers which represent current educational status. Use 1 for high school, 2 for undergraduate, and 3 for alum (or localized equivalents).

interested_in
list<unsigned int32>

Indicates targeting based on the 'interested in' field of the user profile. You can specify an integer of 1 to indicate male, 2 indicates female. Default is all types. Please note 'interested in' targeting is not available in France due to local laws.

relationship_statuses
list<unsigned int32>

Array of integers for targeting based on relationship status. Use 1 for single, 2 for 'in a relationship', 3 for married, and 4 for engaged. Default is all types.

interests
list<unsigned int32>

One or more IDs of pages to target fans of pages.Use type of page to get possible IDs as find Targeting Options and use the returned id to specify.

relevant_until
unsigned int32

Specify time when story becomes irrelevant to show.

full_res_is_coming_later
boolean
Default value: false

Full res is coming later

is_explicit_location
boolean

Is this an explicit location?

is_explicit_place
boolean

If set to true, the tag is a place, not a person

manual_privacy
boolean
Default value: false

Manual privacy

message
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
name
UTF-8 string

Deprecated. Please use the caption param instead.

DeprecatedSupports Emoji
no_story
boolean

If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story

offline_id
unsigned int32
Default value: 0

Offline ID

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_set_profile_badge
boolean
Default value: false

Flag to set if the post should create a profile badge

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

privacy
Privacy Parameter

Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted

profile_id
int

Deprecated. Use target_id instead

Deprecated
published
boolean
Default value: true

Set to false if you don't want the photo to be published immediately

qn
string

Photos waterfall ID

scheduled_publish_time
unsigned int32

Time at which an unpublished post should be published. Applies to Pages only

spherical_metadata
JSON object

A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. See Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata

ProjectionType
string
Required
CroppedAreaImageWidthPixels
integer
Required
CroppedAreaImageHeightPixels
integer
Required
FullPanoWidthPixels
integer
Required
FullPanoHeightPixels
integer
Required
CroppedAreaLeftPixels
integer
Required
CroppedAreaTopPixels
integer
Required
PoseHeadingDegrees
float
PosePitchDegrees
float
PoseRollDegrees
float
InitialViewHeadingDegrees
float
InitialViewPitchDegrees
float
InitialViewRollDegrees
float
PreProcessCropLeftPixels
integer
PreProcessCropRightPixels
integer
sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<Object>

Tags on this photo

x
float

The x-axis offset for the tag

y
float

The y-axis offset for the tag

tag_uid
int

The user_id of the tagged person

tag_text
string

Text associated with the tag

target_id
int

Don't use this. Specifying a target_id allows you to post the photo to an object that's not the user in the access token. It only works when posting directly to the /photos endpoint. Instead of using this parameter you should be using the edge on an object directly, like /page/photos.

targeting
target

Allows you to target posts to specific audiences. Applies to Pages only

countries
list<string>

Values for targeted countries. You can specify up to 25 countries. Use ISO 3166 format codes.

regions
list<unsigned int32>

Values for targeted regions. Use type of adregion to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California
cities
list<unsigned int32>

Values for targeted cities. Use type of adcity to find Targeting Options and use the returned key to specify.

zipcodes
list<string>

Values for targeted zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

locales
list<string>

Values for targeted locales. Use type of adlocale to find Targeting Options and use the returned key to specify.

excluded_countries
list<string>

Values for excluded countries. You can specify up to 25 countries. Use ISO 3166 format codes.

excluded_regions
list<unsigned int32>

Values for excluded regions. Use type of adregion and list of GLOBAL to find Targeting Options and use the returned key to specify. For example:

search/?type=adregion&q=California&list=GLOBAL
excluded_cities
list<unsigned int32>

Values for excluded cities. Use type of adcity to find Targeting Options and use the returned key to specify.

excluded_zipcodes
list<string>

Values for excluded zipcodes. Use type of adzipcode to find Targeting Options and use the returned key to specify.

excluded_locales
list<string>
timezones
list<unsigned int32>

ID for the timezone. See here.

age_min
unsigned int32

Must be 13 or higher. Default is 0.

age_max
unsigned int32

Maximum age.

genders
list<unsigned int32>

Target specific genders. 1 targets all male viewers and 2 females. Default is to target both.

url
string

The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment

Return Type

Struct {
id: numeric string,
post_id: token with structure: Post ID,
}
You may perform a POST request to the following edges from this node:

Validation Rules

ErrorDescription
7600This photo is blocked from being posted because it violates a Facebook policy.
100Invalid parameter
320Photo edit failure
506Duplicate status message
121Invalid photo id

Updating

You can update a Photo by making a POST request to /{photo_id}.

Permissions

Developers usually request these permissions for this endpoint:
  • user_managed_groups

Parameters

NameDescription
android_key_hash
string

Android key hash

backdated_time
datetime

A user-specified creation time for this photo

backdated_time_granularity
enum{year, month, day, hour, min, none}
Default value: none

Use only the part of the backdated_time parameter to the specified granularity

checkin_entry_point
enum {BRANDING_CHECKIN, BRANDING_STATUS, BRANDING_PHOTO, BRANDING_OTHER}
Default value: BRANDING_OTHER

The method that the user used to add a place tag to their story.

composer_session_events_log
JSON-encoded string

Additional data on the composer session such as composition duration.

composer_session_id
string

Composer session ID

ios_bundle_id
string

iOS Bundle ID

is_checkin
boolean
Default value: false

Is this photo a checkin?

is_cropped
boolean

Is this photo cropped?

is_explicit_location
boolean
Default value: false

Is this an explicit location?

og_action_type_id
numeric string or integer

The Open Graph action type

og_icon_id
numeric string or integer

The Open Graph icon

og_object_id
OG object ID or URL string

The Open Graph object ID

og_phrase
string

The Open Graph phrase

og_set_profile_badge
boolean
Default value: false

Flag to set if the post should create a profile badge

og_suggestion_mechanism
string

The Open Graph suggestion

place
place tag

Page ID of a place associated with the photo

privacy
Privacy Parameter

Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted

prompt_id
string

The prompt id if the post is generated from prompt

prompt_tracking_string
string

The prompt tracking string if the post is generated from prompt

proxied_app_id
numeric string or integer

Proxied app ID

published
boolean

Set to false if you don't want the photo to be published immediately

referenced_sticker_id
numeric string or integer

Sticker id of the sticker in the post

sponsor_id
numeric string or integer

Facebook Page id that is tagged as sponsor in the photo post

tags
list<int>

Tags on this photo

target
numeric string

Sets the object that this photo is attached to. Only relavant when publishing an unpublished photo

target_post
post_id

Sets the post this photo is attached to. Only relavant when publishing an unpublished photo

time_since_original_post
unsigned int32

Same as backdated_time but with a time delta instead of absolute time

Return Type

Struct {
success: bool,
}

Validation Rules

ErrorDescription
7600This photo is blocked from being posted because it violates a Facebook policy.
100Invalid parameter
320Photo edit failure
506Duplicate status message
121Invalid photo id

Deleting

An app can delete any photos it published, or a page-management app can delete a Photo published to a page that the app manages.

Permissions

  • To delete a User's photo, a User access token with publish_actions permission is required.
  • To delete a Page's photo a Page access token and publish_pages permission is required.
  • To delete a User's photo on Page a Page access token is required.
You can delete a Photo by making a DELETE request to /{photo_id}.

Parameters

NameDescription
pid
numeric string or integer

Photo ID

Required

Return Type

Struct {
success: bool,
}
You may perform a DELETE request to the following edge from this node:

Validation Rules

ErrorDescription
100Invalid parameter
121Invalid photo id
2010Photos calls have been temporarily disabled for this application