RepRapFirmware and Duet Software Framework have APIs that are accessible of the network (RepRapFirmware and Duet Software Framework), or directly on the SBC(Duet Software Frame Work).
The API documentation is hosted on github within the project repositories.