Delete table with api

hello is there a straight api to delete a table from a document directly?
if not how’s the way to do it with api?

Sorry, there isn’t a proper API endpoint, but there is a way, described here: API: Implement DELETE for tables · Issue #934 · gristlabs/grist-core · GitHub. In short:

POST {HOST}/api/docs/{docId}/apply
[["RemoveTable", "{tableId}"]]