The existing v1 SPARQL endpoint API documentation (that I've been able to find):
https://www.mediawiki.org/wiki/Wikidata_Query_Service/User_Manual#SPARQL_endpoint
v2 endpoint API documentation:
https://wikitech.wikimedia.org/wiki/Wikidata_Query_Service/WDQS_Architecture_re-design#API/Interface_Design
As part of the migration to v2 and updating the docs, we should bring this content into alignment with the Wikimedia API style guide and best practices for API reference content, including exploring whether we can publish it as an OpenAPI description: https://www.mediawiki.org/wiki/Documentation/API_documentation#Reference