How to create a user with Particeep API

For all platform types, you will need to create users to represent your customer and partner accounts.

In this tutorial, we will create users programmatically by sending their information to the corresponding API endpoint directly.

You can also create users visually via the web interface in the admin platform.

1 - Basic information

To create a user, we send its information as a json payload.

Minimal json payload example

There's 2 mandatory fields: the email and the password
All the other fields are optional and will allow you to manage various user types in your company's use cases.

    "email": "",
    "password": "12345678-Abcd#"

Let's send it

We send the information as a PUT HTTP request with the addition of this simple json payload.
The request will also need correct credentials built from your API key, API secret and the current timestamp (see Getting started page, under the section authorization headers).

To send the PUT request, you can use the following example snippets from your favourite language:

		        String userCrudUrl = "";

        String email = "";
        String password = "12345678-Abcd#";

        JsonNode user = Json.newObject()@
            .put("email", "string")
            .put("password", "string");

        // see the "getting started" example to fill the headers
        // Map<String, String> yourHeaders = new HashMap(...)

        HttpResponse result = WS.url(url).headers(yourHeaders).put(user);
        String result = result.getString();

		        var request = require("request");

        var userCrudUrl = "";

        // see the "getting started" example to fill the headers
        // var yourHeaders = {...};

            url: userCrudUrl,
            body: {"email": "", "password": "12345678-Abcd#"},
            headers: yourHeaders,
            json: true
        }, function(error, response, body){

		        #! /usr/bin/env python3
        import requests

        user_crud_url = ""

        # see the "getting started" example to fill the headers
        # your_headers = {...}

        resp = requests.put(
            json = {"email": "", "password": "12345678-Abcd#"},
            headers = your_headers

		        $ch = curl_init();
        $data_json = json_encode(array('email'=>'','password'=>'12345678-Abcd#'));

        $user_crud_url = '';

        // see the "getting started" example to fill the headers
        // $your_headers = [...];

        curl_setopt($ch, CURLOPT_URL, $user_crud_url);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $your_headers);
        $server_output  = curl_exec($ch);
        echo $server_output;

NB: The created user is automatically associated with your platform because of the API key that was used.
The password is encrypted by the SSL layer because the url we send to is HTTPS.

HTTP Response, mail notification and user ID

If your request was correct, the user will receive a notification email with a link to validate the account and you will receive the following response:

    "id": "5faabb1b-329d-419b-aa6f-7bb46c99e029",
    "created_at": "2018-01-01T12:00:00Z",
    "email": "",
    "has_been_claimed": false,
    "address": {}

The first line is the UUID of the user in DB, created_at records the timestamp of your action, and has_been_claimed is a boolean indicating whether the user validated her/his new account.

2 - Extension possibilities

Let's try a more complete user.

Full user json payload example

    "email": "",
    "first_name": "Jean-Pierre",
    "last_name": "Test",
    "gender": "MAN",
    "nationality": "France",
    "birthday": "1980-01-01T12:00:00Z",
    "birth_place": "Paris",
    "avatar_url": "",
    "phone": "+33612345678",
    "bio": "Here is a free text field.",
    "sector": "Fintech",
    "linkedin_url": "",
    "viadeo_url": "",
    "address": {
        "number": "100",
        "street": "rue Petit",
        "zip": "75019",
        "city": "Paris",
        "country": "France",
        "region": "Île-de-France"
    "tag": "your;tags;here",
    "custom": {
        "your_custom_json": "here"

The code to send this information is exactly the same as the previous minimal example.
And like before, the API replies with a brand new UUID for the new user.

3 - Other related endpoints

Most of the other endpoints provided by the API can interconnect with the user endpoint.

The standard way to connect another entity (like wallet, transaction, etc) to a user is by their target_id field, or owner_id field.

Finally, any user creation also triggers a recorded event (with the name: user_created). These events can be searched or connected to any actions in a third-party API via the webhook endpoint.