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

# Sharing results

> Send anyone a view-only link to a segmentation: no account needed to look, sign-in needed to download.

A share gives people access to one result, the way a Google Docs share does.
Today there is one kind: **anyone with the link can view**. Whoever opens the
link sees the image, its cell outlines and counts in their browser, without an
account. Nothing on the page edits the result, and downloading files from it
asks the visitor to sign in to HalfPage.

Every share has an `access` (who it reaches) and a `role` (what they can do).
Today those are always `anyone_with_link` and `viewer`; the fields are there so
your code keeps working when more kinds of sharing arrive.

## Share a result

Share a `segmentation_id` once its prediction is `COMPLETED` (see the
[quickstart](/quickstart)). Sharing is idempotent: a result has at most one
live link, so asking again returns the same share.

<CodeGroup>
  ```bash curl theme={null}
  curl -s -X POST "$BASE/shares" \
    -H "Authorization: Bearer $HALFPAGE_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{\"segmentation_id\": \"$SEG_ID\"}"
  ```

  ```python Python theme={null}
  share = session.post(f"{BASE_URL}/shares", json={"segmentation_id": segmentation_id})
  share.raise_for_status()
  print(share.json()["url"])
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": "5b1f0c4e-2d3a-4e5f-9a8b-7c6d5e4f3a2b",
  "segmentation_id": "7d9e2f10-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
  "access": "anyone_with_link",
  "role": "viewer",
  "url": "https://www.halfpagetechnologies.com/share/uAgn3l8EOJxQXvpIF3G-X3K7c3ziqIAP",
  "view_count": 0,
  "last_viewed_at": null,
  "created_at": "2026-07-01T12:05:00Z",
  "revoked_at": null
}
```

Treat the `url` like a password to the result: anyone holding it can view it.
Search engines are told not to index shared pages.

## See who's looked

`view_count` and `last_viewed_at` go up each time the link is opened.

```bash curl theme={null}
# One share
curl -s "$BASE/shares/$SHARE_ID" -H "Authorization: Bearer $HALFPAGE_API_KEY"

# All live shares, or just one result's
curl -s "$BASE/shares?segmentation_id=$SEG_ID" -H "Authorization: Bearer $HALFPAGE_API_KEY"
```

## Turn a link off

Revoking stops the link opening at once. Sharing the same result again makes a
new link.

```bash curl theme={null}
curl -s -X DELETE "$BASE/shares/$SHARE_ID" -H "Authorization: Bearer $HALFPAGE_API_KEY"
```
