---
title: "Create or replace a share link"
method: POST
path: "/{id}"
---

# Create or replace a share link

`POST /{id}`

## Request

- Base URL: `https://marklayer.app/api`
- URL: `https://marklayer.app/api/{id}`
- Auth: none declared

## Path parameters

- `id` string, required: Unguessable share id you choose — it is the access token. Creating a new one takes at least 12 characters of [A-Za-z0-9_-]; a nanoid() or uuid is ideal.

## Request body

- union
  - unknown[]
    - unknown
  - object
    - `ops` unknown[], required: Annotation operations ([] for a blank canvas)
      - unknown
    - `url` string, uri: Page the share link overlays annotations onto
    - `width` integer: Reference viewport width in CSS pixels (e.g. 1440)
    - `expires_in` integer: Seconds until cleanup (max 2592000 = 30 days)

## Response `200`

Stored

- Ok
  - `ok` boolean, required

## Other responses

- `400`: Invalid operations data
- `401`: Password-protected link: send `Authorization: Bearer <password>`
- `403`: Link is view-only
- `429`: Too many wrong passwords for this link from this client

---

[API](https://skmtc.dev/marklayer/apis/marklayer-share-api.md) · [All operations](https://skmtc.dev/marklayer/apis/marklayer-share-api/llms.txt) · [OpenAPI document](https://skmtc.dev/marklayer/apis/marklayer-share-api/revisions/0d8cd55afad9?raw)
