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

# Share a web service with an anonymous visitor

> Create a 24-hour HTTP or WebSocket link, understand application-header restrictions, and revoke access explicitly.

Share creates a time-limited anonymous link to one Computer's HTTP or WebSocket port. A visitor can use that link without a Deepest account. Use it for an explicitly requested demo or review of work you intend others to access.

> [!WARNING]
>
> A Share link is a bearer credential: anyone who gets it can access the exposed service while the link and Account remain eligible. It is not a production deployment, custom domain, password-protected link, or team access-control list.

## Prepare and inspect the service first

Follow [Private Preview](https://docs.deepest.dev/network/private-preview.md) to start a service, check it inside the Computer, and inspect the web content. Do not share an administrative UI, filesystem listing, secret-bearing debug endpoint, or desktop control service.

The service may listen on Guest `127.0.0.1`. Share supports HTTP and WebSocket, not arbitrary TCP/UDP or SSH. Share is available for Computers, not Sandboxes.

**A created link is not a readiness check.** The API can create Share metadata even when the Computer is stopped or its port has no listener. The Console requires a Running Computer before creating a Share, but link creation is still separate from application readiness.

## Create and save the returned link

In the Computer's **Apps** tab, enter the intended **Port** and choose **Share publicly · 24h**. Use **Copy** to save the returned link immediately.

Using the [SDK](https://docs.deepest.dev/api-and-sdk/typescript.md), with a configured `deepest` client:

```js theme={null}
const computerId = process.env.COMPUTER_ID;
if (!computerId) throw new Error("Set COMPUTER_ID.");
const computer = deepest.computer(computerId);
const reply = await computer.shares.create({ port: 3000 });
if (!reply.ok) {
  console.error(reply.error.code, reply.retry, reply.resource_id);
  process.exit(1);
}
const { share, public_url } = reply.result;
console.log({ share_id: share.id, expires_at_ms: share.expires_at_ms });
// Deliver and retain public_url only through the intended trusted workflow.
```

The success response returns `public_url` **once**, along with Share metadata. Save the `share.id` for later revocation. List returns metadata only and cannot recover the original URL.

Do not repeat create just to retrieve a lost link. First inspect existing Shares; if the original URL is unavailable, deliberately replace the Share and revoke the old one after identifying it. Each create is a new authorization.

## Check what an anonymous visitor sees

Open the link in a separate signed-out/private browser session and verify the intended result. For a simple HTTP endpoint:

```bash theme={null}
curl --show-error --max-time 10 -i "$PUBLIC_SHARE_URL"
```

Expect the service's successful status and content. Confirm that you did not unintentionally expose other paths on the same web service. The link authorizes the service port, not just the page you first visited.

For WebSocket services, use the actual path and protocol and test a bidirectional message exchange as described in the Preview guide.

### Application authentication differs from Preview

Share removes incoming Cookie, Authorization and Referer headers before forwarding requests to the Guest service. The browser still holds the Share URL, but the application cannot assume those incoming credentials will reach it.

Consequently, do not promise that an existing cookie-based login or Authorization-header API works unchanged through Share. Private Preview preserves those application headers. If your demo relies on them, test the exact visitor journey and choose an appropriate access method.

Deepest control-domain login cookies and Account Keys do not belong in the runtime service. The Share token itself gives no Account API, Exec, SSH, file-management or Desktop permission.

## List and revoke

```js theme={null}
const listed = await computer.shares.list();
if (!listed.ok) throw new Error(listed.error.code + " / " + listed.retry);
console.log(listed.result.map(({ id, port, expires_at_ms, revoked_at_ms }) => ({
  id, port, expires_at_ms, revoked_at_ms,
})));

const shareId = process.env.SHARE_ID;
if (!shareId) throw new Error("Set SHARE_ID to the exact link being withdrawn.");
const revoked = await computer.shares.revoke(shareId);
if (!revoked.ok) {
  console.error(revoked.error.code, revoked.retry, revoked.resource_id);
  process.exit(1);
}
console.log(revoked.result.revoked_at_ms);
```

After revocation, make a new request to the old URL and confirm it is rejected. Revocation prevents new requests/handshakes; it is not a guarantee of terminating every established stream. Close or stop the service when an already-connected client must no longer exchange data, taking care not to interrupt unrelated work.

If a revoke response is lost, list the original Computer's Shares and inspect the same ID's `revoked_at_ms` before another mutation.

## Lifecycle rules

| Event | Share result |
| - | - |
| Normal creation | Expires 24 hours after creation |
| Stop Computer | Link remains recorded but cannot serve; visitors do not start the Computer |
| Start same Computer and service | Same unexpired, unrevoked link can serve again |
| Computer remains stopped for several hours | Time still counts toward expiry |
| Platform restart | Durable Share and original expiry remain |
| Clone Computer | Source Shares are not copied |
| Delete Computer | Its Shares are removed |
| Account loses running eligibility | New anonymous requests are denied |

The expiry is absolute, not “24 running hours.” Share expiry is fixed at 24 hours; there is no extension or custom-expiry input. Recently expired or revoked links can remain visible as metadata before routine history cleanup.

## Failure and recovery

| Observation | Meaning / next action |
| - | - |
| 503 from link | Commonly the application is not listening; inspect the Guest service |
| 409 stopped response | Start the original Computer explicitly if authorized, then restore the service |
| 410 expired | Create a new Share only if renewed public access is intended |
| 410 revoked | Keep it revoked unless the owner asks for new access |
| 404 | Unknown or already-cleaned-up link; check saved metadata and the current Computer |
| 403 after access expiry | Account eligibility is no longer valid |
| `LIMIT_EXCEEDED`, `share_records` / `account` | Account Share-record admission limit reached; revoked/recently expired records may still count |
| `UNKNOWN` after create | List and reconcile port, timestamp and intent before issuing another create; list cannot return the lost bearer URL |

If Share creation returns `LIMIT_EXCEEDED` for `share_records`, revoke or clean up unneeded Share records, then re-read the Share list before trying again. Revoking a record does not necessarily free retained history immediately.

An Agent should Share only when the user explicitly wants external access, verify the result from the visitor's position, record the Share ID and expiry, and revoke it when that access is no longer required. It should never report “deployment complete” solely because a Share record exists.

See [Private Preview](https://docs.deepest.dev/network/private-preview.md), [Account resources](https://docs.deepest.dev/concepts/account-resources.md), [Network behavior](https://docs.deepest.dev/network/outbound-and-bandwidth.md), and the Share section of the [API reference](https://docs.deepest.dev/api-reference.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.