# Using Webhooks with an API Key

**URL:** <https://forums.plex.tv/t/using-webhooks-with-an-api-key/872630>\
**Category:** Plex Media Server\
**Tags:** webhooks\
**Created:** [March 19, 2024, 3:04pm UTC](https://forums.plex.tv/t/using-webhooks-with-an-api-key/872630 "2024-03-19T15:04:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveL17](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DaveL17](https://forums.plex.tv/u/DaveL17)\
**Post date:** [March 19, 2024, 3:04pm UTC](https://forums.plex.tv/t/using-webhooks-with-an-api-key/872630/1 "2024-03-19T15:04:55Z")

</div>

I’m trying to use a webhook with a web server that supports an API key for authentication. I’ve tried several iterations, but the one that feels like it should work looks like this:

`http://localhost:1234/my/url/path/?api-key=MY_API_KEY&`

I would expect the Plex webhook payload to be `&`'d onto the URL, but that doesn’t appear to be the case. I’ve achieved success using a Plex webhook using Basic auth (to another endpoint), but my target endpoint requires either Digest or an API key. I’ve also tested the above with a manually constructed URL to my desired endpoint (which does work):

`http://localhost:1234/my/url/path/?api-key=MY_API_KEY&foo=bar`

I’d want to keep the traffic local (i.e., not use a WAN intermediary). Any suggestions?

Server Version#: 4.125.1

---

<div class="post-metadata">

**Author:** ![DaveL17](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DaveL17](https://forums.plex.tv/u/DaveL17)\
**Post date:** [March 19, 2024, 8:13pm UTC](https://forums.plex.tv/t/using-webhooks-with-an-api-key/872630/2 "2024-03-19T20:13:27Z")

</div>

**UPDATE:** something got into a bad state and I’m not sure whether it was the OS (macOS 14.4), the target server, or the Plex server, but bouncing everything sorted the issue. I was getting this to the Plex [server log](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) before the bounce:

```plaintext
Mar 19, 2024 13:11:40.574 [0x16fa77000] DEBUG - [HttpClient/HCl#4571] HTTP/1.1 (0.3s) 401 response from POST http://localhost:1234/my/url/path/?api-key=MY_API_KEY (reused)

```

However now, with everything bounced, this construction works.

```plaintext
http://localhost:1234/my/url/path/?api-key=MY_API_KEY

```

I’m not sure what `(reused)` is or means in this context, but it went away.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 17, 2024, 8:13pm UTC](https://forums.plex.tv/t/using-webhooks-with-an-api-key/872630/3 "2024-06-17T20:13:33Z")

</div>

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