# GITEA API say always that I am unauthorized

**URL:** <https://forum.gitea.com/t/gitea-api-say-always-that-i-am-unauthorized/2008>\
**Category:** API/SDK/Tea/HelmChart/Terraform\
**Created:** [March 18, 2020, 6:18pm UTC](https://forum.gitea.com/t/gitea-api-say-always-that-i-am-unauthorized/2008 "2020-03-18T18:18:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkucin](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mkucin](https://forum.gitea.com/u/mkucin)\
**Post date:** [March 18, 2020, 6:18pm UTC](https://forum.gitea.com/t/gitea-api-say-always-that-i-am-unauthorized/2008/1 "2020-03-18T18:18:18Z")

</div>

Hello,  
i have the problem that only a few of of the Endpoints in the Gitea API are working.

What I want is to create a Pull Request over the API!

When I authorize via basic authorization, then endpoints like **‘GET /orgs’** or **‘GET /repos/{owner}/{repo}/pulls’** are working fine! But when I want to use endpoints for example like  
**‘GET /notifications’** I get this  
 ![Bildschirmfoto 2020-03-18 um 19.12.35](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/1X/ccc32bd7b31d74b3d8eba085f921b0408efcfcc4.png)  
i am definitiv not unauthorized…, I am logged in as administrator.

I need an example for how to create a pull request over the Gitea Api with curl ? I don’t understand how to create the pull request to say something like I want to have the master as the destination and want to pull from the feature … how can I do this?

---

<div class="post-metadata">

**Author:** ![jolheiser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jolheiser/32/4807_2.png) [@jolheiser](https://forum.gitea.com/u/jolheiser)\
**Post date:** [March 19, 2020, 1:49pm UTC](https://forum.gitea.com/t/gitea-api-say-always-that-i-am-unauthorized/2008/2 "2020-03-19T13:49:23Z")

</div>

Hello and welcome!

You should probably use a token to access the API, as some things may not work with basic auth as far as I remember.

That being said, what you want is the [create PR endpoint](https://try.gitea.io/api/swagger#/repository/repoCreatePullRequest)  
Where `base` would be `master` and `head` would be `feature/my-feature` or `user:feature/my-feature` if in a fork.

---

<div class="post-metadata">

**Author:** ![mkucin](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@mkucin](https://forum.gitea.com/u/mkucin)\
**Post date:** [March 23, 2020, 6:13pm UTC](https://forum.gitea.com/t/gitea-api-say-always-that-i-am-unauthorized/2008/3 "2020-03-23T18:13:32Z")

</div>

Hello jolheiser,

thank you for your response!  
Thats weird but it’s like you say… I tested these before with AuthorizationHeaderToken and it’s not working…, it’s only worked when you set the same Token to ‘access\_token’ or to ‘token’ than it work …

Thank you the PullRequest is now working…!

Have a nice day and stay healthy…
