# Sharable Links

Generate shareable survey links

## Generate a shareable survey link

> Generates a dedicated, shareable link for a survey so you can distribute it independently.\
> The response is returned as JSON and contains the generated link identifier and URL.\
> Optional built-in fields:\
> \- \`expiresInMinutes\`: How long the link should stay active. If omitted, the link has no expiration.\
> \- \`language\`: The language to open the survey in. If omitted, the survey is shown in its default language.\
> \- \`isReusable\`: Indicates whether the link can be used multiple times. If omitted, the link is single-use.\
> \- \`title\`: A user-friendly name for the link, used for display in the UI.\
> \- \`customFields\` can contain any fields you want to attach to the generated link (e.g., conversation id, channel, campaign). All custom field values must be strings and are limited to 50 characters.

```json
{"openapi":"3.0.3","info":{"title":"Pristo Public API","version":"1.0.0"},"tags":[{"name":"Sharable Links","description":"Generate shareable survey links"}],"servers":[{"url":"https://api.pristo.io","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key (UUID)"}},"parameters":{"requestIdHeader":{"name":"X-Request-Id","in":"header","required":false,"schema":{"type":"string","format":"uuid"},"description":"Optional request correlation ID"}},"schemas":{"GenerateLinkRequest":{"type":"object","properties":{"expiresInMinutes":{"type":"integer","minimum":1,"description":"How long the link should stay active. If omitted, the link does not expire."},"language":{"type":"string","description":"Language to open the survey in. If omitted, the survey default language is used."},"isReusable":{"type":"boolean","description":"Indicates whether the generated link can be used multiple times. If omitted, the link is single-use."},"title":{"type":"string","description":"User-friendly name for the generated link, used for display in the UI."},"customFields":{"type":"object","description":"Custom fields to attach to the generated link. Values must be strings (max 50 characters).","additionalProperties":{"type":"string","maxLength":50}}},"additionalProperties":false},"GenerateLinkResponse":{"type":"object","required":["linkId","url"],"properties":{"linkId":{"type":"string","format":"uuid","description":"Unique identifier of the generated shareable link."},"url":{"type":"string","format":"uri","description":"The generated shareable link URL."}},"additionalProperties":false},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"headers":{"requestId":{"schema":{"type":"string","format":"uuid"},"description":"Request correlation ID"}},"responses":{"BadRequest":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Unauthorized":{"description":"Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v1/links/generate/{surveyId}":{"post":{"tags":["Sharable Links"],"summary":"Generate a shareable survey link","description":"Generates a dedicated, shareable link for a survey so you can distribute it independently.\nThe response is returned as JSON and contains the generated link identifier and URL.\nOptional built-in fields:\n- `expiresInMinutes`: How long the link should stay active. If omitted, the link has no expiration.\n- `language`: The language to open the survey in. If omitted, the survey is shown in its default language.\n- `isReusable`: Indicates whether the link can be used multiple times. If omitted, the link is single-use.\n- `title`: A user-friendly name for the link, used for display in the UI.\n- `customFields` can contain any fields you want to attach to the generated link (e.g., conversation id, channel, campaign). All custom field values must be strings and are limited to 50 characters.","operationId":"generateLink","parameters":[{"name":"surveyId","in":"path","required":true,"schema":{"type":"string"},"description":"Survey identifier"},{"$ref":"#/components/parameters/requestIdHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateLinkRequest"}}}},"responses":{"201":{"description":"Shareable link generated successfully.","headers":{"X-Request-Id":{"$ref":"#/components/headers/requestId"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateLinkResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pristo.io/sharable-links.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
