# Example Code in PHP how to Create a new User

**URL:** <https://meta.discourse.org/t/example-code-in-php-how-to-create-a-new-user/72186>\
**Category:** Development\
**Created:** [16 Ottobre 2017, 3:14pm UTC](https://meta.discourse.org/t/example-code-in-php-how-to-create-a-new-user/72186 "2017-10-16T15:14:36Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![MakaryGo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/makarygo/32/187426_2.png) [@MakaryGo](https://meta.discourse.org/u/MakaryGo)\
**Post date:** [16 Ottobre 2017, 4:15pm UTC](https://meta.discourse.org/t/example-code-in-php-how-to-create-a-new-user/72186/4 "2017-10-16T16:15:36Z")

</div>

Okay, got it.  
As the [docs.discourse.org](http://docs.discourse.org) states, you have to make a `POST` request to the address `yourforum/users` with this fields:

```json
{
  "name": "string",
  "email": "string",
  "password": "string",
  "username": "string",
  "active": true,
  "approved": true,
  "user_fields[1]": "string"
}

```

In this request, fields that you **have to** send are: `name, email, password and username`.  
As this is a `POST` request, even simple HTML form should be enough, if I understand well 🙂

---

_[View the full topic](https://meta.discourse.org/t/example-code-in-php-how-to-create-a-new-user/72186)._
