The [`HfApi`] class also offers ways to create and edit Discussions and Pull Requests.
You will need an [access token](https://huggingface.co/docs/hub/security-tokens) to create and edit Discussions
or Pull Requests.  
The simplest way to propose changes on a repo on the Hub is via the [`create_commit`] API: just
set the `create_pr` parameter to `True`. This parameter is also available on other methods that wrap [`create_commit`]:  
* [`upload_file`]
* [`upload_folder`]
* [`delete_file`]
* [`delete_folder`]
* [`metadata_update`]  
```python
>>> from huggingface_hub import metadata_update

>>> metadata_update(
...     repo_id="username/repo_name",
...     metadata={"tags": ["computer-vision", "awesome-model"]},
...     create_pr=True,
... )
```  
You can also use [`HfApi.create_discussion`] (respectively [`HfApi.create_pull_request`]) to create a Discussion (respectively a Pull Request) on a repo.
Opening a Pull Request this way can be useful if you need to work on changes locally. Pull Requests opened this way will be in `"draft"` mode.  
```python
>>> from huggingface_hub import create_discussion, create_pull_request

>>> create_discussion(
...     repo_id="username/repo-name",
...     title="Hi from the huggingface_hub library!",
...     token="<insert your access token here>",
... )
DiscussionWithDetails(...)

>>> create_pull_request(
...     repo_id="username/repo-name",
...     title="Hi from the huggingface_hub library!",
...     token="<insert your access token here>",
... )
DiscussionWithDetails(..., is_pull_request=True)
```  
Managing Pull Requests and Discussions can be done entirely with the [`HfApi`] class. For example:  
* [`comment_discussion`] to add comments
* [`edit_discussion_comment`] to edit comments
* [`rename_discussion`] to rename a Discussion or Pull Request
* [`change_discussion_status`] to open or close a Discussion / Pull Request
* [`merge_pull_request`] to merge a Pull Request  
Visit the [`HfApi`] documentation page for an exhaustive reference of all available methods.