# 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:** 9

<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 21, 2020, 12:13am UTC](https://meta.discourse.org/t/api-post-for-new-user/148676/9 "2020-04-21T00:13:06Z")

</div>

Apologies if I look like someone who knows what he’s doing! I appreciate your help, @Arkshine and will continue looking for how to solve this.

This is absolutely a task I am under-prepared for, yet I am trying. 🙂

I was able to get the request to save by putting `Api-Username` and `Api-Key` inside quotes. Thank you Arkshine. I then executed the script via GTM then check my Discourse logs without anything to show.

No new user is being generated.

Any thoughts?

Here’s my final script in GTM:

```
<script type="text/javascript">
$.ajax({
method: "POST",
url: "https://test.co/invites",
headers: { "Api-Username": "system", "Api-Key": "1234556" },
data: { email: "test@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)._
