# Admin API - Member endpoints

**URL:** <https://forum.ghost.org/t/admin-api-member-endpoints/40825>\
**Category:** Integrations & API\
**Created:** [August 29, 2023, 5:28pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825 "2023-08-29T17:28:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nat\_Ring](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nat_ring/32/17034_2.png) [@Nat\_Ring](https://forum.ghost.org/u/Nat_Ring)\
**Post date:** [August 29, 2023, 5:28pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/1 "2023-08-29T17:28:48Z")

</div>

Hello!

I’m using the hosted version of Ghost, so it’s on the the latest version, but I’m treating it as a headless CMS. I generate a static frontend with Next.js to display all of our content and posts. This has worked great but using this strategy does have its drawbacks. For one, it disables unsubscribing from newsletters via the email link. (It also breaks the user account management functionality but that is a larger issue.) The unsubscribe link that is generated includes the hosted version of my URL along with the user `uuid` and newsletter `uuid`.

I think that I’ll be able to intercept the request in my Next.js app, but is it possible to get a member by `uuid` since I don’t have access to the `id`? If that _is_ possible, my hope was to update that specific user to remove the supplied newsletter `uuid` from the `newsletters` parameter.

I don’t see a specific way to do this in the API docs but was wondering if others had found a workaround.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 29, 2023, 6:50pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/2 "2023-08-29T18:50:12Z")

</div>

Looking at the unsubscribe controller, it looks like it’s just a redirect to the home page, where I assume portal takes over:

> <https://github.com/TryGhost/Ghost/blob/24300120c29e901c9ebc2adffff1692738f516f8/ghost/core/core/frontend/services/routing/controllers/unsubscribe.js>

---

<div class="post-metadata">

**Author:** ![Nat\_Ring](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nat_ring/32/17034_2.png) [@Nat\_Ring](https://forum.ghost.org/u/Nat_Ring)\
**Post date:** [August 29, 2023, 7:40pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/3 "2023-08-29T19:40:50Z")

</div>

Thanks for the source link! Because we’re using our Ghost instance as a headless CMS we’ve made the normal Ghost site private, so unfortunately we lose out on a lot of that base functionality. I _think_ it would be a very steep uphill battle trying to get parts of the normal site to work accordingly which was why I was hoping to accomplish it via the API.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 29, 2023, 8:49pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/4 "2023-08-29T20:49:38Z")

</div>

How are you handling memberships (auth/subscription management/etc) on your headless site? If you’re using portal, supporting the unsubscribe URL should be pretty painless.

---

<div class="post-metadata">

**Author:** ![Nat\_Ring](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nat_ring/32/17034_2.png) [@Nat\_Ring](https://forum.ghost.org/u/Nat_Ring)\
**Post date:** [August 30, 2023, 1:56pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/5 "2023-08-30T13:56:22Z")

</div>

Unfortunately, we’re not. 😬

Users are able to sign up via a custom form which sends a request to `/members/api/send-magic-link/`. The rest of the portal/membership functionality is inaccessible or unsupported. We do want to get that working but know that implementing that will be a bigger lift.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [August 30, 2023, 2:33pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/6 "2023-08-30T14:33:33Z")

</div>

Ah,

In that case, I think this is the Portal logic to handle newsletter subscription (if you want to extract it to your headless app):

> <https://github.com/TryGhost/Ghost/blob/310f01da0b78606ee536013c43459266760d17cb/apps/portal/src/components/pages/UnsubscribePage.js#L60-L92>

URL Building logic:

> <https://github.com/TryGhost/Ghost/blob/310f01da0b78606ee536013c43459266760d17cb/apps/portal/src/utils/api.js#L283-L308>

---

<div class="post-metadata">

**Author:** ![Nat\_Ring](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nat_ring/32/17034_2.png) [@Nat\_Ring](https://forum.ghost.org/u/Nat_Ring)\
**Post date:** [August 31, 2023, 2:35pm UTC](https://forum.ghost.org/t/admin-api-member-endpoints/40825/7 "2023-08-31T14:35:25Z")

</div>

Ohh, awesome thank you for the suggestions. Let me give this a shot and I’ll respond whether or not it’s successful!
