---
title: "Create one-time view codes"
method: POST
path: "/v1/artifacts/{id}/view-codes"
tags: ["Collaborators"]
---

# Create one-time view codes

`POST /v1/artifacts/{id}/view-codes`

## Request

- Base URL: `https://shareout.site`
- URL: `https://shareout.site/v1/artifacts/{id}/view-codes`
- Auth: HTTP bearer

One personal code per person: the page link plus that code opens the page once, with no sign-in, for `view_seconds`, then it closes by itself and the code never works again. The viewer's name is written across the page; copy, print, save and download are blocked. Turns the page private; the owner and named collaborators keep their own access. Web pages only. The codes are in this response only. A browser cannot block a screenshot or a photo of the screen — the watermark is what names the person on any capture.

## Request body

- object
  - `recipients` union[], required: Who each code is for — the name is the watermark they see.
    - union
      - string
      - object
        - `label` string, required
  - `view_seconds` integer

## Response `201`

Created. Hand each person the link and their code.

- object
  - `enabled` boolean
  - `url` string, uri
  - `view_seconds` integer
  - `codes` object[]
    - `id` string
    - `label` string
    - `code` string
    - `view_seconds` integer
    - `created_at` string, date-time

## Other responses

- `400`: Invalid recipients or view_seconds, not a web page (`ONETIME_HTML_ONLY`), or too many codes (`VIEW_CODE_LIMIT`)
- `403`: Access denied

## Changes

- **2026-11-03** `1e3f7fd34f6d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/shareout/apis/shareout-rest-api/changes/v1/artifacts/:id/view-codes/post.md)

---

[API](https://skmtc.dev/shareout/apis/shareout-rest-api.md) - [All operations](https://skmtc.dev/shareout/apis/shareout-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/shareout/apis/shareout-rest-api/revisions/1e3f7fd34f6d?raw)
