docs(api): add end-user lookup (#684)

* docs(api): add end-user lookup

* update zh and ja docs

---------

Co-authored-by: RiskeyL <7a8y@163.com>
This commit is contained in:
盐粒 Yanli
2026-03-01 19:53:17 +08:00
committed by GitHub
parent c2909cd5ee
commit b7f1aab7b4
12 changed files with 594 additions and 13 deletions

View File

@@ -204,6 +204,35 @@
}
}
},
"/end-users/{end_user_id}": {
"get": {
"summary": "Get End User",
"description": "Retrieve an end user by ID.\n\nThis is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).",
"operationId": "getEndUser",
"tags": ["End Users"],
"parameters": [
{
"name": "end_user_id",
"in": "path",
"required": true,
"description": "End user ID.",
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "End user retrieved successfully.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/EndUserDetail" }
}
}
},
"404": { "$ref": "#/components/responses/EndUserNotFound" },
"500": { "$ref": "#/components/responses/InternalServerError" }
}
}
},
"/files/{file_id}/preview": {
"get": {
"summary": "File Preview",
@@ -1111,6 +1140,10 @@
"ConversationNotFound": {
"description": "Conversation not found. Error code: `conversation_not_exists`",
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
},
"EndUserNotFound": {
"description": "End user not found. Error code: `end_user_not_found`",
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
}
},
"schemas": {
@@ -1491,6 +1524,21 @@
"created_at": { "type": "integer", "format": "int64" }
}
},
"EndUserDetail": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"tenant_id": { "type": "string", "format": "uuid" },
"app_id": { "type": "string", "format": "uuid", "nullable": true },
"type": { "type": "string", "example": "service_api" },
"external_user_id": { "type": "string", "nullable": true },
"name": { "type": "string", "nullable": true },
"is_anonymous": { "type": "boolean" },
"session_id": { "type": "string" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" }
}
},
"MessageFeedbackRequest": {
"type": "object",
"required": ["user"],
@@ -1908,10 +1956,11 @@
"tags": [
{ "name": "Chat", "description": "Operations related to chat messages and interactions." },
{ "name": "Files", "description": "File upload and preview operations." },
{ "name": "End Users", "description": "Operations related to end user information." },
{ "name": "Feedback", "description": "User feedback operations." },
{ "name": "Conversations", "description": "Operations related to managing conversations." },
{ "name": "TTS", "description": "Text-to-Speech and Speech-to-Text operations." },
{ "name": "Application", "description": "Operations to retrieve application settings and information." },
{ "name": "Annotations", "description": "Operations related to managing annotations for direct replies." }
]
}
}

View File

@@ -137,6 +137,35 @@
}
}
},
"/end-users/{end_user_id}": {
"get": {
"summary": "Get End User",
"description": "Retrieve an end user by ID.\n\nThis is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).",
"operationId": "getEndUser",
"tags": ["End Users"],
"parameters": [
{
"name": "end_user_id",
"in": "path",
"required": true,
"description": "End user ID.",
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "End user retrieved successfully.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/EndUserDetail" }
}
}
},
"404": { "$ref": "#/components/responses/EndUserNotFound" },
"500": { "$ref": "#/components/responses/InternalServerError" }
}
}
},
"/files/{file_id}/preview": {
"get": {
"summary": "File Preview",
@@ -768,7 +797,8 @@
"S3ErrorFile": { "description": "S3 storage error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"InternalServerError": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"SuccessResult": { "description": "Operation successful.", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string", "example": "success" } } } } } },
"ConversationNotFound": { "description": "Conversation not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
"ConversationNotFound": { "description": "Conversation not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"EndUserNotFound": { "description": "End user not found. Error code: `end_user_not_found`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
},
"schemas": {
"AdvancedChatRequest": {
@@ -1049,6 +1079,21 @@
"FileUploadResponse": {
"type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "size": { "type": "integer" }, "extension": { "type": "string" }, "mime_type": { "type": "string" }, "created_by": { "type": "string", "format": "uuid" }, "created_at": { "type": "integer", "format": "int64" } }
},
"EndUserDetail": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"tenant_id": { "type": "string", "format": "uuid" },
"app_id": { "type": "string", "format": "uuid", "nullable": true },
"type": { "type": "string", "example": "service_api" },
"external_user_id": { "type": "string", "nullable": true },
"name": { "type": "string", "nullable": true },
"is_anonymous": { "type": "boolean" },
"session_id": { "type": "string" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" }
}
},
"MessageFeedbackRequest": {
"type": "object", "required": ["user"], "properties": { "rating": { "type": "string", "enum": ["like", "dislike", null], "nullable": true }, "user": { "type": "string" }, "content": { "type": "string", "nullable": true } }
},
@@ -1129,10 +1174,11 @@
"tags": [
{ "name": "Chatflow", "description": "Advanced chat operations with workflow events." },
{ "name": "Files", "description": "File upload and preview operations for advanced chat." },
{ "name": "End Users", "description": "Operations related to end user information." },
{ "name": "Feedback", "description": "User feedback operations for advanced chat." },
{ "name": "Conversations", "description": "Conversation management for advanced chat." },
{ "name": "TTS", "description": "Speech and Text conversion for advanced chat." },
{ "name": "Application", "description": "Application settings and info for advanced chat." },
{ "name": "Annotations", "description": "Annotation management for advanced chat." }
]
}
}

View File

@@ -232,6 +232,49 @@
}
}
},
"/end-users/{end_user_id}": {
"get": {
"summary": "Get End User",
"description": "Retrieve an end user by ID.\n\nThis is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).",
"operationId": "getEndUser",
"tags": ["End Users"],
"parameters": [
{
"name": "end_user_id",
"in": "path",
"required": true,
"description": "End user ID.",
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "End user retrieved successfully.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/EndUserDetail" }
}
}
},
"404": {
"description": "End user not found. Error code: `end_user_not_found`",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/ErrorResponse" }
}
}
}
}
}
},
"/completion-messages/{task_id}/stop": {
"post": {
"summary": "Stop Generate",
@@ -961,6 +1004,21 @@
"created_at": { "type": "integer", "format": "int64", "description": "Creation timestamp (Unix epoch).", "example": 1577836800 }
}
},
"EndUserDetail": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"tenant_id": { "type": "string", "format": "uuid" },
"app_id": { "type": "string", "format": "uuid", "nullable": true },
"type": { "type": "string", "example": "service_api" },
"external_user_id": { "type": "string", "nullable": true },
"name": { "type": "string", "nullable": true },
"is_anonymous": { "type": "boolean" },
"session_id": { "type": "string" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" }
}
},
"MessageFeedbackRequest": {
"type": "object",
"properties": {
@@ -1211,8 +1269,9 @@
"tags": [
{ "name": "Completion", "description": "Operations related to text generation and completion." },
{ "name": "Files", "description": "Operations related to file management." },
{ "name": "End Users", "description": "Operations related to end user information." },
{ "name": "Feedback", "description": "Operations related to user feedback." },
{ "name": "TTS", "description": "Operations related to Text-to-Speech." },
{ "name": "Application", "description": "Operations to retrieve application settings and information." }
]
}
}

View File

@@ -194,6 +194,35 @@
}
}
},
"/end-users/{end_user_id}": {
"get": {
"summary": "Get End User",
"description": "Retrieve an end user by ID.\n\nThis is useful when other APIs return an end-user ID (e.g. `created_by` from File Upload).",
"operationId": "getEndUser",
"tags": ["End Users"],
"parameters": [
{
"name": "end_user_id",
"in": "path",
"required": true,
"description": "End user ID.",
"schema": { "type": "string", "format": "uuid" }
}
],
"responses": {
"200": {
"description": "End user retrieved successfully.",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/EndUserDetail" }
}
}
},
"404": { "$ref": "#/components/responses/EndUserNotFound" },
"500": { "$ref": "#/components/responses/InternalServerError" }
}
}
},
"/workflows/logs": {
"get": {
"summary": "Get Workflow Logs",
@@ -256,7 +285,8 @@
"UnsupportedFileTypeFile": { "description": "Unsupported file type for upload.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"S3ErrorFile": { "description": "S3 storage error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"InternalServerError": { "description": "Internal server error.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } },
"SuccessResult": { "description": "Operation successful.", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string", "example": "success" } } } } } }
"SuccessResult": { "description": "Operation successful.", "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string", "example": "success" } } } } } },
"EndUserNotFound": { "description": "End user not found. Error code: `end_user_not_found`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }
},
"schemas": {
"WorkflowExecutionRequest": {
@@ -417,6 +447,21 @@
"FileUploadResponse": {
"type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "size": { "type": "integer" }, "extension": { "type": "string" }, "mime_type": { "type": "string" }, "created_by": { "type": "string", "format": "uuid" }, "created_at": { "type": "integer", "format": "int64" } }
},
"EndUserDetail": {
"type": "object",
"properties": {
"id": { "type": "string", "format": "uuid" },
"tenant_id": { "type": "string", "format": "uuid" },
"app_id": { "type": "string", "format": "uuid", "nullable": true },
"type": { "type": "string", "example": "service_api" },
"external_user_id": { "type": "string", "nullable": true },
"name": { "type": "string", "nullable": true },
"is_anonymous": { "type": "boolean" },
"session_id": { "type": "string" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" }
}
},
"WorkflowLogsResponse": {
"type": "object",
"properties": {
@@ -484,6 +529,7 @@
"tags": [
{ "name": "Workflow Execution", "description": "Operations related to executing and managing workflows." },
{ "name": "Files", "description": "File upload and preview operations specific to workflows." },
{ "name": "End Users", "description": "Operations related to end user information." },
{ "name": "Application", "description": "Application settings and info for workflow apps." }
]
}
}