API v2

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. To learn how to create an API key, see API Keys.

API v2 Endpoints

The remainder of this guide describes individual API v2 endpoints.