API guide
The Houseguest™ API does from a program what members do in the console: open a preview of the staging checkout for named viewers when a pull request opens, invite or revoke someone, extend it, end it when the pull request closes, and read agents, visits and activity. Every operation and field is in the API reference.
Create a token
Section titled “Create a token”- In the console, open Settings → API tokens and choose New token.
- Name it after what will use it (
Staging checkout CI), choose when it expires (30, 90 or 365 days) and tick its scopes. For opening and ending previews: Create previews, End previews, and Invite viewers to invite people, when opening or later (Manage standing access for standing access). Reading a preview’s viewers or visits needs View previews and Export viewer list; reading the activity log needs Export activity log. Scopes you do not hold are locked. - Create token. The token,
hgk_…, is shown once. Store it in your CI system’s secrets, for example asHOUSEGUEST_TOKEN.
For an SSH-only preview opened by a script, add Add TCP services and Use Houseguest addresses; see SSH-only preview from a script.
For a Share with Houseguest button in an internal app, the scopes are Create previews, Turn hostnames on and off and, to invite people, Invite viewers; see Integrate: Share with Houseguest button.
A token acts as the member who created it: it can never do more than that member’s roles allow at the moment it is used, and its scopes narrow that further. If the member loses a role, leaves the workspace or is disabled, the token loses that access too. Revoking it in the same list takes effect on the next request. Creating, revoking and refused uses appear in the activity log.
If the workspace requires single sign-on, create the token from a console session signed in with single sign-on; a token made otherwise is refused while the requirement applies.
Token scopes
Section titled “Token scopes”Each scope is a permission of the workspace’s roles, shown by its console name when you create the token. A scope brings what it includes, as in roles (End previews brings View previews). Each operation’s scope is also in the reference.
| Scope | In the console | Lets the token |
|---|---|---|
previews.view |
View previews | List and read previews, their standing-access lists and TCP services |
previews.create |
Create previews | Open previews (POST /previews, POST /shares) |
previews.extend |
Extend previews | Extend a preview, move its end later, reopen it (with previews.end) |
previews.extend_long |
Longer than 7 days | Open or extend a standing-access preview past 7 days from now |
previews.end |
End previews | End a preview, move its end earlier |
previews.manage_own |
Manage own previews | Change hostnames and the note for viewers on previews its member opened |
previews.manage |
Manage any preview | The same on any preview the member may manage |
viewers.invite |
Invite viewers | Invite people, when opening a preview or later |
viewers.revoke |
Revoke viewers | Revoke a viewer, and restore a revoked one (since 1.18.0) |
standing.manage |
Manage standing access | Add and remove standing-access entries |
viewers.export |
Export viewer list | Read a preview’s viewers and visits (with previews.view) |
agents.view |
View agents | List agents, their hostnames and TCP services |
agents.names |
Turn hostnames on and off | Turn names on and off, read and set a hostname’s default note |
agents.headers |
Manage headers sent to apps | Turn a hostname’s identity header on and off |
agents.configure |
Configure agents | Change an agent’s targets and save an earlier version again (since 1.15.0); update agents and change the workspace’s agent update settings (since 1.16.0); approve an agent that waits behind another (since 1.17.0). Works only for a member who holds it across the whole workspace |
audit.view |
View activity log | Included in audit.export; reads nothing by itself |
audit.export |
Export activity log | Read the activity log |
tcp.add |
Add TCP services | Read the SSH certificate authority, add and remove a preview’s TCP services and set their sign-in (since 1.10.0) |
addresses.use |
Use Houseguest addresses | Open SSH-only previews, which land on a Houseguest address (since 1.10.0) |
groups.manage |
Manage groups | Add previews to a share group and take them out, with previews.manage on each preview (since 1.12.0) |
previews.view also lists share groups and their viewer lists, and standing.manage edits a group’s viewer
list where the member holds it (since 1.12.0).
Try it with curl
Section titled “Try it with curl”The API is on the console host. Check the token:
export HOUSEGUEST_TOKEN=hgk_…curl -sS https://console.houseguest.dev/api/v1/token \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN"See which hostnames the workspace’s agents serve (needs View agents):
curl -sS https://console.houseguest.dev/api/v1/agents \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN"Open a preview of the staging checkout for three days and invite a reviewer. The Idempotency-Key makes a
re-run of the same job return the same preview instead of opening another:
curl -sS https://console.houseguest.dev/api/v1/previews \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: acme/checkout#42-open" \ -d '{ "name": "checkout-pr-42", "hostnames": ["checkout.staging.example.com", "api.staging.example.com"], "lifetime_seconds": 259200, "viewers": ["[email protected]"], "note": "The new checkout for pull request 42." }'The answer is 201 with the preview (its id, url, expires_at) and how each person was told:
{ "object": "preview_created", "preview": { "object": "preview", "id": "k3x7q2m5w4p5r6t2", "name": "checkout-pr-42", "status": "open", "url": "https://checkout.staging.example.com/", "expires_at": "2026-11-05T09:00:00Z" },}With "notify": false nobody is emailed and each invite’s single-use link comes back once in
invite_url, to send another way.
Find it again on the next push, extend it by a day, invite someone, end it:
API=https://console.houseguest.dev/api/v1AUTH="Authorization: Bearer $HOUSEGUEST_TOKEN"curl -sS "$API/previews?status=active&name=checkout-pr-42" -H "$AUTH"curl -sS "$API/previews/k3x7q2m5w4p5r6t2/extend" -H "$AUTH" -H "Content-Type: application/json" -d '{"extend_by_seconds": 86400}'curl -sS "$API/previews/k3x7q2m5w4p5r6t2/viewers" -H "$AUTH" -H "Content-Type: application/json" -d '{"email": "[email protected]"}'curl -sS -X POST "$API/previews/k3x7q2m5w4p5r6t2/end" -H "$AUTH"Ending a preview that has already ended answers it as it is, so a close job can run twice safely.
To move the end to a set time instead, earlier or later, send it to end-date. Later follows the extend rules
(Extend previews, and Longer than 7 days past 7 days from now); earlier needs End previews and must
be at least 5 minutes from now. tell_owner emails the preview’s owner:
curl -sS "$API/previews/k3x7q2m5w4p5r6t2/end-date" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"expires_at": "2026-11-07T17:00:00Z", "tell_owner": true}'To bring an ended or expired preview back (since 1.6.0), reopen it: the same preview, link and people, open
for lifetime_seconds from now (the workspace’s default length without it). "notify": true emails each
viewer who is not revoked a new invite; without it nobody is emailed and their old links work again. It needs
Extend previews and End previews on the preview. A preview that is open answers 409 preview_live;
the other refusals are the same as opening one (limit_reached, name_in_use, hostname_in_use,
hostname_not_covered, domain_not_verified):
curl -sS "$API/previews/k3x7q2m5w4p5r6t2/reopen" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"lifetime_seconds": 86400, "notify": false}'Note for viewers
Section titled “Note for viewers”Since 1.7.0 a preview carries the note for viewers:
viewer_note, sign_in_details_count and sign_in_details. The rows come back only to a token that may manage
the preview (previews.manage on it, or previews.manage_own on a preview its member opened); any other token
gets null and the count. Send both on POST /previews (left out, each comes from the first hostname’s
default note), and change them later; a field left out stays as it is:
curl -sS "$API/previews/k3x7q2m5w4p5r6t2/viewer-note" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"viewer_note": "Orders go to a sandbox. Use the test card 4242 4242 4242 4242.", "sign_in_details": [{"label": "Admin", "username": "[email protected]", "password": "staging-only"}], "viewers": [{"email": "[email protected]", "sign_in_details": [{"label": "Dana", "username": "dana", "password": "staging-dana"}]}]}'viewers gives people their own rows ([] removes them). The same shape works inside POST /previews
viewers, next to plain addresses, and POST /previews/{id}/viewers and .../standing-access take
sign_in_details. Viewers and standing-access entries return sign_in_details_count and, with the manage
scope, sign_in_details. A hostname’s default note is on GET /agents/{agent_id}/hostnames/{hostname} and
POST .../default-note (default_note, default_sign_in_details; agents.names, and previews.manage too to read or set the rows, which are copied into new previews). POST /shares takes
viewer_note for a new preview, never rows. Rows need the server’s viewer notes key: without it, they answer
422 validation_failed and read as null.
Identity header
Section titled “Identity header”Since 1.8.0 GET /agents/{agent_id}/hostnames/{hostname} carries identity_header ({"enabled": …}: whether
the edge sends each signed-in viewer’s token to the app; see Tell your app who is viewing),
workspace_id (the token’s wid, which an app that checks the token must require), and read-only, from what the agent reports: agent_identity (mode check, pass or unsupported, with
email_header and name_header in check mode) and agent_fixed_headers (the names of the headers the agent
adds). Turn it on or off with the scope agents.headers (“Manage headers sent to apps”):
curl -sS "$API/agents/ag_3/hostnames/staging.example.com/identity-header" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"enabled": true}'The public keys that verify the token are not part of the API: they are at
https://console.houseguest.dev/.well-known/houseguest/jwks.json.
Share-group viewers
Section titled “Share-group viewers”Since 1.12.0 a share group’s viewer list is in the API. Anyone on it can view every preview in the group, including invite-only ones, signing in with an emailed code or single sign-on. It works at once on every preview in the group, and on any preview that joins it later.
curl -sS "$API/share-groups" -H "$AUTH"curl -sS "$API/share-groups/sg_2n/viewers" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"entry": "@acme.example", "ends_at": "2026-12-31T23:59:00Z"}'Adding a preview to a group that has viewers gives them access to it, so it needs a confirmation. Without
confirm_new_viewers the answer is 409 confirmation_required, saying who would get access:
curl -sS "$API/share-groups/sg_2n/previews" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"preview_id": "k3x7q2m5w4p5r6t2", "confirm_new_viewers": true}'Since 1.13.0, "notify": true emails a new address on the list the group’s open previews and how to sign in.
Without it no email goes out. An @domain entry, or an entry already on the list, never gets one.
Removing an entry (DELETE /share-groups/{id}/viewers/{entry_id}) ends the access of everyone it alone
admitted, on every preview in the group, at once.
Since 1.18.0, adding an exact address lifts that person’s revocation on the group’s open previews, as adding it
to a preview’s own list does. The answer lists those previews in restored_previews (absent when none). An
@domain entry never lifts a revocation made for one person.
Sync end dates on a share group (since 1.19.0)
Section titled “Sync end dates on a share group (since 1.19.0)”POST /share-groups/{id}/sync-end sets one end date on the group’s open previews ("target": "previews") or on
its viewer entries ("target": "viewers"). "mode": "match" takes the latest end among the open previews, or for
viewer entries no end of their own; "mode": "date" takes ends_at. "dry_run": true answers what would change
and writes nothing.
curl -sS "$API/share-groups/sg_2n/sync-end" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"target": "previews", "mode": "match", "dry_run": true}'Each preview is checked as setPreviewEndDate checks it: previews.extend for a later end (previews.extend_long
past 7 days from now), previews.end for an earlier one, and the workspace’s longest preview. One that fails is
left as it is and comes back with "result": "refused", a reason and, for a permission, missing_permission;
the others change, and the answer is 200. Ended previews come back as skipped_ended; shortened: true marks an
earlier end. Viewer entries need standing.manage on the group; entries that ended are skipped and no revocation
is lifted.
Restore a revoked viewer (since 1.18.0)
Section titled “Restore a revoked viewer (since 1.18.0)”POST /previews/{preview_id}/viewers/{viewer_id}/restore (scope viewers.revoke) lifts a viewer’s revocation
and answers the viewer. Their old sessions stay ended, so they sign in again. It works only while something still
admits them: the preview’s list (the address or its @domain), a share group’s viewers, or an invite. Otherwise
the answer is 409 viewer_not_covered; add them again instead. A free email workspace with no place left answers
409 limit_reached; a revocation by Houseguest support answers 403 forbidden. A viewer who is not revoked is
answered as it is. Adding a share-group entry that is already there (a new end date) lifts nothing.
curl -X POST "$API/previews/k3x7q2m5w4p5r6t2/viewers/vw_9/restore" -H "$AUTH"SSH-only preview from a script
Section titled “SSH-only preview from a script”Since 1.10.0 a script can open a preview of SSH servers with no web app, let named people into them in the browser terminal with a Houseguest certificate (no password or key of their own), change its servers while it is open, and end it, all with a token.
The token needs Create previews, Add TCP services, Use Houseguest addresses, Manage standing
access (or Invite viewers for invites) and End previews. Each server must be in an agent’s
HG_ALLOW_TCP; GET /agents lists them in each agent’s tcp_services. For certificates, the agent (0.8.0 or
later) must also list the usernames for each server with ;users=, for example
HG_ALLOW_TCP='build-01.lab.example.com:22=10.0.0.21:22;users=ops': since 1.11.0 a certificate can name only
those (each service’s agent_usernames), and root only when listed.
1. Get the workspace’s certificate authority (made on first use):
curl -sS "$API/ssh-ca" -H "$AUTH"{"object": "ssh_ca", "public_key": "ssh-ed25519 AAAA… houseguest-ca:acme", "fingerprint": "SHA256:…", "created_at": "2026-11-19T09:00:00Z", "trusted_user_ca_keys_line": "TrustedUserCAKeys /etc/ssh/houseguest_ca.pub"}2. Have each server trust it once. The public key is not secret; the token stays where the script runs:
curl -sS "$API/ssh-ca" -H "$AUTH" | jq -r .public_key > houseguest_ca.pubfor host in build-01.lab.example.com build-02.lab.example.com; do scp houseguest_ca.pub "root@$host:/etc/ssh/houseguest_ca.pub" ssh "root@$host" 'grep -qx "TrustedUserCAKeys /etc/ssh/houseguest_ca.pub" /etc/ssh/sshd_config || echo "TrustedUserCAKeys /etc/ssh/houseguest_ca.pub" >> /etc/ssh/sshd_config; sshd -t && systemctl reload ssh'doneThe account viewers sign in as (ops below) must exist on each server. Details and options:
Set up a server.
3. Open the preview with "kind": "ssh": no hostnames, the servers in tcp_services, each taking a
Houseguest certificate for the username ops. Everyone at @acme.example may sign in, for 8 hours:
curl -sS "$API/previews" -H "$AUTH" -H "Content-Type: application/json" \ -H "Idempotency-Key: build-lab-2026-11-19" \ -d '{ "name": "build-lab", "kind": "ssh", "access": "standing_access", "viewers": ["@acme.example"], "lifetime_seconds": 28800, "tcp_services": [ {"target": "build-01.lab.example.com:22", "sign_in": "certificate", "usernames": ["ops"]}, {"target": "build-02.lab.example.com:22", "sign_in": "certificate", "usernames": ["ops"]} ] }'The answer, shortened. The preview’s landing page is a Houseguest address; viewers who open it sign in, then land
on the terminals page, with every server in the browser, signed in as ops without a password:
{ "object": "preview_created", "preview": { "id": "q4w7e2r5t6y3u2i7", "kind": "ssh", "url": "https://build-lab.acme.houseguest.page/", "terminals_url": "https://build-lab.acme.houseguest.page/__hg/terminals", "status": "open" }, "invites": [], "tcp_services": [{ "object": "tcp_service", "target": "build-01.lab.example.com:22", "sign_in": "certificate", "usernames": ["ops"], "terminal_url": "https://build-lab.acme.houseguest.page/__hg/ssh?target=build-01.lab.example.com%3A22" }]}The same name gets the same address each time it is opened, so a link in a runbook keeps working. Services are added before anyone is invited, so no viewer sees the preview without them.
4. Change its servers while it is open. sign_in is own (the viewer’s own password or key, the default),
certificate or either; usernames (up to 10) goes with certificate and either. Posting a server the
preview already has changes its sign-in and answers 200 instead of 201. A removed server refuses new
connections at once, and its open terminals close within 15 seconds:
Since 1.14.0 each service carries in_use: true while someone is connected to it, in a browser terminal or
with the houseguest command line, without saying who or how many. A script handing out one server per person
can pick one that is free.
curl -sS "$API/previews/q4w7e2r5t6y3u2i7/tcp-services" -H "$AUTH"curl -sS "$API/previews/q4w7e2r5t6y3u2i7/tcp-services" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"target": "build-03.lab.example.com:22", "sign_in": "either", "usernames": ["ops"]}'curl -sS -X DELETE "$API/previews/q4w7e2r5t6y3u2i7/tcp-services/build-02.lab.example.com:22" -H "$AUTH"Since 1.20.0 an SSH service can have a start command:
start_command with command, mode (start, or only, which needs sign_in certificate) and on_exit
(end, the default, or menu). Left out, the setting stays; {"command": ""} clears it. Each service in an
answer carries start_command, or null for a shell. only on a service that does not sign in with
certificates only, or moving such a service to another sign_in, is 422 ssh_command_needs_certificate:
curl -sS "$API/previews/q4w7e2r5t6y3u2i7/tcp-services" -H "$AUTH" -H "Content-Type: application/json" \ -d '{"target": "build-01.lab.example.com:22", "sign_in": "certificate", "usernames": ["ops"], "start_command": {"command": "/usr/local/bin/kiosk --booth 3", "mode": "only", "on_exit": "menu"}}'5. End it the usual way. Every open terminal closes within 15 seconds:
curl -sS -X POST "$API/previews/q4w7e2r5t6y3u2i7/end" -H "$AUTH"Any preview, web or SSH-only, takes tcp_services on POST /previews and the /tcp-services calls; a preview
with an SSH service carries terminals_url. Since 1.11.0 terminals_url and each terminal_url point at the
browser terminal’s own address, where no app runs: an SSH-only preview’s landing, or for a preview with hostnames
its terminal address (<name>-term.<workspace>.houseguest.page); they are null on an edge without Houseguest
addresses. The refusals specific to these calls:
| Status and code | Means |
|---|---|
409 ssh_certificates_unavailable |
The edge cannot sign certificates, so certificate and either are refused |
409 addresses_unavailable |
The edge has no Houseguest addresses, so no SSH-only preview (as on a self-hosted edge) |
403 tcp_not_allowed |
TCP services are off for the workspace’s plan |
422 tcp_target_not_covered |
No agent of the workspace allows that server: add it to an agent’s HG_ALLOW_TCP |
422 ssh_username_not_allowed |
A certificate username the agents do not list for that server in users=, or none listed (since 1.11.0) |
422 validation_failed |
For example hostnames on an SSH-only preview, a sign-in setting on a port other than 22, or certificate without usernames |
Pull requests on GitHub
Section titled “Pull requests on GitHub”Run the open call when a pull request opens or updates and the end call when it closes, with the token in a repository secret. A workflow step that opens (or finds and extends) the preview and one that ends it:
on: pull_request: types: [opened, synchronize, reopened, closed]jobs: preview: runs-on: ubuntu-latest env: API: https://console.houseguest.dev/api/v1 AUTH: "Authorization: Bearer ${{ secrets.HOUSEGUEST_TOKEN }}" NAME: checkout-pr-${{ github.event.pull_request.number }} steps: - if: github.event.action != 'closed' run: | curl -sSf "$API/previews" -H "$AUTH" -H "Content-Type: application/json" \ -H "Idempotency-Key: ${{ github.repository }}#${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}" \ -d "{\"name\":\"$NAME\",\"hostnames\":[\"checkout.staging.example.com\"],\"viewers\":[\"[email protected]\"]}" \ || echo "Already open: extend it instead (GET $API/previews?status=active&name=$NAME, then POST …/extend)." - if: github.event.action == 'closed' run: | id=$(curl -sSf "$API/previews?status=active&name=$NAME" -H "$AUTH" | jq -r '.data[0].id // empty') [ -z "$id" ] || curl -sSf -X POST "$API/previews/$id/end" -H "$AUTH"The contract
Section titled “The contract”Client IP address on refused visits
Section titled “Client IP address on refused visits”Since 1.9.0 a visit from GET /previews/{preview_id}/visits carries ip, the client IP address, when the
request was refused (decision denied, ended, suspended, not-on-list, code-wrong, sso-refused,
social-refused, sso-required or cross-tenant) and is at most 30 days old. Viewers’ requests and every other decision
never carry it; the field is absent rather than empty:
{"object": "visit", "id": "vi_9iy", "at": "2026-11-02T10:16:40Z", "method": "GET", "host": "checkout.staging.example.com", "path": "/wp-login.php", "decision": "denied", "viewer_email": null, "ip": "203.0.113.50"}Versions and changes
Section titled “Versions and changes”The version is in the path, /api/v1. Within v1, changes are additive only: new operations, new
optional request fields, new response fields, new error codes and new enum values. Ignore response fields
you do not know, and handle an unknown error code by its HTTP status. Anything else (removing or renaming
something, changing a type or a meaning, making a field required) ships as a new version. A security fix is
the one exception, and is listed here:
-
1.4.0 (28 October 2026), a security fix. Viewer lists, visits and the activity log are exports in the console, so the API now asks for the same permissions:
GET /previews/{preview_id}/viewers(listViewers) andGET /previews/{preview_id}/visits(listVisits) need a token with bothpreviews.viewandviewers.export(Export viewer list), and its creator must hold both on that preview.GET /activity(listActivity) needs a token withaudit.export(Export activity log).POST /previews(createPreview) withviewersneedsviewers.invite, orstanding.managefor standing access.
Existing tokens do not have these scopes and get
403 scope_missingon those calls. Reissue them: create a new token with the scopes above in Settings → API tokens, switch your systems to it, then revoke the old one.
Deprecation
Section titled “Deprecation”A new version runs beside v1, and v1 keeps working unchanged for at least six months after the new
version is announced. An operation being retired is marked deprecated in the reference, answers with
Deprecation and Sunset headers, and is announced in the changelog and by email to the owners of
workspaces with active API tokens. Only a security fix can shorten that.
Rate limits
Section titled “Rate limits”120 requests a minute per token, in bursts of up to 120. Each answer carries X-RateLimit-Limit and
X-RateLimit-Remaining; over the limit the answer is 429 with Retry-After in seconds. Thirty refused
tokens an hour from one network blocks that network’s requests for the rest of the hour. The workspace’s own
caps (open previews, viewers, invitations an hour) apply as in the console.
Idempotency
Section titled “Idempotency”Send Idempotency-Key on any POST. For 24 hours, a retry with the same key, path and body returns the first
answer with Idempotent-Replayed: true and does nothing again; the same key with a different request is
refused (422 idempotency_key_reused). Keys belong to the token. A replay never repeats an invite link: it
is shown once.
Pagination
Section titled “Pagination”Lists answer {"object": "list", "data": [...], "next_cursor": "..."}. Pass next_cursor as cursor for
the next page until it is null. limit takes 1 to 100 (default 50). Cursors are opaque.
Ids and times
Section titled “Ids and times”Ids are opaque strings that never change for the life of what they name. A preview’s id is the one in its
console address. Times are RFC 3339 in UTC, such as 2026-11-02T09:00:00Z; durations you send are whole
seconds.
Errors
Section titled “Errors”Every error has the same shape:
{"error": {"code": "scope_missing", "message": "Not allowed: the token's scopes do not include previews.end (End previews).", "request_id": "7f3e0c1a9b2d4e6f"}}Act on code; message is for people and may change; param, when present, names the field at fault;
quote request_id (also the X-Request-Id header) when asking for help. Errors never include data the
request did not send: a preview the token cannot see is simply 404. Every code is listed in the
reference.
Changes made with a token appear in the workspace’s activity log as the member who created the token, with the token’s name, beside changes made in the console, and so reach the workspace’s SIEM stream. Refusals are recorded too.
Actions by Houseguest support (actor_kind operator) read actor: "Houseguest support" in listActivity
and the SIEM stream, never a person’s name (since 1.20.1).
Browsers
Section titled “Browsers”The API takes requests from programs. A request with an Origin header, which browsers send, is refused, so
a token cannot be used from a web page and a console sign-in is never a credential for the API.
Agent targets (since 1.15.0)
Section titled “Agent targets (since 1.15.0)”GET /agents/{agent_id}/config reads an agent’s targets: its mode, the latest saved
version, the version the agent runs and its answer (status: applied, pending, refused with
refused_reason, none, or not_managed for a Hardened or older agent). The ETag header is the latest
version.
PUT /agents/{agent_id}/config with the scope agents.configure saves a new version. It needs If-Match with
the version read (428 precondition_required without it, 412 version_conflict when it changed). web and
tcp replace the lists whole:
curl -X PUT https://console.houseguest.dev/api/v1/agents/ag_3/config \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN" -H 'Content-Type: application/json' -H 'If-Match: "41"' \ -d '{"web":[{"hostname":"app.example.com","address":"10.0.0.5:443"}],"tcp":[],"confirm_wider_reach":true}'A change that lets the agent reach more needs "confirm_wider_reach": true; without it the answer is
409 confirmation_required, whose message lists what widens and how many open previews and viewers could reach
it. A Hardened or older agent answers 409 agent_not_managed. POST /agents/{agent_id}/config/rollback with
{"version": 40} saves an earlier version again, as a new version.
Agent updates (since 1.16.0)
Section titled “Agent updates (since 1.16.0)”GET /agents/{agent_id}/update reads an agent’s update status: the version it runs, latest_version (the newest
release Houseguest offers), status (available, updating, updated, rolled_back, failed, current,
managed_on_host, manual_only, not_reported or no_release) and its latest update in job, with who asked,
from and to which version, and how it went.
POST /agents/{agent_id}/update with the scope agents.configure updates the agent to the latest release, or to
version; it answers 202 with job.state queued, and the update is sent within seconds whatever the
workspace’s window. Follow it with GET:
curl -X POST https://console.houseguest.dev/api/v1/agents/ag_3/update \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN"An agent that takes no remote update answers 409 agent_updates_off (Hardened or pinned) or
409 agent_too_old (before 0.9.0); one at or above the version 409 already_current; one with an update under
way 409 update_in_progress; an offline one 409 agent_offline. A version that is not offered answers
422 release_unavailable.
GET /agent-update-settings and PUT /agent-update-settings read and change the workspace’s auto-update, window
(days and a start and end time, in UTC) and strategy (phased or all_at_once); fields left out keep their value:
curl -X PUT https://console.houseguest.dev/api/v1/agent-update-settings \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN" -H 'Content-Type: application/json' \ -d '{"window":{"days":["tue","thu"],"start":"03:00","end":"05:00"},"strategy":"phased"}'Agents waiting for approval (since 1.17.0)
Section titled “Agents waiting for approval (since 1.17.0)”An agent that claims a hostname or TCP service another agent of your workspace already serves waits for
approval before it serves it (Two agents with the same names).
GET /agents/{agent_id} and GET /agents say so in approval:
"approval": { "state": "pending", "pending": [ {"name": "checkout.staging.example.com", "kind": "hostname", "served_by": "ag_3", "served_by_name": "staging-vpc"} ], "failover": []}state is active when nothing waits. served_by is null when the agent that claimed the name first was
removed. POST /agents/{agent_id}/approve with the scope agents.configure makes the agent the failover for those
names: the agent that claimed them first keeps the traffic, and this one serves them only while it is offline.
Those names are then listed in failover. The approval covers those names only. It answers 200 with the agent,
and is idempotent: an agent with nothing waiting is answered as it is. A terminal share’s agent is a 404.
curl -X POST https://console.houseguest.dev/api/v1/agents/ag_7/approve \ -H "Authorization: Bearer $HOUSEGUEST_TOKEN"© 2026 Houseguest Technologies LLC. Houseguest™ is its trademark.7723 Tylers Place Blvd., Box #119, West Chester, OH 45069