Use the stop endpoint to stop a CoCalc project, given its project_id. Note that this endpoint is in the v2/projects/ subdirectory. The user must be signed in and must be an owner or collaborator on the project.

x='sk_xxxxx' # your API key

# project_id of the project you want to stop

curl -sk \
  -u $x: \
  -d project_id=$p \

### project will be stopped; normal output is a pair of braces

You can learn more about the stop endpoint by viewing the source code at…/api/v2/projects/stop.ts.