List related files
Interface Description
Read a paginated list of files related to the selected file, with paths for opening their content.
Endpoint
| Field | Value |
|---|---|
| Method | GET |
| Path | /openapi/v2/knowledge-bases/{knowledgeBaseId}/files/{fileId}/related |
| Operation ID | listRelatedFiles |
| Authentication | Bearer OpenAPI key |
Parameters
| Name | Location | Required | Type | Example | Description |
|---|---|---|---|---|---|
knowledgeBaseId | path | Yes | string | knowledge-base-11111111-1111-4111-8111-111111111111 | Knowledge-base identifier returned by knowledge-base APIs. |
fileId | path | Yes | string | source-file-11111111-1111-4111-8111-111111111111 | Readable file identifier returned by tree, search, related-file, or file APIs. |
limit | query | No | integer | 50 | Maximum number of records to return. The deployment can enforce a lower limit. |
cursor | query | No | string | cursor_123 | Pagination token returned by the same endpoint for reading the next page. |
Request Body
This operation has no request body.
Request Example
bash
curl -X GET "https://openapi.example.com/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-11111111-1111-4111-8111-111111111111/related?limit=50" \
-H "Authorization: Bearer <openapi-key>"Successful Responses
200
Requested page of files related to the selected readable file.
| Field | Required | Type | Description |
|---|---|---|---|
activeContentRevision | Yes | integer | Current readable knowledge-base content revision. |
fileId | Yes | string | Requested file identifier. |
sourceFileId | Yes | string | Uploaded-file identifier associated with the requested readable file. |
items | Yes | array<RelatedFile> | Records returned on this page. |
nextCursor | Yes | string | null | Pagination token returned by this endpoint for reading the next page with the same file and filters. |
message | No | string | null | Status and suggested next step when no related files are available. |
nextActions | No | array<string> | Suggested follow-up reads for continued file exploration. |
Success Response Example
json
{
"activeContentRevision": 1,
"fileId": "source-file-11111111-1111-4111-8111-111111111111",
"sourceFileId": "source-file-11111111-1111-4111-8111-111111111111",
"items": [
{
"activeContentRevision": 1,
"fileId": "source-file-22222222-2222-4222-8222-222222222222",
"sourceFileId": "source-file-22222222-2222-4222-8222-222222222222",
"path": "pages/reference.md",
"title": "Reference",
"relationType": "same_specific_subject",
"direction": "outgoing",
"fromFileId": "source-file-11111111-1111-4111-8111-111111111111",
"relationshipDepth": 1,
"reason": "Both files share body-derived subjects.",
"contentAvailable": true,
"readActions": {
"fileDetailById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-22222222-2222-4222-8222-222222222222",
"fileContentById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-22222222-2222-4222-8222-222222222222/content",
"fileContentByPath": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/content?path=pages%2Freference.md",
"relatedFilesById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-22222222-2222-4222-8222-222222222222/related",
"graphExpansionByFileId": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/graph/expand?fileId=source-file-22222222-2222-4222-8222-222222222222",
"sourceFileStatusById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-files/source-file-22222222-2222-4222-8222-222222222222"
}
}
],
"nextCursor": null
}Error Codes
The table below lists every error response documented for this operation.
| HTTP Status | Error Code | Explanation |
|---|---|---|
| 401 | UNAUTHORIZED | The Bearer API key is missing, malformed, unknown, revoked, or deleted. |
| 404 | NOT_FOUND | The requested resource was not found. |
| 409 | CONFLICT | The request conflicts with the resource's current state. |
| 422 | VALIDATION_ERROR | The request failed validation. |
| 429 | RATE_LIMITED | The request exceeded the configured rate limits. |
| 500 | INTERNAL_ERROR | The API encountered an internal error. |
| 503 | DATABASE_REPOSITORY_UNAVAILABLE | The data required by this operation is temporarily unavailable. |