Debug Requests

Graph API Debug Mode

When Debug Mode is enabled, Graph API response may contain additional fields that explain potential issues with the request.

To enable debug mode, use the debug query string parameter. For example:

curl -i -X GET \
GraphRequest request = GraphRequest.newMeRequest(
  new GraphRequest.GraphJSONObjectCallback() {
    public void onCompleted(JSONObject object, GraphResponse response) {
      // Insert your code here

Bundle parameters = new Bundle();
parameters.putString("fields", "friends");
parameters.putString("debug", "all");
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
           parameters:@{ @"fields": @"friends",@"debug": @"all",}
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
  function(response) {
      // Insert your code here
try {
  // Returns a `FacebookFacebookResponse` object
  $response = $fb->get(
} catch(FacebookExceptionsFacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
} catch(FacebookExceptionsFacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
$graphNode = $response->getGraphNode();

If user_friends permission was not granted, this produces the following response:

  "data": [
  "__debug__": {
    "messages": [
        "message": "Field friends is only accessible on User object, if user_friends permission is granted by the user", 
        "type": "warning"
        "link": "", 
        "message": "Only friends who have installed the app are returned in versions greater or equal to v2.0.", 
        "type": "info"

The debug parameter value can be set to "all" or to a minimal requested severity level that corresponds to type of the message:

Debug Param Value What Will Be Returned


All available debug messages.


Debug messages with type info and warning.


Only debug messages with type warning.

Debug information, when available, is returned as a JSON object under the __debug__ key in the messages array. Every element of this array is a JSON object that contains the following fields:

Field Datatype Description



The message.



The message severity.



[Optional] A URL pointing to related information.

You can also use Debug Mode with Graph API Explorer.

Determining Version used by API Requests

When you're building an app and making Graph API requests, you might find it useful to determine what API version you're getting a response from. For example, if you're making calls without a version specified, the API version that responds may not be known to you.

The Graph API supplies a request header with any response called facebook-api-version that indicates the exact version of the API that generated the response. For example, a Graph API call that generates a request with v2.0 produces the following HTTP header:


This facebook-api-version header allows you to determine whether API calls are being returned from the version that you expect.

Debug Info for Reporting Bugs

When reporting a bug in the Graph API, we include some additional request headers to send with your bug report to help us pinpoint and reproduce your issue. These request headers are X-FB-Debug, x-fb-rev, and X-FB-Trace-ID.