Liveblocks icon

Liveblocks

Call the Liveblocks REST API (rooms, comments, feeds, Yjs, AI, and more)

AI Knowledge → Create File Source

AI-generated

Summary

Upload a file as a knowledge source to an AI copilot by sending raw binary data with a specified file name.

Inputs

  • copilotId (required) — Identifier of the AI copilot to which the file knowledge source will be added.
  • Knowledge File Name (required) — File name segment used in the URL path for uploading the file (e.g. document.pdf).
  • Input Binary Field (required) — Name of the input binary property on the incoming item that contains the file data to upload as application/octet-stream.
  • Include Request in Error — Whether to include detailed request information in error messages for debugging failed API calls.

Output shape

a single API response object representing the created file knowledge source

Returns the created knowledge source data from the Liveblocks API. Errors may include optional request debug details if configured. Input binary data is required and taken from the specified binary property.

Examples

Example 1: Upload a PDF file as a knowledge source for an existing AI copilot

Set the 'Copilot ID' to the target copilot's ID, 'Knowledge File Name' to the file name with extension (e.g., report.pdf), and 'Input Binary Field' to the binary data field name containing the PDF data.

Links

Discussion