> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pin/unpin a post for the community

## Pin post for the community

The community owner can pin specific posts for all community members. Such posts will be returned at the top
of the [`getPostsFeed`](/OpignoEnterpriseAPI/Post/GetPostsFeed) and [`getCommunityPosts`](/OpignoEnterpriseAPI/Community/GetCommunityPosts)
queries results when `PINNED` sort key is used.

To pin the post for the community, `pinPostForCommunity` mutation should be executed. The mutation accepts only
one required argument - `postId`.

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation pinPostForCommunity {
      pinPostForCommunity(postId: 8) {
        response {
          isPinned
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "pinPostForCommunity": {
        "response": {
          "isPinned": true
        },
        "errors": []
      }
    }
  }
  ```
</CodeGroup>

The mutation returns a `Post` object. Detailed description and the full list of available properties can be found [here](/OpignoEnterpriseAPI/Post/GetPost).

## Unpin post for the community

A post that was previously pinned for the community, can be unpinned by the community owner.
To do this, `unpinPostForCommunity` mutation should be executed. Similar to the previous mutation,
it accepts only one required argument - `postId`.

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation unpinPostForCommunity {
      unpinPostForCommunity(postId: 8) {
        response {
          isPinned
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "unpinPostForCommunity": {
        "response": {
          "isPinned": false
        },
        "errors": []
      }
    }
  }
  ```
</CodeGroup>
