PUT /api/eureka/notebooks/:notebookKey
Account required · HTTP API reference
All endpoints · Authentication and retries · Download OpenAPI
- Requires a signed-in account and permission to access this resource. Use identifiers returned by your own account's earlier requests.
- Read the notebook first and preserve its schema, version and cell identifiers. Send the returned savedAt as expectedSavedAt when replacing a saved document; a stale value returns 409. The document's notebookKey must match the path.
- Protected writes require an allowed Origin, the CSRF cookie and matching X-CSRF-Token header.
Request
| Parameter | Location | Type and requirement |
|---|---|---|
notebookKey | path | string · required |
Origin | header | string · required An origin allowed by this deployment. |
X-CSRF-Token | header | string · required Must match the CSRF cookie issued to this browser. |
Body · application/json
document required · objectView document model
schema required · "weavers.notebook.v1"version required · 1notebookKey required · stringtitle required · stringcells required · array of objectView cells model
Array items:
id required · stringkind required · "bootstrap" | "code"language required · "python" | "weavers-bootstrap"locked required · booleanstrategyRunEnabled optional · false | truesource required · stringstatus required · "idle" | "running" | "success" | "stale" | "error" | "blocked"outputs required · array of objectView outputs model
Array items:
id required · stringkind required · "error" | "text" | "json" | "table" | "chart"text required · stringcreatedAt required · stringmetadata optional · objectView metadata model
Additional fields: JSON value.
createdAt required · stringupdatedAt required · stringcreatedAt required · stringupdatedAt required · stringuniverseSource optional · null | objectView universeSource model
Variant 1: null
null
Variant 2: object
type required · "base"Variant 3: object
type required · "platform_niche"nicheId required · numbernicheKey required · stringVariant 4: object
type required · "ticker_pool"symbols required · array of stringView symbols model
Array items:
string
expectedSavedAt optional · string | nullView expectedSavedAt model
Variant 1: string
string
Variant 2: null
null
Example
Examples use fictional data. Replace identifiers with resources you can access. For account requests, cookies.txt must contain your own session; set CSRF_TOKEN to the matching CSRF cookie value where required.
{
"document": {
"schema": "weavers.notebook.v1",
"version": 1,
"notebookKey": "strategy-11111111-1111-4111-8111-111111111111",
"title": "Strategy 11111111 1111 4111 8111 111111111111",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"universeSource": null,
"cells": [
{
"id": "bootstrap",
"kind": "bootstrap",
"language": "weavers-bootstrap",
"locked": true,
"source": "# Weavers dataset bootstrap\n# Web: prepares workspace context; return to Build to inspect historical coverage.\n# Desktop: also scans local runtime, cache folders, and worker capacity.\nweavers.load_dataset_context()",
"status": "idle",
"outputs": [],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
},
{
"id": "cell-1",
"kind": "code",
"language": "python",
"locked": true,
"strategyRunEnabled": true,
"source": "# Weavers validation bridge\n# Locked entrypoint: keep strategy logic in editable helper cells.\n# Define build_signals(candles, context=None, **kwargs) and/or\n# build_policy(context=None, **kwargs) in helper cells.\ndef weavers_strategy(candles=None, context=None, **kwargs):\n context = context or {}\n rows = candles\n if rows is None:\n rows = (\n kwargs.get('rows')\n or kwargs.get('data')\n or kwargs.get('market_data')\n )\n\n result = {}\n if 'build_signals' in globals():\n signal_result = build_signals(rows, context=context, **kwargs)\n if isinstance(signal_result, dict) and any(\n key in signal_result\n for key in (\n 'signals',\n 'signal_search',\n 'signalSearch',\n 'predictor_search',\n 'predictorSearch',\n )\n ):\n result.update(signal_result)\n else:\n result['signals'] = signal_result\n if 'build_policy' in globals():\n policy_result = build_policy(context=context, **kwargs)\n if isinstance(policy_result, dict) and any(\n key in policy_result\n for key in (\n 'execution_policy',\n 'executionPolicy',\n 'policy',\n 'execution',\n )\n ):\n result.update(policy_result)\n else:\n result['execution_policy'] = policy_result\n return result",
"status": "idle",
"outputs": [],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
},
{
"id": "cell-2",
"kind": "code",
"language": "python",
"locked": false,
"strategyRunEnabled": true,
"source": "# Helper cell\n# Define build_signals(candles, context=None, **kwargs)\n# and/or build_policy(context=None, **kwargs) here.\n# The locked Strategy Entry Point cell calls these helpers during validation.",
"status": "idle",
"outputs": [],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
},
{
"id": "example-cell",
"kind": "code",
"language": "python",
"locked": false,
"strategyRunEnabled": true,
"source": "print('Research example')\n",
"status": "idle",
"outputs": [],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
}
]
},
"expectedSavedAt": null
}curl --include \
--request PUT \
'https://api.weavers.app/api/eureka/notebooks/strategy-11111111-1111-4111-8111-111111111111' \
--cookie cookies.txt --cookie-jar cookies.txt \
--header 'Origin: https://weavers.app' \
--header "X-CSRF-Token: ${CSRF_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @request.jsonResponses
200 · Successful response.
application/json
{
"notebook": {
"schema": "weavers.notebook.v1",
"version": 1,
"notebookKey": "strategy-11111111-1111-4111-8111-111111111111",
"title": "Example research",
"cells": [],
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z"
},
"savedAt": "2025-01-01T00:00:00.000Z"
}View response model
notebook required · objectView notebook model
schema required · "weavers.notebook.v1"version required · 1notebookKey required · stringtitle required · stringcells required · array of objectView cells model
Array items:
id required · stringkind required · "bootstrap" | "code"language required · "python" | "weavers-bootstrap"locked required · booleanstrategyRunEnabled optional · false | truesource required · stringstatus required · "idle" | "running" | "success" | "stale" | "error" | "blocked"outputs required · array of objectView outputs model
Array items:
id required · stringkind required · "error" | "text" | "json" | "table" | "chart"text required · stringcreatedAt required · stringmetadata optional · objectView metadata model
Additional fields: JSON value.
Additional fields: JSON values.
createdAt required · stringupdatedAt required · stringAdditional fields: JSON values.
createdAt required · stringupdatedAt required · stringuniverseSource optional · null | objectView universeSource model
Variant 1: null
null
Variant 2: object
type required · "base"Additional fields: JSON values.
Variant 3: object
type required · "platform_niche"nicheId required · numbernicheKey required · stringAdditional fields: JSON values.
Variant 4: object
type required · "ticker_pool"symbols required · array of stringView symbols model
Array items:
string
Additional fields: JSON values.
Additional fields: JSON values.
savedAt required · stringAdditional fields: JSON values.
400 · Invalid request.
application/json
{}View response model
Error envelopes can include resource-specific details. Check the status before reading these fields.
error optional · stringcode optional · stringmessage optional · stringAdditional fields: JSON values.
401 · Authentication is missing or invalid.
application/json
{}View response model
Error envelopes can include resource-specific details. Check the status before reading these fields.
error optional · stringcode optional · stringmessage optional · stringAdditional fields: JSON values.
403 · Permission, origin or CSRF check failed.
application/json
{}View response model
Error envelopes can include resource-specific details. Check the status before reading these fields.
error optional · stringcode optional · stringmessage optional · stringAdditional fields: JSON values.
429 · Rate limit reached; honor Retry-After when supplied.
application/json
{}View response model
Error envelopes can include resource-specific details. Check the status before reading these fields.
error optional · stringcode optional · stringmessage optional · stringAdditional fields: JSON values.
500 · Server failure.
application/json
{}View response model
Error envelopes can include resource-specific details. Check the status before reading these fields.
error optional · stringcode optional · stringmessage optional · stringAdditional fields: JSON values.
default · Operation-specific error. Inspect error/code before deciding whether to retry.
application/json
{
"error": "example",
"code": "example"
}View response model
error required · stringcode required · stringAdditional fields: JSON values.