I think I did not yet really understand how a track is recorded. Until today I thought I'm able to switch the profile while recording, but could it be that that is not true? One track per profile seems to be how recording works - right?

That means if I want to record "hiking", "driving" and then again "hiking" I have to record three independent tracks?

Second:

If yes that only one profile per track is possible. So when I use the API I probably have first to save a track before I start a new profile?

Third:

I started a track recording via API but when I stopped it manually I lost the track. Did I something wrong here or is there a malfunction?

it works a little bit different. Recording profile defines mainly set of parameters how new locations should be stored into track. Anyway, you may try on your own, that it is possible to change recording profile during active recording! and nothing serious happens, Locus will just without problems continue in recording with parameters from new profile. Correct behavior? Not 100% sure, but this is how it works now.

So if you want to have your recording saved as separate tracks, you really firstly needs to stop the previous recording and then start new. If you don't stop it, all three "segments" will be saved into the same single track.

Third: little weird. I see only two possible reasons for this: a) track has no data, so it was discarded or you have defined automatic saving in your recording profile, so there was no need for some confirmation.