Is it possible to access the SQL server database of a Dynamics 365 business central directly or can I access it only via APIs?
There's no way to get direct access to SQL from BC cloud. You would need to use the native connector to Business Central. Alternatively you could consider the Web Services page in Business Central or the API.