---
title: "Swarm"
description: "The `Swarm` entity."
section: "Reference"
group: "Types"
order: 214
---

## Definition

```ts
interface Swarm {
  id: string;
  workspaceId: string;
  name: string;
  description: string | null;
  defaultVersionId: string | null;
  createdBy: string;
  runtimeUserId: string | null;
  deletedAt: string | null;
  retentionTier: "short" | "medium" | "long" | "none" | null;
  createdAt: string;
  updatedAt: string;
}
```

## Fields

| Field              | Type                                              | Notes                                                                                                                                                                                                                         |
| ------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`               | `string`                                          | `readonly` `required`                                                                                                                                                                                                         |
| `workspaceId`      | `string`                                          | `required` — Workspace that owns this swarm.                                                                                                                                                                                  |
| `name`             | `string`                                          | `required` — Human-readable swarm name.                                                                                                                                                                                       |
| `description`      | `string \| null`                                  | `required` — Optional longer-form description.                                                                                                                                                                                |
| `defaultVersionId` | `string \| null`                                  | `required` — Version served as the default; null until a version is published.                                                                                                                                                |
| `createdBy`        | `string`                                          | `required` — User who created the swarm.                                                                                                                                                                                      |
| `runtimeUserId`    | `string \| null`                                  | `required` — Override the workspace default service user as the runtime caller when this swarm runs headlessly. Null = inherit workspace default. Workspace-admin-only to set; target user must be a member of the workspace. |
| `deletedAt`        | `string \| null`                                  | `required` — ISO-8601 timestamp of soft-delete; null while active. Cleanup worker hard-deletes once `deletedAt + retentionTier.days` passes.                                                                                  |
| `retentionTier`    | `"short" \| "medium" \| "long" \| "none" \| null` | `required` — Retention tier snapshotted at delete time. `short`=7d, `medium`=30d, `long`=90d, `none`=never. Null while active.                                                                                                |
| `createdAt`        | `string`                                          | `readonly` `required` — ISO-8601 timestamp of creation.                                                                                                                                                                       |
| `updatedAt`        | `string`                                          | `readonly` `required` — ISO-8601 timestamp of the last update.                                                                                                                                                                |
