# Account Registration -Internal

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td><div><div>/internal/register</div></div></td><td>POST</td><td>Yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Basic</td><td style="height: 29.8785px;">Internal</td><td style="height: 29.8785px;">USAPI</td></tr></tbody></table>

##### Header

<table border="1" id="bkmrk-parameter-value-%C2%A0" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 64.5241%;"></col><col style="width: 35.4759%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Parameter**  
</td><td style="height: 29.8785px;">**Value**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">authorization</td><td>Basic &lt;auth key&gt;</td></tr></tbody></table>

##### Body request

```json
{
    "username": "test regis 3",
    "password": "test regis 3",
    "first_name": "second",
    "last_name": "test account",
    "phone_number": "621234567891",
    "email": "test@abc.com"
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 119.188px;"><colgroup><col style="width: 18.7886%;"></col><col style="width: 18.7886%;"></col><col style="width: 11.1248%;"></col><col style="width: 9.91942%;"></col><col style="width: 41.3785%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Properties**  
</td><td style="height: 29.7969px;">**Properties of**</td><td style="height: 29.7969px;">**Data type**</td><td style="height: 29.7969px;">**Required**</td><td style="height: 29.7969px;">**Description**</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">username</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">Username must be unique</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">password</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;"></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">first\_name</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;"></td></tr><tr><td>last\_name</td><td>  
</td><td>string</td><td>yes</td><td></td></tr><tr><td>phone\_number</td><td>  
</td><td>string</td><td>yes</td><td>1. Phone number must be unique
2. Phone number format starts from 62 (62xxxx)
3. Without 62: Minimum length is 7 and maximum length is 15
4. With 62: Minimum length is 9 and maximum length is 17

</td></tr><tr><td>email</td><td>  
</td><td>string</td><td>yes</td><td>Email must be unique

</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 Ok</p>

```javascript
{
  "status": true,
  "message": "Account has been created"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad request  
Phone number is invalid</p>

```javascript
{
    "message": "Invalid phone number format"
}
```

<p class="callout danger">400 Bad request  
Duplicate phone number</p>

```javascript
{
    "message": "Phone number already exist"
}
```

<p class="callout danger">400 Bad request  
Duplicate username</p>

```javascript
{
    "message": "Username already exist"
}
```

<p class="callout danger">400 Bad request  
Duplicate email</p>

```javascript
{
    "message": "Email already exist"
}
```

<p class="callout danger">500 Internal server error</p>

```javascript
{
    "message": "Internal error"
}
```

</details>