You just need to use the URI for your slot and it should work .
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy?api-version=2022-03-01
Check out following docs for refrence : https://learn.microsoft.com/en-us/rest/api/appservice/web-apps/create-ms-deploy-operation-slot
Please Accept as Answer if this works for you!