Create session
create_sessionOpen an Excel workbook in a session for reading, editing, recalculating, and exporting by path, base64, URL, Library file, or blank start.
Instructions
Open a workbook in a session that the other workbook tools then use by session_id: the starting point for reading, editing, recalculating and exporting a model. Pass at most one of path, base64 (raw .xlsx bytes) or url, or none for a blank workbook (the only kind add_sheet can extend). The workbook is recalculated on load, including formulas written by other tools without cached values, so opening a file you edited elsewhere is how you read back what its formulas compute (get_outputs, get_formula_range); change inputs with set_inputs. Returns {session_id, document_id, library_file_id, sheets: [{index, name}], defined_names, calc}. For a one-off recalculation of a file, use recalc_workbook instead; to try a formula without a file, use evaluate_formula. The workbook is uploaded to the Basis API and held there for the session. Pass library_file_id instead to open a file from your Library. Each API key can hold 5 open sessions, and a session closes on its own after 30 minutes without a call. A sixth create_session fails with max_sessions and lists the open sessions; close one first. save_to_library keeps the workbook beyond the session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public https URL to fetch the .xlsx file from (private and local addresses are refused) | |
| calc | No | Iterative-calculation settings for circular models | |
| path | No | Local filesystem path to an .xlsx file | |
| base64 | No | Base64-encoded .xlsx file bytes | |
| document_id | No | Display label for this session | |
| library_file_id | No | ID of a Library file to open (library_file_id from save_to_library or an earlier session) |