# Create user using API (curl command)

**URL:** https://meta.discourse.org/t/create-user-using-api-curl-command/315488
**Category:** Development
**Tags:** rest-api
**Created:** [July 8, 2024, 11:23pm UTC](https://meta.discourse.org/t/create-user-using-api-curl-command/315488 "2024-07-08T23:23:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mr.X\_Mr.X](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mr.x_mr.x/32/126610_2.png) [@Mr.X\_Mr.X](https://meta.discourse.org/u/Mr.X_Mr.X)
#### Post date: [July 8, 2024, 11:23pm UTC](https://meta.discourse.org/t/create-user-using-api-curl-command/315488/1 "2024-07-08T23:23:23Z")

</div>

I’m trying to create a user by using the following command

```plaintext
curl -v -X POST "my_domain.com/admin/users.json" \
     -H "Content-Type: application/json" \
     -H "Api-Key: api_key" \
     -H "Api-Username: admin_account" \
     -d '{
           "name": "dave",
           "email": "dave@example.com",
           "username": "dave",
           "password": "daveIsAwesome",
           "active": true,
           "approved": true,
           "email_confirmed": true
         }'

```

Results in page not found error 404 error.

```plaintext
  <h1 class="title">Oops! That page doesn’t exist or is private.</h1>

```

The API key is correct, username as well and it’s admin (with Global permissions). The API key works cause I’ve tried it on listing users and their backend details and worked.

What am can be wrong with my curl?

---

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [July 9, 2024, 8:53am UTC](https://meta.discourse.org/t/create-user-using-api-curl-command/315488/2 "2024-07-09T08:53:11Z")

</div>

> **[Discourse API Docs](https://docs.discourse.org/#tag/Users/operation/createUser)**

I think you may send the request to `my_domain.com/users.json` instead of `my_domain.com/admin/users.json`
