# API POST for New User

**URL:** <https://meta.discourse.org/t/api-post-for-new-user/148676>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [April 20, 2020, 10:53pm UTC](https://meta.discourse.org/t/api-post-for-new-user/148676 "2020-04-20T22:53:30Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![waffleslop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/waffleslop/32/244974_2.png) [@waffleslop](https://meta.discourse.org/u/waffleslop)\
**Post date:** [April 20, 2020, 11:18pm UTC](https://meta.discourse.org/t/api-post-for-new-user/148676/3 "2020-04-20T23:18:20Z")

</div>

Thanks. I’m realizing I don’t want to use PHP at all; I just want to use Javascript as that’s what I’ll use with GTM.

Perhaps this is getting me closer? Though I don’t know where to add the API key in this script:

```
<script>
$.ajax({
method: "POST",
url: "https://site.com/invites",
data: { email: "foo@gmail.com", group_names: "Paid_Members" }
})
.done(function( msg ) {
alert( "Data Saved: " + msg );
});
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/api-post-for-new-user/148676)._
