---
title: "Get or create the share token of a wireframe"
method: POST
path: "/api/share/generate-token"
tags: ["sharing"]
---

# Get or create the share token of a wireframe

`POST /api/share/generate-token`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/share/generate-token`
- Auth: none declared

Authenticates server-side as PocketBase superuser, returns the `share_token` of the `wireframe_states` record `wireframeId`, and generates and stores a new 16-character token (crypto-random, alphanumeric) when the record has none. No caller authentication. PocketBase errors are answered with their HTTP status and message (status 500 when none).

## Request body

- ShareTokenRequest: Body of POST /api/share/generate-token.
  - `wireframeId` string, required: PocketBase `wireframe_states` record id; missing or empty → 400.

## Response `200`

Share token of the wireframe.

- ShareTokenResponse: Share token returned by POST /api/share/generate-token.
  - `shareToken` string, required: Existing `share_token` of the record, or a newly generated 16-character alphanumeric token.

## Other responses

- `400`: `wireframeId` missing or empty, or PocketBase rejected the superuser login or the update.
- `404`: No `wireframe_states` record with this id (PocketBase message).
- `500`: Superuser credentials (`POCKETBASE_ADMIN_EMAIL`, `POCKETBASE_ADMIN_PASSWORD`) not configured, malformed JSON body, or PocketBase unreachable.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
