---
title: "Update name, build settings, branch, auto-deploy or resources"
method: PATCH
path: "/projects/{projectId}"
tags: ["Projects"]
---

# Update name, build settings, branch, auto-deploy or resources

`PATCH /projects/{projectId}`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/projects/{projectId}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `projectId` string, uuid, required

## Request body

- object
  - `name` string
  - `build` object
    - `framework` 'nextjs' | 'vite' | 'astro' | 'remix' | 'nuxt' | 'sveltekit' | 'gatsby' | 'create-react-app' | 'angular' | 'vue' | 'svelte' | 'hugo' | 'docusaurus' | 'static' | 'node' | 'express' | 'nestjs' | 'fastify' | 'hono' | 'python' | 'php' | 'docker' | 'wordpress' | 'other'
    - `buildPack` 'nixpacks' | 'railpack' | 'static' | 'dockerfile' | 'dockerimage' | 'service'
    - `rootDirectory` string: "/" or a sub-path
    - `installCommand` string, nullable
    - `buildCommand` string, nullable
    - `startCommand` string, nullable
    - `outputDirectory` string, nullable: static output, e.g. dist or out
    - `port` integer, nullable
    - `nodeVersion` string, nullable
  - `branch` string
  - `autoDeploy` boolean
  - `resources` object: capped by plan
    - `cpus` number
    - `memoryMb` integer

## Response `200`

Updated project

- object
  - `id` string, uuid, required
  - `organizationId` string, uuid, required
  - `name` string, required
  - `slug` string, required: stable subdomain label, e.g. my-site → my-site.hostingsurge.app
  - `kind` 'app' | 'static' | 'wordpress' | 'service', required
  - `status` 'provisioning' | 'building' | 'ready' | 'error' | 'stopped' | 'deleting', required
  - `source` union, required
    - object
      - `type` 'git', required
      - `provider` 'github' | 'gitlab' | 'bitbucket' | 'git', required
      - `repoUrl` string, required
      - `repoFullName` string, nullable, required
      - `branch` string, required
      - `installationId` string, nullable, required: GitHub App installation for private repos
    - object
      - `type` 'managed', required
      - `repoFullName` string, required: hostinsurge/hs-p-<id>; shown as "Hostingsurge Git"
      - `branch` string, required
    - object
      - `type` 'image', required
      - `image` string, required
      - `tag` string, required
    - object
      - `type` 'wordpress', required
    - object
      - `type` 'service', required
      - `template` string, required: catalog template id of the one-click app, e.g. "n8n" (GET /templates)
  - `build` object, required
    - `framework` 'nextjs' | 'vite' | 'astro' | 'remix' | 'nuxt' | 'sveltekit' | 'gatsby' | 'create-react-app' | 'angular' | 'vue' | 'svelte' | 'hugo' | 'docusaurus' | 'static' | 'node' | 'express' | 'nestjs' | 'fastify' | 'hono' | 'python' | 'php' | 'docker' | 'wordpress' | 'other', required
    - `buildPack` 'nixpacks' | 'railpack' | 'static' | 'dockerfile' | 'dockerimage' | 'service', required
    - `rootDirectory` string, required: "/" or a sub-path
    - `installCommand` string, nullable, required
    - `buildCommand` string, nullable, required
    - `startCommand` string, nullable, required
    - `outputDirectory` string, nullable, required: static output, e.g. dist or out
    - `port` integer, nullable, required
    - `nodeVersion` string, nullable, required
  - `resources` object, required
    - `cpus` number, required
    - `memoryMb` integer, required
  - `autoDeploy` boolean, required
  - `productionUrl` string, nullable, required
  - `domains` object[], required
    - `hostname` string, required
    - `status` 'valid' | 'pending' | 'invalid', required
  - `latestDeployment` object, nullable, required
    - `id` string, uuid, required
    - `state` 'queued' | 'building' | 'deploying' | 'ready' | 'error' | 'canceled', required
    - `createdAt` string, required: ISO-8601 timestamp
    - `readyAt` string, nullable, required: ISO-8601 timestamp
    - `commitSha` string, nullable, required
    - `commitMessage` string, nullable, required
    - `branch` string, nullable, required
    - `trigger` 'create' | 'redeploy' | 'git_push' | 'api' | 'cli' | 'upload' | 'rollback' | 'config_change' | 'builder' | 'promote' | 'deploy_hook', required
  - `productionDeployment` object, nullable, required
    - `id` string, uuid, required
    - `state` 'queued' | 'building' | 'deploying' | 'ready' | 'error' | 'canceled', required
    - `createdAt` string, required: ISO-8601 timestamp
    - `readyAt` string, nullable, required: ISO-8601 timestamp
    - `commitSha` string, nullable, required
    - `commitMessage` string, nullable, required
    - `branch` string, nullable, required
    - `trigger` 'create' | 'redeploy' | 'git_push' | 'api' | 'cli' | 'upload' | 'rollback' | 'config_change' | 'builder' | 'promote' | 'deploy_hook', required
  - `wordpress` object, nullable, required
    - `adminUrl` string, nullable, required
  - `template` object, nullable: set when the project was created from the template catalog
    - `id` string, required
    - `name` string, required
    - `kind` 'starter' | 'service' | 'wordpress' | 'repository', required
    - `adminUrl` string, nullable, required: where to sign in or finish the setup (first login)
    - `installState` 'provisioning' | 'configuring' | 'ready' | 'failed', required: GET /projects/{id}/template has the steps, first-login notes and credentials
  - `sleep` object, nullable: set while the project sleeps because nobody visited it (it starts with the next visit) or is waking up; docs/IDLE_SLEEP.md
    - `state` 'sleeping' | 'waking', required
    - `since` string, nullable, required: ISO-8601 timestamp
  - `runtime` object, nullable: apps only: set while a ready app does not run although its deployment succeeded (status stays "ready"); the runtime logs say why. Cleared once it runs again and by every deployment, start, stop or restart; null otherwise, also while it sleeps
    - `state` 'crashing' | 'stopped', required: crashing: the app keeps restarting, it stops right after it starts; stopped: it exited and did not start again
    - `since` string, nullable, required: when the platform first saw it
  - `createdAt` string, required: ISO-8601 timestamp
  - `updatedAt` string, required: ISO-8601 timestamp

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `402`: Plan limit reached
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
