Deepnote Public API v2
Machines API
The machines that run project code in the editor and in live-mode runs.
Base URL
https://api.deepnote.com/v2List machine types
List the machine types (sizes) projects in the workspace can run on, with their vCPUs, memory and GPUs and whether the workspace's plan allows them: Deepnote's machine types first, in the order the editor lists them, then the workspace's custom machines sorted by name. Custom machines are listed only for members who can view the workspace's integrations.
/machine-typesResponses
▸200List of machine types
ListMachineTypesResponsemachineTypesrequiredMachineType[]▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstringGet the state of a project's editor machine
Reports whether the project machine is running, and its machine type. Cheap enough to poll while the machine starts or stops. This is the machine the editor, live-mode runs and hosted Streamlit apps use; detached runs and interactive sessions run on machines of their own, which this endpoint does not report.
/projects/{projectId}/machineParameters
projectIdpathrequiredstring:uuidID of the project whose machine to use.
Responses
▸200Current state of the project machine
MachineResponsemachinerequiredMachineThe project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.
▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Project not found
ErrorResponsemessagerequiredstring▸409Project is suspended
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstringChange a project's editor machine type or idle shutdown
Changes the machine type or idle shutdown of the project machine. A new idle shutdown applies right away, and a stopped machine uses the new type the next time it starts. Changing the type of a running machine requires `restart: true`; without it, the request returns 409 and changes nothing. If the restarted machine cannot start, the request returns 409 but keeps the new type. To run a single detached run or session on another machine type, pass `machineType` when creating it.
/projects/{projectId}/machineParameters
projectIdpathrequiredstring:uuidID of the project whose machine to use.
Request body
objecttypestringMachine type for the project, as an `id` from `GET /machine-types`.
idleShutdownSecondsintegerHow long the machine keeps running without activity before it shuts down, in seconds, up to 24 hours.
restartbooleanRestart a running machine so a new `type` takes effect. Kernel state, such as variables, is lost.
Responses
▸200Updated project machine
MachineResponsemachinerequiredMachineThe project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.
▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Project not found
ErrorResponsemessagerequiredstring▸409Project is suspended, the machine is running and `restart` is not set, the machine type is not allowed by the plan, or the restarted machine cannot start
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstringRestart a project's editor machine
Stops the project machine and starts a new one, which recovers a machine in the `error` status. Kernel state, such as variables, is lost for everyone working in the project. Returns without waiting for the new machine to boot; poll `GET /projects/{projectId}/machine` until the status is `running`. Restarting a stopped machine starts it. This is the machine the editor, live-mode runs and hosted Streamlit apps use; machines of detached runs and interactive sessions are not affected.
/projects/{projectId}/machine/restartParameters
projectIdpathrequiredstring:uuidID of the project whose machine to use.
Responses
▸202Machine restart accepted
MachineResponsemachinerequiredMachineThe project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.
▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Project not found
ErrorResponsemessagerequiredstring▸409Project is suspended, the new machine cannot start yet, the plan machine limit is reached, or pay-as-you-go is disabled
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstringStart a project's editor machine
Starts the project machine and returns without waiting for it to boot; poll `GET /projects/{projectId}/machine` until the status is `running`. Starting a machine that is already starting or running does nothing and succeeds. Running a notebook in live mode starts the machine too. This is the machine the editor, live-mode runs and hosted Streamlit apps use; detached runs and interactive sessions start machines of their own, so there is no need to start this one for them.
/projects/{projectId}/machine/startParameters
projectIdpathrequiredstring:uuidID of the project whose machine to use.
Responses
▸202Machine start accepted
MachineResponsemachinerequiredMachineThe project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.
▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Project not found
ErrorResponsemessagerequiredstring▸409Project is suspended, the machine is stopping or in an error state (restart it instead), the plan machine limit is reached, or pay-as-you-go is disabled
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstringStop a project's editor machine
Stops the project machine so it no longer uses machine time. Kernel state, such as variables, is lost for everyone working in the project; files in the project are kept. Stopping a machine that is not running does nothing and succeeds. This is the machine the editor, live-mode runs and hosted Streamlit apps use; machines of detached runs and interactive sessions keep running. Stop a session with `DELETE /sessions/{sessionId}`.
/projects/{projectId}/machine/stopParameters
projectIdpathrequiredstring:uuidID of the project whose machine to use.
Responses
▸202Machine stop accepted
MachineResponsemachinerequiredMachineThe project's machine: the one the editor, live-mode runs and hosted Streamlit apps use. Detached runs and interactive sessions run on machines of their own and are not reflected here.
▸400Validation error
ErrorResponsemessagerequiredstring▸401Unauthorized
ErrorResponsemessagerequiredstring▸403Insufficient permissions
ErrorResponsemessagerequiredstring▸404Project not found
ErrorResponsemessagerequiredstring▸409Project is suspended
ErrorResponsemessagerequiredstring▸429Rate limit exceeded
ErrorResponsemessagerequiredstring▸500Internal server error
ErrorResponsemessagerequiredstring