Upload a file
Changed onThis endpoint will upload a file to the index and return a resource_id. The file will be processed in the background and the memory will be available for querying once the processing is complete. You can use the resource_id to query the memory later, and check the status of the memory.
Supported formats are PDF, Word (.docx, .doc), OpenDocument text, RTF, plain text and Markdown, and spreadsheets as CSV, TSV, or Excel workbooks (.xlsx, .xlsm). Each row of a large spreadsheet is indexed with its column headers.
The examples upload a local notes.txt file for a specific user. Set these environment variables before running them:
- HYPERSPELL_API_URL: your API base URL, without a trailing slash. Use https://api.hyperspell.com for US apps or https://api.eu.hyperspell.com for EU apps. For a dedicated instance, use its API URL.
- HYPERSPELL_API_KEY: your API key.
- HYPERSPELL_USER_ID: the user who should own the uploaded memory.
The X-As-User header selects the user when using an app-wide key. With a user-scoped key, omit this header or set it to that key's user ID.
Request
- Base URLhttps://api.hyperspell.com
- URLhttps://api.hyperspell.com/memories/upload
- AuthHTTP bearer
Headers
Optionally set this header to act as a specific user when using an API Key, equivalent to first exchanging the API Key for a User Token
Request body multipart/form-data
Response
Successful Response
Changes
- info
added the new optional request property
- info
- warning
added the new
gongenum value to theresponse property for the response status
- warning