Skip to content

Get file ​

Interface Description ​

Read the metadata and available read links for one readable file by fileId.

Endpoint ​

FieldValue
MethodGET
Path/openapi/v2/knowledge-bases/{knowledgeBaseId}/files/{fileId}
Operation IDgetFileById
AuthenticationBearer OpenAPI key

Parameters ​

NameLocationRequiredTypeExampleDescription
knowledgeBaseIdpathYesstringknowledge-base-11111111-1111-4111-8111-111111111111Knowledge-base identifier returned by knowledge-base APIs.
fileIdpathYesstringsource-file-11111111-1111-4111-8111-111111111111Readable file identifier returned by tree, search, related-file, or file APIs.

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" \
  -H "Authorization: Bearer <openapi-key>"

Successful Responses ​

200 ​

Requested readable file metadata and links for reading or exploring it.

FieldRequiredTypeDescription
fileYesobjectReadable file metadata returned by the request.

Success Response Example ​

json
{
  "file": {
    "activeContentRevision": 1,
    "fileId": "source-file-11111111-1111-4111-8111-111111111111",
    "knowledgeBaseId": "knowledge-base-11111111-1111-4111-8111-111111111111",
    "sourceFileId": "source-file-11111111-1111-4111-8111-111111111111",
    "path": "pages/guide.md",
    "fileKind": "page",
    "contentType": "text/markdown; charset=utf-8",
    "sizeBytes": 2048,
    "okfType": "Guide",
    "title": "Verified guide",
    "description": null,
    "tags": [
      "guide",
      "policy"
    ],
    "frontmatter": {
      "okf_version": "0.2",
      "type": "Guide",
      "title": "Verified guide",
      "tags": [
        "guide",
        "policy"
      ],
      "sources": [
        {
          "id": "source-a",
          "resource": "references/source-a.md"
        }
      ],
      "generated": {
        "by": "publisher:example",
        "at": "2026-06-17T00:00:00Z"
      },
      "verified": [
        {
          "by": "human:reviewer",
          "at": "2026-06-17T01:00:00Z"
        }
      ],
      "status": "stable",
      "stale_after": "2026-12-31"
    },
    "okfSignals": {
      "effectiveStatus": "stable",
      "trustTier": "human-reviewed",
      "isStale": false,
      "staleAfter": "2026-12-31",
      "generatedAt": "2026-06-17T00:00:00.000Z",
      "generatedAtSource": "generated",
      "latestVerifiedAt": "2026-06-17T01:00:00.000Z",
      "sourceCount": 1
    },
    "deletable": true,
    "contentAvailable": true,
    "readActions": {
      "fileDetailById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-11111111-1111-4111-8111-111111111111",
      "fileContentById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-11111111-1111-4111-8111-111111111111/content",
      "fileContentByPath": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/content?path=pages%2Fguide.md",
      "relatedFilesById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/files/source-file-11111111-1111-4111-8111-111111111111/related",
      "graphExpansionByFileId": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/graph/expand?fileId=source-file-11111111-1111-4111-8111-111111111111",
      "sourceFileStatusById": "/openapi/v2/knowledge-bases/knowledge-base-11111111-1111-4111-8111-111111111111/source-files/source-file-11111111-1111-4111-8111-111111111111"
    }
  }
}

Error Codes ​

The table below lists every error response documented for this operation.

HTTP StatusError CodeExplanation
401UNAUTHORIZEDThe Bearer API key is missing, malformed, unknown, revoked, or deleted.
404NOT_FOUNDThe requested resource was not found.
429RATE_LIMITEDThe request exceeded the configured rate limits.
500INTERNAL_ERRORThe API encountered an internal error.
503DATABASE_REPOSITORY_UNAVAILABLEThe data required by this operation is temporarily unavailable.

Next Steps ​