Facebook Graph API

The primary way to read and write data to the Facebook social graph, providing access to user profiles, posts, pages, photos, videos, comments, and social interactions. Supports nodes, edges, and fields for flexible data access.

OpenAPI Specification

facebook-graph-api.yaml Raw ↑
openapi: 3.0.3
info:
  title: Facebook Graph API
  description: >-
    The primary way to read and write data to the Facebook social graph,
    providing access to user profiles, posts, pages, photos, videos, comments,
    and social interactions.
  version: '21.0'
  contact:
    name: Meta Platforms
    url: https://developers.facebook.com
  x-generated-from: documentation
  x-last-validated: '2026-04-18'
servers:
  - url: https://graph.facebook.com/v21.0
    description: Facebook Graph API v21.0
security:
  - BearerAuth: []
paths:
  /me:
    get:
      operationId: getCurrentUser
      summary: Facebook Get Current User
      description: Retrieve the profile of the currently authenticated user.
      tags:
        - Users
      parameters:
        - name: fields
          in: query
          description: Comma-separated list of fields to return.
          schema:
            type: string
          example: id,name,email,picture
      responses:
        '200':
          description: User profile retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
              examples:
                GetCurrentUser200Example:
                  summary: Default getCurrentUser 200 response
                  x-microcks-default: true
                  value:
                    id: '100001234567890'
                    name: Jane Smith
                    email: jsmith@example.com
        '401':
          description: Invalid or expired access token.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{user-id}:
    get:
      operationId: getUser
      summary: Facebook Get User
      description: Retrieve a user profile by user ID.
      tags:
        - Users
      parameters:
        - name: user-id
          in: path
          required: true
          description: The user ID.
          schema:
            type: string
          example: '100001234567890'
        - name: fields
          in: query
          description: Comma-separated list of fields to return.
          schema:
            type: string
          example: id,name,email
      responses:
        '200':
          description: User profile retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '404':
          description: User not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{user-id}/feed:
    get:
      operationId: getUserFeed
      summary: Facebook Get User Feed
      description: Retrieve posts from a user's feed.
      tags:
        - Posts
      parameters:
        - name: user-id
          in: path
          required: true
          description: The user ID.
          schema:
            type: string
          example: '100001234567890'
        - name: limit
          in: query
          description: Maximum number of posts to return.
          schema:
            type: integer
          example: 25
      responses:
        '200':
          description: Feed posts retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostList'
              examples:
                GetUserFeed200Example:
                  summary: Default getUserFeed 200 response
                  x-microcks-default: true
                  value:
                    data:
                      - id: '100001234567890_987654321'
                        message: Hello world!
                        created_time: '2026-04-18T10:00:00+0000'
                        from:
                          id: '100001234567890'
                          name: Jane Smith
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createPost
      summary: Facebook Create Post
      description: Publish a new post to a user's feed.
      tags:
        - Posts
      parameters:
        - name: user-id
          in: path
          required: true
          description: The user ID.
          schema:
            type: string
          example: '100001234567890'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostRequest'
            examples:
              CreatePostRequestExample:
                summary: Default createPost request
                x-microcks-default: true
                value:
                  message: Check out this amazing content!
                  link: https://example.com/article
      responses:
        '200':
          description: Post created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: The new post ID.
        '400':
          description: Invalid post content.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{page-id}:
    get:
      operationId: getPage
      summary: Facebook Get Page
      description: Retrieve information about a Facebook Page.
      tags:
        - Pages
      parameters:
        - name: page-id
          in: path
          required: true
          description: The page ID.
          schema:
            type: string
          example: '200001234567890'
        - name: fields
          in: query
          description: Comma-separated list of fields to return.
          schema:
            type: string
          example: id,name,category,fan_count
      responses:
        '200':
          description: Page information retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{page-id}/feed:
    get:
      operationId: getPageFeed
      summary: Facebook Get Page Feed
      description: Retrieve posts from a page's feed.
      tags:
        - Pages
      parameters:
        - name: page-id
          in: path
          required: true
          description: The page ID.
          schema:
            type: string
          example: '200001234567890'
        - name: limit
          in: query
          description: Maximum number of posts to return.
          schema:
            type: integer
          example: 25
      responses:
        '200':
          description: Page feed posts retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{post-id}:
    get:
      operationId: getPost
      summary: Facebook Get Post
      description: Retrieve a specific post by ID.
      tags:
        - Posts
      parameters:
        - name: post-id
          in: path
          required: true
          description: The post ID.
          schema:
            type: string
          example: '100001234567890_987654321'
        - name: fields
          in: query
          description: Comma-separated list of fields to return.
          schema:
            type: string
          example: id,message,created_time,from
      responses:
        '200':
          description: Post retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deletePost
      summary: Facebook Delete Post
      description: Delete a post by ID.
      tags:
        - Posts
      parameters:
        - name: post-id
          in: path
          required: true
          description: The post ID.
          schema:
            type: string
          example: '100001234567890_987654321'
      responses:
        '200':
          description: Post deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{post-id}/comments:
    get:
      operationId: getPostComments
      summary: Facebook Get Post Comments
      description: Retrieve comments on a specific post.
      tags:
        - Comments
      parameters:
        - name: post-id
          in: path
          required: true
          description: The post ID.
          schema:
            type: string
          example: '100001234567890_987654321'
        - name: limit
          in: query
          description: Maximum number of comments to return.
          schema:
            type: integer
          example: 25
      responses:
        '200':
          description: Comments retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: createComment
      summary: Facebook Create Comment
      description: Post a comment on a specific post.
      tags:
        - Comments
      parameters:
        - name: post-id
          in: path
          required: true
          description: The post ID.
          schema:
            type: string
          example: '100001234567890_987654321'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                message:
                  type: string
                  description: Comment text.
              required:
                - message
      responses:
        '200':
          description: Comment created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{user-id}/photos:
    get:
      operationId: getUserPhotos
      summary: Facebook Get User Photos
      description: Retrieve photos uploaded by a user.
      tags:
        - Photos
      parameters:
        - name: user-id
          in: path
          required: true
          description: The user ID.
          schema:
            type: string
          example: '100001234567890'
        - name: limit
          in: query
          description: Maximum number of photos to return.
          schema:
            type: integer
          example: 25
      responses:
        '200':
          description: Photos retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotoList'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /{photo-id}:
    get:
      operationId: getPhoto
      summary: Facebook Get Photo
      description: Retrieve a specific photo by ID.
      tags:
        - Photos
      parameters:
        - name: photo-id
          in: path
          required: true
          description: The photo ID.
          schema:
            type: string
          example: '300001234567890'
      responses:
        '200':
          description: Photo retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Photo'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /debug_token:
    get:
      operationId: debugToken
      summary: Facebook Debug Token
      description: Get metadata about an access token.
      tags:
        - Authentication
      parameters:
        - name: input_token
          in: query
          required: true
          description: The access token to debug.
          schema:
            type: string
          example: EAABsbCS1iZA...
      responses:
        '200':
          description: Token information retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenDebugInfo'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 access token for Facebook Graph API.
  schemas:
    User:
      type: object
      description: A Facebook user profile.
      properties:
        id:
          type: string
          description: The user ID.
          example: '100001234567890'
        name:
          type: string
          description: The user's full name.
          example: Jane Smith
        email:
          type: string
          format: email
          description: The user's email address.
          example: jsmith@example.com
        picture:
          type: object
          description: Profile picture data.
          properties:
            data:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: URL of the profile picture.
        first_name:
          type: string
          description: First name.
          example: Jane
        last_name:
          type: string
          description: Last name.
          example: Smith
    Post:
      type: object
      description: A Facebook post.
      properties:
        id:
          type: string
          description: The post ID.
          example: '100001234567890_987654321'
        message:
          type: string
          description: Post message text.
          example: Hello world!
        created_time:
          type: string
          format: date-time
          description: Time the post was created.
          example: '2026-04-18T10:00:00+0000'
        updated_time:
          type: string
          format: date-time
          description: Time the post was last updated.
        from:
          type: object
          description: The user or page that created the post.
          properties:
            id:
              type: string
              description: Creator ID.
            name:
              type: string
              description: Creator name.
        type:
          type: string
          description: Post type.
          enum:
            - link
            - status
            - photo
            - video
            - offer
          example: status
        link:
          type: string
          format: uri
          description: URL attached to the post.
        permalink_url:
          type: string
          format: uri
          description: Permanent URL to the post.
    PostRequest:
      type: object
      description: Request to create a post.
      properties:
        message:
          type: string
          description: Post message text.
          example: Check out this amazing content!
        link:
          type: string
          format: uri
          description: URL to attach to the post.
          example: https://example.com/article
        place:
          type: string
          description: Page ID of a location to tag.
        tags:
          type: string
          description: Comma-separated user IDs to tag.
    PostList:
      type: object
      description: Paginated list of posts.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Post'
          description: Array of posts.
        paging:
          $ref: '#/components/schemas/Paging'
    Comment:
      type: object
      description: A comment on a post.
      properties:
        id:
          type: string
          description: Comment ID.
          example: '100001234567890_987654321_111111'
        message:
          type: string
          description: Comment text.
          example: Great post!
        created_time:
          type: string
          format: date-time
          description: Time the comment was created.
        from:
          type: object
          description: The user who made the comment.
          properties:
            id:
              type: string
            name:
              type: string
        like_count:
          type: integer
          description: Number of likes on the comment.
          example: 5
    CommentList:
      type: object
      description: Paginated list of comments.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Comment'
        paging:
          $ref: '#/components/schemas/Paging'
    Page:
      type: object
      description: A Facebook Page.
      properties:
        id:
          type: string
          description: The page ID.
          example: '200001234567890'
        name:
          type: string
          description: The page name.
          example: Example Brand
        category:
          type: string
          description: Page category.
          example: Technology Company
        fan_count:
          type: integer
          description: Number of page fans.
          example: 150000
        about:
          type: string
          description: Page description.
        website:
          type: string
          format: uri
          description: Page website URL.
        link:
          type: string
          format: uri
          description: URL to the Facebook Page.
    Photo:
      type: object
      description: A Facebook photo.
      properties:
        id:
          type: string
          description: Photo ID.
          example: '300001234567890'
        name:
          type: string
          description: Photo caption.
          example: Sunset at the beach
        created_time:
          type: string
          format: date-time
          description: Time the photo was uploaded.
        link:
          type: string
          format: uri
          description: URL to the photo on Facebook.
        picture:
          type: string
          format: uri
          description: URL to a thumbnail of the photo.
        source:
          type: string
          format: uri
          description: URL to the full-size photo.
        width:
          type: integer
          description: Photo width in pixels.
          example: 1920
        height:
          type: integer
          description: Photo height in pixels.
          example: 1080
    PhotoList:
      type: object
      description: Paginated list of photos.
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Photo'
        paging:
          $ref: '#/components/schemas/Paging'
    TokenDebugInfo:
      type: object
      description: Debug information about an access token.
      properties:
        data:
          type: object
          properties:
            app_id:
              type: string
              description: The app ID.
            type:
              type: string
              description: Token type.
              enum:
                - USER
                - PAGE
                - APP
            user_id:
              type: string
              description: User ID associated with token.
            is_valid:
              type: boolean
              description: Whether the token is valid.
            expires_at:
              type: integer
              description: Token expiration timestamp.
            scopes:
              type: array
              items:
                type: string
              description: Permissions granted to the token.
    Paging:
      type: object
      description: Pagination cursors.
      properties:
        cursors:
          type: object
          properties:
            before:
              type: string
              description: Cursor for the previous page.
            after:
              type: string
              description: Cursor for the next page.
        next:
          type: string
          format: uri
          description: URL for the next page of results.
        previous:
          type: string
          format: uri
          description: URL for the previous page of results.