---
title: "Mint a share link addressed to one recipient."
method: POST
path: "/sites/{idOrSlug}/share-tokens"
tags: ["Share tokens"]
---

# Mint a share link addressed to one recipient.

`POST /sites/{idOrSlug}/share-tokens`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}/share-tokens`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:write`, `sites:read`)

Set `label` to the person you are sending to: every open through this link is attributed back to that name and shows up in GET /sites/{idOrSlug}/recipients. To personalise ONE link across a whole mail-merge instead, skip this endpoint and append `?to={{contact.name}}` to the page URL.

## Request body

- object
  - `label` string: Who this link is for, e.g. "Megan Hanning". Becomes the attributed name on every open.
  - `expires_in_hours` integer: Token lifetime in hours. Omit for no token-level expiry.
  - `max_uses` integer: Cap on uses. Omit for unlimited.

## Response `201`

Created.

- ShareTokenCreated
  - `id` string, required
  - `token` string, required: Shown only in this response.
  - `url` string, uri, required: URL with ?t=<token> embedded; bypasses any password gate.
  - `expires_at` integer, nullable
  - `max_uses` integer, nullable
  - `label` string, nullable
  - `next` string: On a labelled link only: what to tell the user about following up on it.
  - `feedback` object: Present when minting this named link also switched client comments on for the page.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
