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

# publish

> Validate an uploaded build and create a playable version.

export const LastVerified = ({date, source}) => <div className="totem-verified">
    <span>Last verified: {date}</span>
    {source ? <span>Source: {source}</span> : null}
  </div>;

export const StatusBadge = ({state = "available", children}) => {
  const labels = {
    available: "Available",
    "early-access": "Early access",
    planned: "Planned",
    internal: "Internal draft"
  };
  return <span className={`totem-status totem-status--${state}`}>
      {children || labels[state] || state}
    </span>;
};

<StatusBadge state="available" />

<LastVerified date="2026-08-14" source="Totem V1 contract" />

Validates the most recently uploaded archive for a game. A valid build becomes an immutable, numbered version.

## Parameters

| Name      | Type        | Required | Rules                                              |
| --------- | ----------- | -------- | -------------------------------------------------- |
| `game_id` | UUID string | Yes      | Must identify a game owned by the current account. |

## Example call

```json theme={null}
{
  "game_id": "018f2f4e-b73b-7e91-a419-0c8ac91af1c2"
}
```

Call `publish` only after the HTTP `PUT` to the current upload URL succeeds.

## Success

```json theme={null}
{
  "game_id": "018f2f4e-b73b-7e91-a419-0c8ac91af1c2",
  "play_url": "https://play.totemlabs.io/moonforge/afterlight",
  "integration_prompt": "Call window.Totem.gameOver({ score }) when a run ends."
}
```

The new version is ready when this response returns.

## Validation failure

`publish` returns every detected violation in one response.

```json theme={null}
{
  "game_id": "018f2f4e-b73b-7e91-a419-0c8ac91af1c2",
  "errors": [
    {
      "code": "NO_INDEX_HTML",
      "path": null,
      "remediation": "Place index.html at the archive root and upload a new build."
    },
    {
      "code": "DISALLOWED_EXTENSION",
      "path": "tools/dev-server.sh",
      "remediation": "Remove the file or convert it to an allowed static web asset."
    }
  ]
}
```

Read [When publishing fails](/troubleshooting) for the complete code table.

A failed build never replaces the current public version.
