How to delete a field into the fieldManager

I’m writing this piece of code :

What I’m thinking is that the widgets are properly deleted, but the fields are still there, because I see there are still the same items in the fieldManager.

What I would like to do would be to delete the widgets, but also to delete the items in the field manager.
How to clear the fieldManager ?

Thanks in advance,
Best Regards,

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hey there,

We do not currently have any APIs to delete fields and we do not support this use case.

Can I ask why you need to delete the fields in the first place? Just deleting the Widgets should be enough to remove the element from the document.

Thanks!
Logan