> ## Documentation Index
> Fetch the complete documentation index at: https://www.latitude.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a cluster node group

> Changes the attributes sent of one of your cluster's node groups. Only available for projects that have a GPU cluster; any other project answers 404 PROJECT_NOT_A_CLUSTER. Signed requirements need to be signed again. Needs an owner, administrator or collaborator.



## OpenAPI

````yaml https://spec.speakeasy.com/latitude/latitude/latitude-sh-api-with-code-samples patch /projects/{project_id}/cluster/node_groups/{id}
openapi: 3.0.1
info:
  title: Latitude.sh API
  version: '2023-06-01'
  description: >-
    The Latitude.sh API is a RESTful API to manage your Latitude.sh account. It
    allows you to perform the same actions as the Latitude.sh dashboard.
servers:
  - url: https://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
  - url: http://api.latitude.sh
    variables:
      latitude_api_key:
        default: <insert your api key here>
security: []
tags:
  - name: API keys
  - name: Baselines (Preview)
    description: >-
      Preview. Available to teams with the `baselines_api` feature flag. The
      shape of these endpoints may change before general availability.
  - name: Billing
  - name: Clusters
    description: >-
      Projects that have a GPU cluster only. Every operation answers 404
      PROJECT_NOT_A_CLUSTER for a project without one.
  - name: Elastic Ips
  - name: Events
  - name: Firewalls
  - name: Inference
  - name: IP Addresses
  - name: Managed Databases
    description: Managed database instances (PostgreSQL, ClickHouse)
  - name: Kubernetes Clusters
  - name: LKS
  - name: Marketplace apps
  - name: Operating Systems
  - name: Plans
  - name: Sandboxes (Preview)
    description: >-
      Preview. Available to teams with the `sandboxes_api` feature flag. The
      shape of these endpoints may change before general availability.
  - name: Public Networks
  - name: Private Networks
  - name: Projects
  - name: Regions
  - name: Roles
  - name: SSH Keys
  - name: Servers
  - name: Block Storage
  - name: Filesystem Storage
  - name: Object Storage
  - name: Tags
  - name: Teams
  - name: Team members
  - name: Traffic
  - name: User data
  - name: User profile
  - name: Virtual machines
  - name: Virtual machine backups
  - name: Virtual machine restores
paths:
  /projects/{project_id}/cluster/node_groups/{id}:
    patch:
      tags:
        - Clusters
      summary: Update a cluster node group
      description: >-
        Changes the attributes sent of one of your cluster's node groups. Only
        available for projects that have a GPU cluster; any other project
        answers 404 PROJECT_NOT_A_CLUSTER. Signed requirements need to be signed
        again. Needs an owner, administrator or collaborator.
      operationId: update-project-cluster-node-group
      parameters:
        - name: project_id
          in: path
          required: true
          description: The ID or slug of a project that has a GPU cluster
          examples:
            Success:
              value: proj_lxWpD699qm6rk
          schema:
            type: string
        - name: id
          in: path
          required: true
          description: The node group ID
          examples:
            Success:
              value: '7'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_cluster_node_group'
            examples:
              Success:
                summary: Success
                value:
                  data:
                    type: cluster_node_groups
                    attributes:
                      server_count: 32
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/update_cluster_node_group'
            examples:
              Success:
                summary: Success
                value:
                  data:
                    type: cluster_node_groups
                    attributes:
                      server_count: 32
        required: true
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              examples:
                Success:
                  value:
                    data:
                      id: '7'
                      type: cluster_node_groups
                      attributes:
                        name: gpu-b300
                        kind: gpu
                        plan: g4-b300-large
                        plan_name: g4.b300.large
                        server_count: 32
                        os: ubuntu_24_04_x64_lts
              schema:
                $ref: '#/components/schemas/cluster_node_group'
        '403':
          description: Forbidden (role cannot change node groups)
        '404':
          description: Project is not a cluster, or node group not found
          content:
            application/vnd.api+json:
              examples:
                Project is not a cluster:
                  value:
                    errors:
                      - code: PROJECT_NOT_A_CLUSTER
                        title: Project Not A Cluster
                        detail: This project is not a cluster
                        status: '404'
                        meta: {}
                Node group not found:
                  value:
                    errors:
                      - code: NOT_FOUND
                        title: Not Found
                        detail: This cluster has no such node group
                        status: '404'
                        meta: {}
        '422':
          description: Unprocessable Entity (no attributes)
      security:
        - Bearer: []
      x-codeSamples:
        - lang: go
          label: Go (SDK)
          source: "package main\n\nimport(\n\t\"context\"\n\t\"os\"\n\tlatitudeshgosdk \"github.com/latitudesh/latitudesh-go-sdk\"\n\t\"github.com/latitudesh/latitudesh-go-sdk/models/components\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := latitudeshgosdk.New(\n        latitudeshgosdk.WithSecurity(os.Getenv(\"LATITUDESH_BEARER\")),\n    )\n\n    res, err := s.Clusters.UpdateProjectClusterNodeGroup(ctx, \"proj_lxWpD699qm6rk\", \"7\", components.UpdateClusterNodeGroup{\n        Data: components.UpdateClusterNodeGroupData{\n            Type: components.UpdateClusterNodeGroupTypeClusterNodeGroups,\n            Attributes: components.UpdateClusterNodeGroupAttributes{\n                ServerCount: latitudeshgosdk.Pointer[int64](32),\n            },\n        },\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ClusterNodeGroup != nil {\n        // handle response\n    }\n}"
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Latitudesh } from "latitudesh-typescript-sdk";

            const latitudesh = new Latitudesh({
              bearer: process.env["LATITUDESH_BEARER"] ?? "",
            });

            async function run() {
              const result = await latitudesh.clusters.updateProjectClusterNodeGroup({
                projectId: "proj_lxWpD699qm6rk",
                id: "7",
                updateClusterNodeGroup: {
                  data: {
                    type: "cluster_node_groups",
                    attributes: {
                      serverCount: 32,
                    },
                  },
                },
              });

              console.log(result);
            }

            run();
components:
  schemas:
    update_cluster_node_group:
      type: object
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              enum:
                - cluster_node_groups
            attributes:
              type: object
              description: At least one attribute. Only the attributes sent change.
              properties:
                name:
                  type: string
                  maxLength: 64
                  description: >-
                    Unique within the cluster; leading and trailing spaces are
                    trimmed
                kind:
                  type: string
                  enum:
                    - gpu
                    - cpu
                    - storage
                    - management
                    - other
                plan:
                  type: string
                  description: The slug of a bare-metal or GPU plan on sale
                server_count:
                  type: integer
                  minimum: 1
                  maximum: 1024
                os:
                  type: string
                  nullable: true
                  description: >-
                    An operating system slug the plan can run, or empty or null
                    to clear it. Changing the plan checks the node group's
                    operating system against the new plan.
          required:
            - type
            - attributes
      required:
        - data
    cluster_node_group:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/cluster_node_group_data'
    cluster_node_group_data:
      type: object
      properties:
        id:
          type: string
          example: '7'
          description: The node group id
        type:
          type: string
          enum:
            - cluster_node_groups
        attributes:
          type: object
          properties:
            name:
              type: string
              example: gpu-workers
            kind:
              type: string
              enum:
                - gpu
                - cpu
                - storage
                - management
                - other
              example: gpu
            plan:
              type: string
              nullable: true
              example: g4-b300-large
              description: The plan slug; null while no plan is set
            plan_name:
              type: string
              nullable: true
              example: g4.b300.large
            server_count:
              type: integer
              example: 16
            os:
              type: string
              nullable: true
              example: ubuntu_24_04_x64_lts
              description: The operating system slug; null while none is set
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.