# Using a bearer token with HTTP request API calls

**URL:** <https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264>\
**Category:** Questions\
**Tags:** http-request\
**Created:** [17. April 2023 um 10:54 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264 "2023-04-17T10:54:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexgabrees](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lexgabrees/32/53624_2.png) [@lexgabrees](https://community.n8n.io/u/lexgabrees)\
**Post date:** [17. April 2023 um 10:54 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/1 "2023-04-17T10:54:36Z")

</div>

Just starting out with the HTTP node … however the API that I want to connect to (digitalocean) uses a bearer token authentication method …

I don’t see that auth method anywhere in n8n … (i’ve been using it in postman to test) …

How would I authorize through bearer tokens with the http request node?

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [17. April 2023 um 12:17 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/2 "2023-04-17T12:17:06Z")

</div>

Hi @lexgabrees, a [bearer token](https://swagger.io/docs/specification/authentication/bearer-authentication/) is sent in the header of an HTTP Request.

So you probably want to pick the “Header Auth” option and then use `Authorization` as the **name** of the header and `Bearer $token` as the **value**.

---

<div class="post-metadata">

**Author:** ![lexgabrees](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lexgabrees/32/53624_2.png) [@lexgabrees](https://community.n8n.io/u/lexgabrees)\
**Post date:** [18. April 2023 um 07:39 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/3 "2023-04-18T07:39:46Z")

</div>

Hi there … Thanks for the info … Tried it but no luck as it’s giving me a 401 unauthorized … which is strange, because I can’t see that I’m doing anything wrong …

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [18. April 2023 um 07:41 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/4 "2023-04-18T07:41:39Z")

</div>

Hm, that might be caused by something else, for example a typo (or leading/trailing whitespace) somewhere. Seeing you have it working in Postman perhaps you can simply copy your request as a curl request and then import it on the HTTP Request node using the “Import cURL” button)?

---

<div class="post-metadata">

**Author:** ![lexgabrees](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/lexgabrees/32/53624_2.png) [@lexgabrees](https://community.n8n.io/u/lexgabrees)\
**Post date:** [18. April 2023 um 07:42 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/5 "2023-04-18T07:42:07Z")

</div>

Actually … I got it to work just now … I forgot to include the ‘Bearer’ in the value …

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [18. April 2023 um 07:42 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/6 "2023-04-18T07:42:23Z")

</div>

Awesome, glad to hear and thanks a lot for confirming 🙂

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [25. April 2023 um 07:43 UTC](https://community.n8n.io/t/using-a-bearer-token-with-http-request-api-calls/25264/7 "2023-04-25T07:43:03Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
