---
title: "Update Project Nodes"
description: "Update the active state of some nodes to true."
canonical: https://www.quantconnect.com/docs/v2/cloud-platform/api-reference/project-management/nodes/update-project-nodes
markdown: https://www.quantconnect.com/docs/v2/cloud-platform/api-reference/project-management/nodes/update-project-nodes.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/01%20Cloud%20Platform/99%20API%20Reference/02%20Project%20Management/06%20Nodes/02%20Update%20Project%20Nodes
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Update Project Nodes

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Cloud Platform](https://www.quantconnect.com/docs/v2/cloud-platform.md) > [API Reference](https://www.quantconnect.com/docs/v2/cloud-platform/api-reference.md) > [Project Management](https://www.quantconnect.com/docs/v2/cloud-platform/api-reference/project-management.md) > [Nodes](https://www.quantconnect.com/docs/v2/cloud-platform/api-reference/project-management/nodes.md) > Update Project Nodes

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

Update the active state of the given nodes to true. If you don't provide any nodes, all the nodes become inactive and autoSelectNode is true.

## Request

The `/projects/nodes/update` API accepts requests in the following format:

| `UpdateProjectNodesRequest` Model - Request to update the nodes of a project. |  |
| --- | --- |
| projectId | `integer required example: 23456789` Project Id to which the nodes refer. |
| nodes | `string Array` List of node Ids the project may use. If you omit this property or pass an empty list, the best node will be automatically selected for backtest, research, and live trading. |
| Example | `{ "projectId": 23456789, "nodes": [ "string" ] }` |

## Responses

The `/projects/nodes/update` API provides a response in the following format:

### 200 Success

| `ProjectNodesResponse` Model - Response received when reading all nodes of a project. |  |
| --- | --- |
| nodes | `ProjectNodes object` Contains sets of node lists for each target environment. |
| autoSelectNode | `boolean` Indicate if the best-performing node is automatically selected. |
| success | `boolean` Indicate if the API request was successful. |
| errors | `string Array` List of errors with the API call. |
| Example | `{ "nodes": { "backtest": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ], "live": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ], "research": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ] }, "autoSelectNode": true, "success": true, "errors": [ "string" ] }` |

| `ProjectNodes` Model - Contains sets of node lists for each target environment. |  |
| --- | --- |
| backtest | `Node Array` Collection of backtest nodes. |
| live | `Node Array` Collection of live nodes. |
| research | `Node Array` Collection of research nodes. |
| Example | `{ "backtest": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ], "live": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ], "research": [ { "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 } ] }` |

| `Node` Model - Contains all relevant information on a Node to interact through API endpoints. |  |
| --- | --- |
| speed | `number` The nodes cpu clock speed in GHz. |
| price | `NodePrices object` Node prices from node object. |
| cpu | `integer` CPU core count of node. |
| ram | `number` Size of RAM in Gigabytes. |
| name | `string` Name of the node. |
| sku | `string` Node type identifier for configuration. |
| description | `string` Description of the node. |
| usedBy | `string` User currently using the node. |
| userProfile | `string` URL of the user using the node. |
| projectName | `string` Project the node is being used for. |
| projectId | `integer example: 23456789` Id of the project the node is being used for. |
| busy | `boolean` Indicates if the node is currently busy. |
| id | `string` Full Id of node. |
| assets | `integer` Maximum number of assets recommended for this node. |
| host | `string` Node host. |
| active | `boolean` Indicate if this is an active node for the project. The project will use this node if it's not busy. |
| hasGpu | `integer` Indicate if the node has GPU (1) or not (0). |
| Example | `{ "speed": 0, "price": { "monthly": 0, "yearly": 0 }, "cpu": 0, "ram": 0, "name": "string", "sku": "string", "description": "string", "usedBy": "string", "userProfile": "string", "projectName": "string", "projectId": 23456789, "busy": true, "id": "string", "assets": 0, "host": "string", "active": true, "hasGpu": 0 }` |

| `NodePrices` Model - Node prices from node object. |  |
| --- | --- |
| monthly | `integer` The monthly price of the node in US dollars. |
| yearly | `integer` The yearly price of the node in US dollars. |
| Example | `{ "monthly": 0, "yearly": 0 }` |

### 401 Authentication Error

| `UnauthorizedError` Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash. |  |
| --- | --- |
| www_authenticate | `string` Header |

## Examples

The following examples demonstrate project management through the QuantConnect API.

### Example 1: CRUD Operations

This example demonstates creating, reading, updating, and deleting a project through the cloud API.

```
from base64 import b64encode
from hashlib import sha256
from time import time
from requests import get, post
BASE_URL = 'https://www.quantconnect.com/api/v2/'

# You need to replace these with your actual credentials.
# You can request your credentials at https://www.quantconnect.com/settings/
# You can find our organization ID at https://www.quantconnect.com/organization/
USER_ID = 0
API_TOKEN = '____'
ORGANIZATION_ID = '____'

def get_headers():
    # Get timestamp
    timestamp = f'{int(time())}'
    time_stamped_token = f'{API_TOKEN}:{timestamp}'.encode('utf-8')

    # Get hased API token
    hashed_token = sha256(time_stamped_token).hexdigest()
    authentication = f'{USER_ID}:{hashed_token}'.encode('utf-8')
    authentication = b64encode(authentication).decode('ascii')

    # Create headers dictionary.
    return {
        'Authorization': f'Basic {authentication}',
        'Timestamp': timestamp
    }

# Authenticate to verify credentials
response = post(f'{BASE_URL}/authenticate', headers = get_headers())
print(response.json())

# --------------------

# The project ID of the project to manage
project_id = 12345678

### Create Project
# Send a POST request to the /projects/create endpoint to create a new project
response = post(f'{BASE_URL}/projects/create', headers=get_headers(), json={
    "name": f"Project_{int(time())}",  # Unique project name using current timestamp
    "language": "Py"  # Programming language for the project (Python)
})
# Parse the JSON response into python managable dict
result = response.json()
# Extract the project ID from the response
project_id = result['projects'][0]['projectId']
# Check if the request was successful and print the result
if result['success']:
    print("Project Created Successfully:")
    print(result)

### Read Project
# Prepare data payload to read project details
payload = {
    "id": project_id  # ID of the project to read
}
# Send a POST request to the /projects/read endpoint to get project details
response = post(f'{BASE_URL}/projects/read', headers=get_headers(), json=payload)
# Parse the JSON response into python managable dict
result = response.json()
# Check if the request was successful and print the project details
if result['success']:
    print("Project Details:")
    print(result)

### Update Project
# Send a POST request to the /projects/update endpoint to update project details
response = post(f'{BASE_URL}/projects/update', headers=get_headers(), json={
    "projectId": project_id,  # ID of the project to update
    "name": f"Project_{project_id}",  # New name for the project
    "description": "The new project name is awesome!"  # New description
})
# Parse the JSON response into python managable dict
result = response.json()
# Check if the request was successful and print the result
if result['success']:
    print("Project Updated Successfully:")
    print(result)

### Delete Project
# Prepare data payload to delete the project
payload = {
    "projectId": project_id  # ID of the project to delete
}
# Send a POST request to the /projects/delete endpoint to delete the project
response = post(f'{BASE_URL}/projects/delete', headers=get_headers(), json=payload)
# Parse the JSON response into python managable dict
result = response.json()
# Check if the request was successful and print the result
if result['success']:
    print("Project Deleted Successfully:")
    print(result)
```

### Example 2: Delete All Projects in a Directory

This example deletes all projects under a specific directory in the organization workspace.

```
from base64 import b64encode
from hashlib import sha256
from time import time
from requests import get, post
BASE_URL = 'https://www.quantconnect.com/api/v2/'

# You need to replace these with your actual credentials.
# You can request your credentials at https://www.quantconnect.com/settings/
# You can find our organization ID at https://www.quantconnect.com/organization/
USER_ID = 0
API_TOKEN = '____'
ORGANIZATION_ID = '____'

def get_headers():
    # Get timestamp
    timestamp = f'{int(time())}'
    time_stamped_token = f'{API_TOKEN}:{timestamp}'.encode('utf-8')

    # Get hased API token
    hashed_token = sha256(time_stamped_token).hexdigest()
    authentication = f'{USER_ID}:{hashed_token}'.encode('utf-8')
    authentication = b64encode(authentication).decode('ascii')

    # Create headers dictionary.
    return {
        'Authorization': f'Basic {authentication}',
        'Timestamp': timestamp
    }

# Authenticate to verify credentials
response = post(f'{BASE_URL}/authenticate', headers = get_headers())
print(response.json())

# --------------------

def get_projects_in_directory(key):
    """Get all projects in a specific directory in the organization
    workspace.

    Keyword arguments:
    key -- path to a directory of projects in the organization workspace
           (ex: path/to/dir)
    """
    # Split the key into path segments.
    key_segments = [s for s in key.split('/') if s]
    if not key_segments:
        print('Invalid key:', key)
        return
    # Iterate through all projects
    response = post(f'{BASE_URL}/projects/read', headers=get_headers())
    response.raise_for_status()
    project_ids = []
    for project in response.json()['projects']:
        # Check if the project is in the directory.
        if all(a == b for a, b in zip(key_segments, project['name'].split('/'))):
            project_ids.append(project['projectId'])
    return project_ids

def delete_projects(project_ids):
    """Delete a set of projects.

    Keyword arguments:
    project_ids -- list of project Ids.
    """
    for id_ in project_ids:
        post(
            f'{BASE_URL}/projects/delete',
            headers=get_headers(),
            json={'projectId': id_}
        ).raise_for_status()

delete_projects(get_projects_in_directory('/path/to/projects/to/delete'))
```
