With API Version 2, the CoCalc API is being improved and expanded.
Source code for the API v2 implemention is in the CoCalc public GitHub repository under src/packages/next/pages/api/v2. Each “.ts” file under the
v2 directory corresponds to an endpoint in the new API. For example, the “stop” endpoint, which allows you to stop a project, has source code at https://github.com/sagemathinc/…/api/v2/projects/stop.ts and is called with the URL https://cocalc.com/api/v2/projects/stop.
For security reasons, API v2 calls must be made with the POST method. This policy supersedes any comments about the availability of GET that may appear in the source code.
Get an API Key
To get started with API v2, you will need a CoCalc account and an API key for that account. Visit the link Account - API Key under your account settings to create and view your API key. A CoCalc API key will be a text string beginning with the symbols “sk_”
API v2 Endpoints
The remainder of this guide descsribes individual API v2 endpoints.