---
title: "Edit the listing by publishing the next offer version (host owner)"
method: PATCH
path: "/api/v1/hosts/machines/{id}/offer"
tags: ["hosts"]
---

# Edit the listing by publishing the next offer version (host owner)

`PATCH /api/v1/hosts/machines/{id}/offer`

## Request

- Base URL: `https://amplerun-api.spiry.org`
- URL: `https://amplerun-api.spiry.org/api/v1/hosts/machines/{id}/offer`
- Auth: HTTP bearer

The host console's listing editor. Despite the verb this is APPEND-ONLY: the next `version` is inserted and no existing row is ever rewritten, so a live job keeps the rate its quote snapshotted — the quote remains the only price authority. `expected_version` is compare-and-swapped against the CURRENT offer version (not the machine version the POST form uses); a race answers 409 with `error.code = VERSION_CONFLICT` and a sibling `current` block so the editor can show what changed instead of overwriting it. `listing_expires_at` has no column of its own and is FOLDED onto `available_until` (the earlier of the two wins — `available_until` already means "bookable until", which is what the catalog filters on); the response echoes the stored value. `min_duration_s` and `max_duration_s` are accepted but NOT stored, because no per-offer duration bound exists in the schema and nothing at quote time would enforce one; they are named back to the caller in `ignored_fields` rather than silently dropped. A publish that would retract availability a live job is already holding is refused 409 CONFLICT.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string, uuid, required

## Request body

- object
  - `expected_version` string, required: Unsigned base-10 integer as string; never a float.
  - `rate_micro_per_hour` string, required: Unsigned base-10 integer as string; never a float.
  - `included_disk_gib` integer, required
  - `included_egress_gib` integer, required
  - `available_from` string, date-time, required
  - `available_until` string, date-time, required
  - `listing_expires_at` string, date-time
  - `min_duration_s` integer: Accepted, never stored; reported in ignored_fields.
  - `max_duration_s` integer: Accepted, never stored; reported in ignored_fields.
  - `availability_class` 'dedicated' | 'interruptible': D-22. dedicated (the default) is never preempted. interruptible is sold only from idle or co-listed hosts: the host may take the machine back after preemption_notice_s seconds of notice, and billing stops at the notice.
  - `preemption_notice_s` integer: D-22. Required for interruptible, refused for dedicated; omitted keeps the current value.

## Response `202`

Next offer version published.

- object
  - `offer_id` string, uuid, required
  - `offer_version` string, required: Unsigned base-10 integer as string; never a float.
  - `state` 'listed' | 'unlisted' | 'draining', required
  - `rate_micro_per_hour` string, required: Unsigned base-10 integer as string; never a float.
  - `included_disk_gib` integer, required
  - `included_egress_gib` integer, required
  - `available_from` string, date-time, required
  - `available_until` string, date-time, required
  - `availability_class` 'dedicated' | 'interruptible': D-22. dedicated (the default) is never preempted. interruptible is sold only from idle or co-listed hosts: the host may take the machine back after preemption_notice_s seconds of notice, and billing stops at the notice.
  - `preemption_notice_s` integer, nullable
  - `ignored_fields` string[], required: Request fields accepted by the schema but deliberately not stored.

## Other responses

- `409`: Offer version race (`VERSION_CONFLICT`, with `current`) or a live job whose availability the change would retract (`CONFLICT`).
- `default`: Error envelope. 401 unauthenticated, 403/404 forbidden, 409 conflict, 422 invalid input, 429 rate limited (code UNAVAILABLE, retryable:true, no Retry-After header), 503 unavailable money/provider state with retryable:true.

---

[API](https://skmtc.dev/amplerun/apis/amplerun-business-api.md) · [All operations](https://skmtc.dev/amplerun/apis/amplerun-business-api/llms.txt) · [OpenAPI document](https://skmtc.dev/amplerun/apis/amplerun-business-api/revisions/40944687fa52?raw)
