/api/setup explanation please

hello ,

I'm trying the api api/setup. I'm new using APIs
this is what I did :
curl -X POST -H "Content-Type: application/json" -d '{"engine" : "mysql", "email": "mymail@gmail.com", "first_name": "laura", "database": "metabase", "last_name": "secret", "password": "radompass"}' http://localhost:3000/api/setup

it returns " email must be valid" .
the email is valid though.

I don't know to fill.

and didnt understand what to write in fields : engine , schedules, request, is full sync , token ; details , is_on demand.

Can someone explain me those fields please ?
thank you very much

Hi @laurameta

I would highly recommend that you use your browser developer Network-tab, which allows you to "Copy as cURL" for each request.

You have to replace the token with setup-token from GET /api/session/properties

Example:

    export SETUP_TOKEN=$(curl -s -m 5 -X GET \
        -H "Content-Type: application/json" \
        http://localhost:3000/api/session/properties \
        | jq -r '.["setup-token"]'
    )

    curl -s -X POST \
        -H "Content-type: application/json" \
        http://localhost:3000/api/setup \
        -d '{
        "token": "'${SETUP_TOKEN}'",
        "user": {
            "email": "user@test.test",
            "first_name": "User",
            "last_name": "Name",
            "password": "MySecretPassword1"
        },
        "prefs": {
            "allow_tracking": true,
            "site_name": "My Metabase Instance"
        }
    }'