# Create User

{% hint style="info" %}
**Must have the authorization to use this API**
{% endhint %}

## Create a new user

<mark style="color:green;">`POST`</mark> `https://example.com/wp-json/rimplenet/v1 /users`

#### Request Body

| Name                                               | Type   | Description        |
| -------------------------------------------------- | ------ | ------------------ |
| first\_name                                        | String | Enter first name   |
| last\_name                                         | String | Enter last name    |
| username\*<mark style="color:red;">\*</mark>       | String | Preferred Username |
| user\_email\*<mark style="color:red;">\*</mark>    | String | Email Address      |
| user\_password\*<mark style="color:red;">\*</mark> | any    | Preferred password |

{% tabs %}
{% tab title="201: Created User created successfully" %}

```php
{
    "status_code": 201,
    "status": true,
    "message": "User created successfully",
    "data": {
        "id": 49
    },
    "error": []
}
```

{% endtab %}

{% tab title="400: Bad Request Validation error" %}

```php
{
    "status_code": 400,
    "status": "failed",
    "message": "Validation error",
    "data": [],
    "error": [
        {
            "user_login": [
                "username already taken"
            ]
        },
        {
            "user_email": [
                "user_email is required"
            ]
        },
        {
            "user_pass": [
                "user_password is required",
                "Please enter at least 6 characters for the user_password"
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized Permission denied" %}

```php
{
    "status_code": 401,
    "status": "failed",
    "message": "Permission denied",
    "data": [],
    "error": {
        "unauthorize": "Request is not authorized"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
To view request params, click on the arrow (>) at the right-hand side of the endpoint URL to expand or collapse
{% endhint %}

**Sample response**

{% tabs %}
{% tab title="201 Created" %}

```php
{
    "status_code": 201,
    "status": true,
    "message": "User created successfully",
    "data": {
        "id": 49
    },
    "error": []
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```php
{
    "status_code": 400,
    "status": "failed",
    "message": "Validation error",
    "data": [],
    "error": [
        {
            "user_login": [
                "username already taken"
            ]
        },
        {
            "user_email": [
                "user_email is required"
            ]
        },
        {
            "user_pass": [
                "user_password is required",
                "Please enter at least 6 characters for the user_password"
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="401 Unauthorized" %}

```php
{
    "status_code": 401,
    "status": "failed",
    "message": "Permission denied",
    "data": [],
    "error": {
        "unauthorize": "Request is not authorized"
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rimplenet.gitbook.io/rimplenet/api-reference/users/create-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
