---
title: "Create or update a group deployment."
method: POST
path: "/v1/groups"
tags: ["groups"]
---

# Create or update a group deployment.

`POST /v1/groups`

## Request

- Base URL: `https://api.smolmachines.com`
- URL: `https://api.smolmachines.com/v1/groups`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/smolmachines/apis/smolfleet-api/docs/v1/groups/post.ts> (a function with typed inputs; its response is checked against the schema)

Deploys an image as a replicated group; re-deploying an existing name rolls it according to the requested strategy. Requires the `group:write` scope (legacy alias `app:write`).

## Request body

- DeployRequest
  - `coLocateWith` string, nullable
  - `cpus` integer
  - `domain` string, nullable
  - `env` EnvVar[]
    - `key` string, required
    - `value` string, required
  - `health` HealthCheck
    - `intervalSecs` integer
    - `path` string, nullable
    - `port` integer, nullable
    - `retries` integer
    - `timeoutSecs` integer
    - `type` 'http' | 'tcp' | 'exec', required
  - `image` string, required
  - `memoryMb` integer
  - `name` string, required
  - `network` boolean
  - `port` integer
  - `publicIngress` boolean: Opt-in: expose this group's published port on the UNAUTHENTICATED public `/proxy` / `*.apps` ingress. Default false — the app is reachable only by its owner tenant (or admin) until explicitly made public, matching the per-machine `public_ingress` default.
  - `stopGraceSecs` integer
  - `strategy` union
    - object: Replace instances in batches. Each batch: start new → health check → destroy old.
      - `batchSize` integer: Instances to replace per batch (default: 1).
      - `type` 'rolling', required
      - `useHealthCheck` boolean: Wait for health check to pass before destroying old instances.
      - `waitSeconds` integer: Seconds to wait between batches if not using health checks (default: 5).
    - object: Deploy N canary instances first. If healthy, replace the rest. If canaries fail, roll back without touching existing instances.
      - `autoPromote` boolean: Auto-promote after health check passes. If false, requires manual promotion.
      - `canaryCount` integer: Number of canary instances to deploy (default: 1).
      - `type` 'canary', required
    - object: Deploy a complete new set alongside the old. Switch traffic atomically, then destroy old instances.
      - `type` 'blueGreen', required
  - `volume` VolumeMount
    - `mountPath` string, required
    - `name` string, required
    - `sizeGb` integer

## Response `200`

Group deployed

- GroupInfo
  - `createdAt` string, required
  - `domain` string, nullable
  - `id` string, required
  - `image` string, required
  - `instances` InstanceInfo[], required
    - `generation` integer, required
    - `hostPort` integer, nullable
    - `id` string, required
    - `nodeId` string, required
    - `status` string, required
  - `name` string, required
  - `port` integer, required
  - `replicas` integer, required
  - `status` string, required
  - `updatedAt` string, required

## Other responses

- `401`: Missing or invalid API key
- `403`: Key lacks the required scope
- `429`: Rate limited; retry after the Retry-After header
- `500`: Internal error

## Changes

- **2026-10-16** `bc31fc04a568`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/smolmachines/apis/smolfleet-api/changes/v1/groups/post.md)

---

[API](https://skmtc.dev/smolmachines/apis/smolfleet-api.md) - [All operations](https://skmtc.dev/smolmachines/apis/smolfleet-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smolmachines/apis/smolfleet-api/revisions/bc31fc04a568?raw)
