FastGPTFastGPT

Stop Chat Completion

Write a stop flag for an active FastGPT workflow chat session so execution halts at the next safe checkpoint.

Endpoint Overview

  • Method : POST
  • Path : /api/v2/chat/stop
  • Module : Chat / Chat Completions & Control
  • Authentication : Authorization: Bearer <apiKey>—Supports App API Key ( appId optional) and Personal API Key ( appId required); also supports authProxy team member proxy and outLinkAuthData share link (see API Getting Started )
  • Interactive Try-It-Out : Open in Scalar API Explorer (self-hosted instances: replace the origin with <instance>/apidoc/systemopenapi#tag/%E4%BC%9A%E8%AF%9D%E6%93%8D%E4%BD%9C/POST/v2/chat/stop )

Description & Notes

Writes a stop flag for an active conversation and returns immediately. Clients should abort the open stream upon receiving success. The workflow halts scheduling at the next safe checkpoint; non-interruptible in-flight nodes such as HTTP requests still wait for their current step to finish.

Request Parameters

Request Body ( application/json )

Shared Parameters Across Branches

FieldTypeRequiredDefaultConstraints & Description
chatIdstringYes-Chat ID. minLength: 1; maxLength: 1024

Mutually Exclusive Branches ( anyOf )

  • App Chat

Identify the conversation via appId . When both API Key and login session are supported, Authorization takes precedence over token/Cookie.

FieldTypeRequiredDefaultConstraints & Description
appIdstringYes-Application ID authenticated with the request header credentials allowed by this endpoint. pattern: ^[0-9a-fA-F]{24}$
sourceTypestring (enum)No-Session resource type associated with appId . Defaults to app ; pass the matching sourceType for assistant builder sessions. Allowed values: app , chatAgentHelper , workflowBuilder

Default Identity : Omit customUid and authProxy to execute using the team member identity associated with the credential.

Custom end user ( customUid ): Tag end users from your own system via customUid without changing the authenticating member or permissions. Passed as workflow userId and used to scope chat management.

FieldTypeRequiredDefaultConstraints & Description
customUidstringYes-Supported only for standard app API Key calls. Exact match against the external user ID ( outLinkUid , not tmbId ). Omit to keep full scope or pass to restrict reads, updates, and deletions (max 1024 chars, cannot be empty or null , does not change member identity). minLength: 1; maxLength: 1024

Proxy Team Member ( authProxy ): Act on behalf of another member in the same team via authProxy . Available only on personal API keys with authProxy enabled; mutually exclusive with customUid .

FieldTypeRequiredDefaultConstraints & Description
authProxyobjectYes-API Key proxy caller identity. Available only for personal keys with authProxy enabled; specify tmbId or username ( tmbId takes precedence without falling back to username on invalid ID).
authProxy.tmbIdstringYes-Branch: By Team Member ID . Proxied team member ID ( tmbId ), takes precedence over username . pattern: ^[0-9a-fA-F]{24}$
authProxy.usernamestringYes-Branch: By Username . Proxied team member username. minLength: 1; maxLength: 128
  • Skill Debug Session

Identify the debug session via skillId (takes precedence over appId and ignores sourceType ), authenticated with allowed request header credentials.

FieldTypeRequiredDefaultConstraints & Description
skillIdstringYes-Skill Edit debug ID authenticated with allowed request header credentials. pattern: ^[0-9a-fA-F]{24}$
  • Share-Link Chat

Resolves the underlying app via outLinkAuthData , taking precedence over skillId and appId (ignoring sourceType ). Protected links still validate login cookies/tokens and never fall back to standard auth on failure.

FieldTypeRequiredDefaultConstraints & Description
outLinkAuthDataobjectYes-Share-link auth payload ( shareId / outLinkUid ). Overrides skillId and appId ; protected links still validate login session cookies/tokens.
outLinkAuthData.shareIdstringYes-Share link ID. minLength: 1
outLinkAuthData.outLinkUidstringYes-External share user ID. minLength: 1
  • App API Key (no appId required)

When authorizing with an app-bound App API Key, omit appId and sourceType ; the server resolves the bound app with sourceType fixed to app . Personal keys and login sessions cannot omit appId , and an explicit appId does not override an App API Key binding.

Default Identity : Omit customUid and authProxy to execute using the team member identity associated with the credential.

Custom end user ( customUid ): Tag end users from your own system via customUid without changing the authenticating member or permissions. Passed as workflow userId and used to scope chat management.

FieldTypeRequiredDefaultConstraints & Description
customUidstringYes-Supported only for standard app API Key calls. Exact match against the external user ID ( outLinkUid , not tmbId ). Omit to keep full scope or pass to restrict reads, updates, and deletions (max 1024 chars, cannot be empty or null , does not change member identity). minLength: 1; maxLength: 1024

Request Examples

Replace YOUR_API_KEY and placeholder IDs before running. Self-hosted users should replace the base URL with <instance>/api .

cURL Example

curl --fail-with-body -X POST "https://cloud.fastgpt.io/api/v2/chat/stop" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "appId": "68ad85a7463006c963799a05",
  "chatId": "1234567890"
}'

Minimal Valid JSON Body

{
  "appId": "68ad85a7463006c963799a05",
  "chatId": "1234567890"
}

Response Schema & Examples

Successful /api/* calls return the standard FastGPT envelope { "code": 200, "statusText": "", "message": "", "data": ... } , where data matches the 200 schema below (when a payload schema is declared; otherwise refer to the status description for runtime data semantics).

HTTP 200

Successfully wrote workflow stop flag

Content-Type : application/json

FieldTypeRequiredDefaultConstraints & Description
successbooleanYes-Whether the stop signal was written successfully
completedbooleanYes-Deprecated . Whether full workflow teardown is confirmed; the endpoint returns immediately without waiting, so this is always false
chatGenerateStatusnumber (enum)No-Deprecated . Legacy conservative generating flag for backward compatibility; does not mean new workflow nodes will keep scheduling. Allowed values: 0 , 1
Edit on GitHub

Last updated

On this page

Put your business knowledge to work with AI

Import company documents and build accurate, reliable, traceable AI answers.