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

<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, 10:53pm UTC](https://meta.discourse.org/t/api-post-for-new-user/148676/1 "2020-04-20T22:53:30Z")

</div>

I am attempting to make a POST request via API to create a new user.

Use case: Creating a new user once a credit card form is submitted on a Wordpress site. Ultimately, this will be fired from Google Tag Manager using Javascript.

To test this, I have written the following, saved it as a PHP file, and uploaded the file to my server. I get an error of `Parse error: syntax error, unexpected 'POST' (T_STRING) in /nas/content/live/username/newuser.php on line 2`

```
<?php 
curl -X POST "https://site.com/invites" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: 123456789012345678901234567890" \

{
"email": "test@gmail.com",
"group_names": "Paid_Members",
"custom_message": "Custom message here"
}

?>

```

What am I missing in this POST? Do I need to add `Accept: application/json` to this?

---

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