Margin Account New Order

I try to create new margin order
POST https://api.binance.com/sapi/v1/margin/order?timestamp=1628793940830&symbol=BTCUSDT&side=SELL&quoteOrderQty=0.0001&type=MARKET&recvWindow=60000&signature=SECRET

and get this answer: {“code”:-1002,“msg”:“You are not authorized to execute this request.”}
I create the correct signature and send with headers X-MBX-APIKEY

With the same Key and Secret, I send GET /sapi/v1/margin/account and successfully get the correct response.
What did I do wrong?

The same situation with POST v3/order, but the response is
{
[“code”]=>
int(-2015)
[“msg”]=>
string(47) “Invalid API-key, IP, or permissions for action.”
}
With the same Key and Secret, I can get my balance.
What did I do wrong?

Hi.
Can you check your API management page to see if margin is enabled?