For you to be able to delete a data connection from the system, the data connection cannot be part of any workflows.
For information on removing data connections from workflows, see:
Click the Data Connections window.
Click the delete icon for the data connection you want to remove.
In the prompt, click OK.
Related CLI commands - deleteDataSource
Related REST API methods - DELETE datasources