# Share Link Publishing

> Create a shared link and verify published configuration, answers, and citations in a new conversation.

Source: https://doc.fastgpt.io/guide/build/publish/link
Last Updated: 2026-11-12

Share Link publishing generates a login-free public URL for any published FastGPT app with configurable expiration, QPM rate limits, AI Points caps, and citation visibility, enabling external visitors to chat in a browser or via an embedded `iframe`.

## Introduction

A share link creates a temporary public URL that lets anyone on the internet use your app. Usage is billed to the team that owns the app, so share the link only with its intended audience.

FastGPT generates a `localId` for each visitor to retrieve chat history from the cloud. This identity is tied to the same device and browser. Switching devices or clearing browser storage loses access to that history. Visitors can retrieve up to `20` conversations from the past `30 days`.

## Before you begin

Prepare Application editing and channel-management permissions, available models, and quota. [Publish the verified configuration](https://doc.fastgpt.io/guide/build/publish/versions) first. Link usage is billed to the owning team. Use fictional material for demonstrations and set expiry and usage limits where available. Entry points and options depend on your team version and permissions.

## Usage Flow

### 1. Create a Link

Go to `App Details` -> `Publishing Channels` -> `Login-Free Window`, then click **Create New Link** in the upper-right corner and fill in the **Create Link** dialog.

Enter a recognizable name and set the required expiry time, QPM, and points limit. This task checks the source text: enable **View citation snippets** in the visibility configuration, then confirm creation. Check the expiry time and points limit displayed in the list. The name is only used for display in the record list.

![Create a sharing link and configure access limits](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/publish-link.png.webp)

### 2. Copy the Link

Click **Start Using** in the action column on the right side of the list (the adjacent **...** menu provides **Edit** and **Delete**), then copy the direct link or switch to the embed tab to copy the iframe snippet.

### 3. Verify a New Conversation and Citations

Open the link and start a new conversation with the same known questions used in debug. For the travel example, verify 15 calendar days, an invoice, and the approved travel request. Questions outside the material (such as how to reimburse overseas visa fees) receive a missing-information response. Open the cited passage and check its source and supporting text.

If the citation action is missing, check the link's citation-visibility settings and the visitor's permissions. Enable the permitted viewing options needed by the audience, then verify again in a new conversation through the link.

### 4. Recover Access or Result Differences

If the link fails to open, check expiry, usage limits, available quota, and configured authentication. If answers differ, check the linked Application, published version, Knowledge base indexes, and message history. After correction, start a new conversation through the same link and repeat fact and citation checks. See [Knowledge base troubleshooting](https://doc.fastgpt.io/guide/dataset/faq).

## Parameter Configuration

Some parameters are only available in the commercial edition.

* **Name**: The display name of the link record.
* **Expiration time**: The link stops accepting requests after this time.
* **QPM**: The maximum number of queries per minute per IP.
* **Points limit**: The maximum billable AI points allowed for this link.
* **Token Authentication**: Integrates with third-party systems for identity authentication and chat callbacks.
* **Real-time running status**: Whether to display currently running nodes during generation.
* **View skill references**: Controls whether visitors can view skill invocation reference details.
* **View citation snippets**: Controls access to retrieved Dataset snippets for verifying answer evidence.
* **View full citation**: Allows visitors to view the complete document text containing the citation.
* **Download/open source original text**: Allows visitors to download original Dataset files or open source websites; verify the sharing scope of your materials before enabling.

## Share Link Authentication

### Introduction

Share link authentication is designed to quickly and securely integrate FastGPT's chat interface into your existing system with just 2 endpoints. This feature is only available in the commercial edition.

### Usage Guide

In the share link configuration, you can optionally fill in the `Token Authentication` field. This is the root URL for a `POST` request. Once configured, share link initialization, chat start, and chat completion will all send requests to specific endpoints under this URL. Below, we use `host` to represent the `Token Authentication root URL`. For the initialization and pre-chat checks, return `success` and the required `data.uid`. You can include `message` or `msg` to explain a failed check. Use this response format:

#### Unified Response Format

```jsonc
{
  "success": true,
  "message": "Error message",
  "msg": "Same as message, error message",
  "data": {
    "uid": "Unique user identifier" // Required
  }
}
```

`FastGPT` checks whether `success` is `true` to decide if the user can proceed. `message` and `msg` are equivalent -- you can return either one. When `success` is not `true`, this error message will be displayed to the user.

`uid` is the unique user identifier and must be returned. The ID format must be a string that does not contain `|`, `/`, or `\\` characters, with a length of 255 **bytes** or less. Otherwise, an `Invalid UID` error will be returned. The `uid` is used to pull and save chat history -- see the practical example below.

#### Flow Diagram

When a visitor opens the link, FastGPT sends `authToken` to the initialization check. A successful check loads the app; a failed check blocks access. Each submitted message then passes through the pre-chat check. After an allowed conversation finishes, FastGPT sends its results to the optional reporting endpoint.

![Share link with identity verification](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/diagrams/share-link-auth.en.light.svg)

Initialization requires `success=true` and a valid string `uid`. The commercial chat entry checks expiration, usage, and QPM before the start callback; the finish callback reports results. Protected links also verify the signed-in member and application read access.

### Configuration Guide

#### 1. Configure the Token Authentication URL

Once configured, every time the share link is used, verification and reporting requests will be sent to the corresponding endpoints.

You only need to configure the root URL here -- no need to specify the full request path.

#### 2. Add an Extra Query Parameter to the Share Link

Add an extra parameter `authToken` to the share link URL. For example:

Original link: `https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192`

Full link: `https://share.fastgpt.io/chat/share?shareId=648aaf5ae121349a16d62192&authToken=userid12345`

This `authToken` is typically a unique user credential (such as a token) generated by your system. FastGPT will include `token=[authToken]` in the `body` of the verification request.

#### 3. Implement the Chat Initialization Verification Endpoint

#### Request Example

```bash
curl --location --request POST '{{host}}/shareAuth/init' \
--header 'Content-Type: application/json' \
--data-raw '{
    "token": "[authToken]"
}'
```

#### Auth Success

```json
{
  "success": true,
  "data": {
    "uid": "Unique user identifier"
  }
}
```

The system retrieves chat history for the returned `uid` under this share link.

#### Auth Failure

```json
{
  "success": false,
  "message": "Authentication failed"
}
```

#### 4. Implement the Pre-Chat Verification Endpoint

#### Request Example

```bash
curl --location --request POST '{{host}}/shareAuth/start' \
--header 'Content-Type: application/json' \
--data-raw '{
    "token": "[authToken]",
    "question": "User question"
}'
```

#### Auth Success

```json
{
  "success": true,
  "data": {
    "uid": "Unique user identifier"
  }
}
```

#### Auth Failure

```json
{
  "success": false,
  "message": "Authentication failed"
}
```

```json
{
  "success": false,
  "message": "Content policy violation"
}
```

#### 5. Implement the Chat Result Reporting Endpoint (Optional)

This endpoint has no required response format.

FastGPT sends the request body `{ token, appName, responseData, chatId }`: `responseData` uses the same format as the response details of the [chat endpoint](https://doc.fastgpt.io/openapi/intro#response), `appName` is the app name, and `chatId` is the conversation ID.

Inspect `totalPoints` (AI points) and `tokens` (model context tokens) within `responseData`. The top-level `token` is the business authentication credential. Model and module names in the payload below illustrate the field structure:

```bash
curl --location --request POST '{{host}}/shareAuth/finish' \
--header 'Content-Type: application/json' \
--data-raw '{
    "token": "[authToken]",
    "appName": "[App name]",
    "responseData": [
        {
            "moduleName": "Dataset Search",
            "moduleType": "datasetSearchNode",
            "totalPoints": 1.5278,
            "query": "Who is the director\nWho is the director of Suzume?\nWho directed this film?\nWho directed Suzume?",
            "model": "text-embedding-v4",
            "tokens": 1524,
            "similarity": 0.83,
            "limit": 400,
            "searchMode": "embedding",
            "searchUsingReRank": false,
            "extensionModel": "qwen3.8-flash",
            "extensionResult": "Who is the director of Suzume?\nWho directed this film?\nWho directed Suzume?",
            "runningTime": 2.15
        },
        {
            "moduleName": "AI Chat",
            "moduleType": "chatNode",
            "totalPoints": 0.593,
            "model": "qwen3.8-flash",
            "tokens": 593,
            "query": "Who is the director",
            "maxToken": 2000,
            "quoteList": [
                {
                    "id": "65bb346a53698398479a8854",
                    "q": "Who is the director?",
                    "a": "The director of Suzume is Makoto Shinkai.",
                    "chunkIndex": 0,
                    "datasetId": "65af9b947916ae0e47c834d2",
                    "collectionId": "65bb345c53698398479a868f",
                    "sourceName": "dataset - 2024-01-23T151114.198.csv",
                    "sourceId": "65bb345b53698398479a868d",
                    "score": [
                        {
                            "type": "embedding",
                            "value": 0.9377183318138123,
                            "index": 0
                        },
                        {
                            "type": "rrf",
                            "value": 0.06557377049180328,
                            "index": 0
                        }
                    ]
                }
            ],
            "historyPreview": [
                {
                    "obj": "Human",
                    "value": "Use the content inside the <Data></Data> tags as a reference for this conversation:\n\n<Data>\nWho is the director?\nThe director of Suzume is Makoto Shinkai.\n------\nWho is the screenwriter of Suzume?22\nMakoto Shinkai is the screenwriter of this film.\n------\nWho is the female lead in Suzume?\nThe female lead is Suzume.\n------\nWhich well-known person is part of the production team for Suzume?2\nGenki Kawamura is a member of the production team for this film.\n------\nWho are you?\nI am an assistant for the film Suzume\n------\nWho is the male lead in Suzume?\nThe male lead in Suzume is Souta Munakata, voiced by Hokuto Matsumura.\n------\nWhat is the name of the novel written by Makoto Shinkai, the creator of Suzume?\nThe novel is titled Suzume.\n------\nWho is the female lead in Suzume?\nThe female lead in Suzume is Suzume Iwato, voiced by Nanoka Hara.\n------\nWhere is the story of Suzume set?\nJapan\n------\nWho voices Tamaki Iwato in Suzume?\nEri Fukatsu voices Tamaki Iwato in Suzume.\n</Data>\n\nResponse requirements:\n- Ask for clarification when you are unsure of the answer.\n- Avoid mentioning that your knowledge comes from <Data></Data>.\n- Keep answers consistent with the content in <Data></Data>.\n- Use Markdown to format your answer.\n- Respond in the same language as the question.\n\nQuestion:\"\"\"Who is the director\"\"\""
                },
                {
                    "obj": "AI",
                    "value": "The director of Suzume is Makoto Shinkai."
                }
            ],
            "contextTotalLen": 2,
            "runningTime": 1.32
        }
    ],
    "chatId": "[chatId]"
}'
```

**Full responseData Field Reference:**

```ts
type ResponseType = {
  moduleType: FlowNodeTypeEnum; // Node type
  moduleName: string; // Node name
  moduleLogo?: string; // Logo
  runningTime?: number; // Running time
  query?: string; // User question / search query
  textOutput?: string; // Text output

  tokens?: number; // Total context tokens
  model?: string; // Model used
  contextTotalLen?: number; // Total context length
  totalPoints?: number; // Total AI points consumed

  temperature?: number; // Temperature
  maxToken?: number; // Model max tokens
  quoteList?: SearchDataResponseItemType[]; // Citation list
  historyPreview?: ChatItemMiniType[]; // Context preview (history may be truncated)

  similarity?: number; // Minimum similarity threshold
  limit?: number; // Max citation tokens
  searchMode?: `${DatasetSearchModeEnum}`; // Search mode
  searchUsingReRank?: boolean; // Whether rerank is used
  extensionModel?: string; // Query expansion model
  extensionResult?: string; // Query expansion result
  extensionTokens?: number; // Query expansion total token length

  cqList?: ClassifyQuestionAgentItemType[]; // Question classification list
  cqResult?: string; // Question classification result

  extractDescription?: string; // Content extraction description
  extractResult?: Record<string, any>; // Content extraction result

  params?: Record<string, any>; // HTTP node params
  body?: Record<string, any>; // HTTP node body
  headers?: Record<string, any>; // HTTP node headers
  httpResult?: Record<string, any>; // HTTP node result

  pluginOutput?: Record<string, any>; // Plugin output
  pluginDetail?: ChatHistoryItemResType[]; // Plugin details

  isElseResult?: boolean; // Conditional result
};
```

### Practical Example

We'll use [Laf as the server](https://laf.dev/) to demonstrate how these 3 endpoints work.

#### 1. Create 3 Laf Endpoints

#### /shareAuth/init

In this endpoint, we require `token` to equal `fastgpt` to pass verification. (Not recommended for production -- avoid hardcoding values.)

```ts
import cloud from '@lafjs/cloud';

export default async function (ctx: FunctionContext) {
  const { token } = ctx.body;

  // Token decoding logic omitted
  if (token === 'fastgpt') {
    return { success: true, data: { uid: 'user1' } };
  }

  return { success: false, message: 'Authentication failed' };
}
```

#### /shareAuth/start

In this endpoint, we require `token` to equal `fastgpt` to pass verification. The example also rejects questions containing a restricted keyword to demonstrate content moderation.

```ts
import cloud from '@lafjs/cloud';

export default async function (ctx: FunctionContext) {
  const { token, question } = ctx.body;

  // Token decoding logic omitted
  if (token !== 'fastgpt') {
    return { success: false, message: 'Authentication failed' };
  }

  if (question.includes('你')) {
    return { success: false, message: 'Content policy violation' };
  }

  return { success: true, data: { uid: 'user1' } };
}
```

#### /shareAuth/finish

The result reporting endpoint can handle custom logic as needed. The historical example below uses `price` and its corresponding conversion factor. Check your version's payload before adapting billing logic; the payload shown earlier on this page uses `totalPoints`.

```ts
import cloud from '@lafjs/cloud';

export default async function (ctx: FunctionContext) {
  const { token, responseData } = ctx.body;

  const totalPoints = responseData.reduce((sum, item) => sum + (item.totalPoints ?? 0), 0);

  // Authenticate the callback and record points with an idempotency key.
  // Currency conversion follows your own billing contract.
  return { totalPoints };
}
```

#### 2. Configure the Verification URL

Copy any of the 3 endpoint URLs, e.g. `https://d8dns0.laf.dev/shareAuth/finish`, remove the `/shareAuth/finish` part, and enter the root URL `https://d8dns0.laf.dev` in the `Token Authentication` field.

#### 3. Modify the Share Link Parameters

Original share link: `https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c`

Modified: `https://share.fastgpt.io/chat/share?shareId=64be36376a438af0311e599c&authToken=fastgpt`

#### 4. Test the Result

1. Opening the original link or a link where `authToken` does not equal `fastgpt` will show an authentication error.
2. Sending a message containing the restricted keyword will show a content policy violation error.

### Use Cases

This authentication method is typically used to embed the `share link` directly into your app. Before opening the share link in your app, you should append the `authToken` parameter.

Beyond integrating with your existing user system, you can also implement a `balance` feature -- deduct user balance via the `result reporting` endpoint and check user balance via the `pre-chat verification` endpoint.
