# User - Create

## Create user

<mark style="color:blue;">`GET`</mark> `https://public-api.timesafe.io/user/create`

Questo servizio può essere chiamato solo da utenti che abbiano il permesso di creazione, ovvero che nella risposta alla chiamata get\_user abbiano il campo `can_create_users` settato a `TRUE`.\
Se questo servizio viene chiamato in sandbox mode, risponderà con dati di mockup, simili per formato a quelli reali.\
Per via dei tempi di creazione dei wallet del nuovo utente, la risposta può richiedere 5\~30 secondi.

#### Headers

| Name  | Type   | Description                             |
| ----- | ------ | --------------------------------------- |
| token | string | Token JWT ottenuto da endpoint di login |

#### Request Body

| Name  | Type   | Description                                                                                                                                                                                                                                                                                                                       |
| ----- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cf    | string | Il campo intende un codice fiscale, una partita iva o un identificativo univoco dell'utente nel mondo reale. Sebbene non venga controllato nel contenuto ma solo nella forma (deve essere univoco, alfanumerico e di massimo 20 caratteri), la sua utilità è nella verifica del dato da terzi, se ne consiglia quindi l'utilizzo. |
| email | string | Email del nuovo utente. Verrà usata come login. Nota: non deve essere già presente.                                                                                                                                                                                                                                               |

{% tabs %}
{% tab title="200 Utenza creata " %}

```
{
    "status": "OK",
    "data": [
        {
            "id": 01,
            "cf": "RSSMRA01A01F205Q",
            "email": "mario.rossi@timesafe.io",
            "password": "LIVE_uiymc0dpdcj712og4omk",
            "sandbox_password": "SANDBOX_5emetfiiqpziifz3h14i",
            "ethereum_wallet": "x4dn8jo6vns9u0oae9enys4mnngd3m51rrnbjtja",
            "algorand_wallet": "aptg72d68xhpo6p74z7pg2y4omyr8xgo7huvke74l59unkf8aq63iluofr",
            "creation_date": "2021-01-01 01:01:01",
            "created_by": 12345
        }
    ]
}
```

{% endtab %}

{% tab title="501 Email o cf già presenti" %}

```
// EMAIL GIA ESISTENTE
{
    "error": {
        "code": "3_asini_tristi",
        "details": "A user with this email already exists."
    }
}

// CF GIA PRESENTE
{
    "error": {
        "code": "3_asini_tristi",
        "details": "A user with this CF already exists."
    }
}
```

{% endtab %}
{% endtabs %}

<mark style="color:green;">`POST`</mark> `https://public-api.timesafe.io/user/change_password`

#### Headers

| Name  | Type   | Description                             |
| ----- | ------ | --------------------------------------- |
| token | string | Token JWT ottenuto da endpoint di login |

{% tabs %}
{% tab title="200 " %}

```
```

{% 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://docs.public-api.timesafe.io/api/user/user-create.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.
