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

> ## Agent Instructions
> Usertick runs surveys on websites, by link, by QR code and by email, and collects every response in one inbox with reports, dashboards and workflows. The REST API lives at https://app.usertick.com/api/public/v1 and uses Bearer API keys or OAuth access tokens; the JavaScript SDK is the @usertick/snippet package on npm.

# Share, archive and copy surveys

> Get a survey's share link and QR code, archive a survey and restore it as a draft, and copy any survey into a new draft.

Four endpoints work on whole surveys, and none of them publishes one. A restored survey and a copy come back as drafts, which a person publishes in Usertick.

| Endpoint | Scopes | Does |
| - | - | - |
| [`GET /surveys/{surveyId}/share`](https://docs.usertick.com/developers/api/reference/get-survey-share) | `surveys:read` | Returns the link people answer on, with its custom domain and an optional QR code |
| [`POST /surveys/{surveyId}/archive`](https://docs.usertick.com/developers/api/reference/archive-survey) | `surveys:archive` | Archives a survey |
| [`POST /surveys/{surveyId}/restore`](https://docs.usertick.com/developers/api/reference/restore-survey) | `surveys:archive` | Brings an archived survey back as a draft |
| [`POST /surveys/{surveyId}/duplicate`](https://docs.usertick.com/developers/api/reference/duplicate-survey) | `surveys:draft`, `surveys:read` | Copies a survey into a new draft |

An app or an AI assistant acts as the person who connected it, so that person's role applies, and archiving, restoring and copying require the permission to manage surveys. An API key acts for the organization.

## Get the share link

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://app.usertick.com/api/public/v1/surveys/7c9e6679-7425-40de-944b-e07fc1f90ae7/share?language=fr&qr=svg" \
  -H "Authorization: Bearer utk_live_your_key_here"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "surveyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "active",
  "channel": "link",
  "linkSharing": true,
  "answering": true,
  "url": "https://survey.example.com/s/kX9pQ2mL?lang=fr",
  "host": "custom",
  "customDomain": { "id": "88888888-8888-4888-8888-888888888888", "domain": "survey.example.com", "state": "live", "serving": true, "pausedByPlan": false },
  "language": "fr",
  "languages": ["en", "fr"],
  "qr": { "format": "svg", "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" ...>", "attribution": true }
}
```

The API returns the same link that the survey's **Share** panel shows and its emails carry:

* It uses the survey's custom domain when that domain is live and your plan includes custom domains. Otherwise it uses Usertick's survey address, and `customDomain` still shows the domain with its `state`: `dns`, `certificate`, `live` or `unreachable`.
* `url` is `null` while link sharing is off. A person turns the link on in Usertick, and the API never changes it.
* `answering` is `true` only while the link is on, the survey is live and Usertick hasn't taken it offline. A draft, paused or archived survey shows its link without taking answers.
* `language` must be one of the survey's `languages`, and it adds `?lang=` to the link so the survey opens in that language. Any other value returns `400` with `PUB-009-001`.

With `qr=svg`, `qr.svg` holds the QR code of `url` as an SVG document. It is the same file the panel's **Download SVG** saves, with the code and, when `attribution` is `true`, the "Powered by Usertick" line under it. The line follows the survey's badge setting and stays on plans that don't allow hiding the badge. Your own logo isn't included in the SVG. `qr` is `null` while `url` is `null`, and any other value of `qr` returns `400` with `PUB-009-002`.

## Archive and restore a survey

You can archive a survey in draft, live or paused status. The survey stops showing and taking answers at once, leaves the survey list and frees its place in your plan's survey limit, while its responses stay. Archiving a survey that is already archived returns `409` with `SRV-010-002`.

Restoring brings an archived survey back as a draft, with any edits that waited while it was archived, and never publishes or resumes the survey. A restore:

* takes a place in your plan's survey limit, and returns `403` with `PLN-001-002` when the plan is full;
* returns `409` with `PUB-008-003` while the survey is open in the Usertick editor; send it again once the person closes the editor;
* returns `409` with `SRV-011-002` for a survey that isn't archived.

Both calls return the survey as [`GET /surveys`](https://docs.usertick.com/developers/api/reference/list-surveys) lists it.

## Copy a survey into a draft

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://app.usertick.com/api/public/v1/surveys/7c9e6679-7425-40de-944b-e07fc1f90ae7/duplicate" \
  -H "Authorization: Bearer utk_live_your_key_here" \
  -H "Idempotency-Key: copy-checkout-nps-1" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Checkout NPS, spring" }'
```

Like **Duplicate** in Usertick, the call makes a new draft with the same questions, logic, targeting, languages, theme and texts. You can copy a survey in any status, archived ones included.

* Without a body, or without `name`, Usertick names the copy "{name} copy", shortening a long name so the copy fits 255 characters.
* The copy doesn't take over the source's link. A link or email survey's copy gets its own link, as any new survey does, and takes no answers while it is a draft.
* The copy stays in the source's folder.
* The copy counts as a new survey, so your plan's limits refuse it rather than cut it, with `PLN-001-002` for surveys, `PLN-001-003` for questions per survey and `SRV-001-027` for languages per survey.
* Each copy uses one of the credential's 200 survey creates a day, which it shares with [`POST /surveys`](https://docs.usertick.com/developers/api/reference/create-survey). Past that allowance, the call returns `429` with `PUB-008-008`.

The call returns `201` with the draft, in the shape [`GET /surveys/{surveyId}/draft`](https://docs.usertick.com/developers/api/reference/get-survey-draft) returns, and its address in `Location`. Give the person `editorUrl`, which opens the copy in the Usertick editor where they review and publish it. If you send the request again with the same `Idempotency-Key`, it returns the same copy. See [Idempotency](https://docs.usertick.com/developers/api/idempotency.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.