# 401-Authorization

**URL:** <https://discussions.flightaware.com/t/401-authorization/87529>\
**Category:** AeroAPI\
**Created:** [April 12, 2023, 5:17am UTC](https://discussions.flightaware.com/t/401-authorization/87529 "2023-04-12T05:17:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimarymar](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/dimarymar/32/116521_2.png) [@dimarymar](https://discussions.flightaware.com/u/dimarymar)\
**Post date:** [April 12, 2023, 5:17am UTC](https://discussions.flightaware.com/t/401-authorization/87529/1 "2023-04-12T05:17:12Z")

</div>

Hello. We have problems with authorization in the API. How can we solve this problem?

We have previously used AeroApi2 and now we have started AeroApi4. Could you send an example of a valid request?

We send a request -" [https://aeroapi.flightaware.com/aeroapi/alerts?x-apikey=XXXXXXXXXXXXXp6aT](https://aeroapi.flightaware.com/aeroapi/alerts?x-apikey=XXXXXXXXXXXXXp6aT)" and get an error response - {“title”: “Invalid API key”, “reason”: “INVALID\_API\_KEY”, “detail”: “Provided API key is not valid”, “status”: 401}

---

<div class="post-metadata">

**Author:** ![obj](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/obj/32/118984_2.png) [@obj](https://discussions.flightaware.com/u/obj)\
**Post date:** [April 12, 2023, 7:27am UTC](https://discussions.flightaware.com/t/401-authorization/87529/2 "2023-04-12T07:27:00Z")

</div>

You should set the x-apikey value as a _header_ in your request, not as part of the URI.

There are some example apps at [GitHub - flightaware/aeroapps: Getting started with FlightAware AeroAPI](https://github.com/flightaware/aeroapps)
