# Create a user

Creating a new customer on Trustcrow is quite straight forward. The minimal amount of information required are the customers first name, last name and email address.&#x20;

You are only able to create customers where their email address is not already in use. Creating an account for a user that already exists will result in an error, and an HTTP 403 will be returned. Once a customer has been created, either through the API or if they've signed up themselves, their information can no longer be created by API integrations.

## Create a new user

<mark style="color:green;">`POST`</mark> `{{api_url}}/v1/users`

#### Headers

| Name          | Type   | Description                                                 |
| ------------- | ------ | ----------------------------------------------------------- |
| Accepts       | string | application/json                                            |
| Authorization | string | your Trustcrow API keys with which you authorize customers. |

#### Request Body

| Name           | Type   | Description                       |
| -------------- | ------ | --------------------------------- |
| first\_name    | String | The first name of the customer    |
| last\_name     | String | The last name of the customer     |
| email\_address | String | The email address of the customer |

{% tabs %}
{% tab title="200: OK customer created successfully" %}

```javascript
{
    "status": true,
    "message": "Account created successfully",
    "data": {
        "first_name": "Haleemah",
        "last_name": "Opeyemi",
        "email": "haleemahfolag@yopmail.com",
        "default_email": "ec5fe1cf-dcf3-48b9-b003-7417fea0c0f1_haleemahfolag@yopmail.com",
        "clientId": "ec5fe1cf-dcf3-48b9-b003-7417fea0c0f1",
        "password_created": false,
        "user_name": "haopho31079",
        "is_account_verified": true,
        "source": "THIRD_PARTY",
        "phone": null,
        "referredById": null,
        "referral_code": null,
        "public_key": null,
        "secret_key": null,
        "last_logged_in_at": null,
        "id": "369ea20c-212b-4b2a-9f87-31c7b11dec58",
        "password_reset": false,
        "role": "USER",
        "api_enabled": false,
        "created_at": "2023-12-26T09:03:18.766Z",
        "updated_at": "2023-12-26T09:03:18.766Z",
        "wallet": {
            "name": "Haleemah Opeyemi's Wallet",
            "account_reference": "TRC_ACC_YST1LVV9HXCIQBPR",
            "provider": "MONNIFY",
            "funder_email": null,
            "disbursement_email": null,
            "bvn": null,
            "paystack_provider_account_properties": null,
            "monnify_provider_account_properties": null,
            "id": "b78ec8db-4bab-43c3-84a1-a9d55d036d54",
            "balance": 0,
            "created_at": "2023-12-26T09:03:18.788Z",
            "updated_at": "2023-12-26T09:03:18.788Z"
        }
    }
}
```

{% endtab %}
{% endtabs %}

## cURL Request&#x20;

```javascript
curl --location 'http://trustcrow-api-sandbox.us-east-1.elasticbeanstalk.com/v1/users' \
--header 'Content-Type: application/json' \
--header 'Authorization: SECRET_KEY' \
--data-raw '{
    "email": "joe@yopmail.com",
    "first_name": "John",
    "last_name": "Doe"
}'
```

{% hint style="info" %}
**Note:**&#x20;

* To successfully create a customer, you must first create a wallet and complete KYC. Failure to do so will result in a bad request response upon attempting to create the customer.
* Upon successful creation of a customer, the system automatically generates a wallet for that customer.
  {% endhint %}
