Skip to documentation
Weavers Docs

Pages and endpoints

Tab to navigate · Enter to openEsc to close

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

ParameterLocationType and requirement
notebookKeypathstring · required
Originheaderstring · required

An origin allowed by this deployment.

X-CSRF-Tokenheaderstring · required

Must match the CSRF cookie issued to this browser.

Body · application/json

document required · object
View document model
schema required · "weavers.notebook.v1"
version required · 1
notebookKey required · string
title required · string
cells required · array of object
View cells model

Array items:

id required · string
kind required · "bootstrap" | "code"
language required · "python" | "weavers-bootstrap"
locked required · boolean
strategyRunEnabled optional · false | true
source required · string
status required · "idle" | "running" | "success" | "stale" | "error" | "blocked"
outputs required · array of object
View outputs model

Array items:

id required · string
kind required · "error" | "text" | "json" | "table" | "chart"
text required · string
createdAt required · string
metadata optional · object
View metadata model

Additional fields: JSON value.

createdAt required · string
updatedAt required · string
createdAt required · string
updatedAt required · string
universeSource optional · null | object
View universeSource model
Variant 1: null

null

Variant 2: object
type required · "base"
Variant 3: object
type required · "platform_niche"
nicheId required · number
nicheKey required · string
Variant 4: object
type required · "ticker_pool"
symbols required · array of string
View symbols model

Array items:

string

expectedSavedAt optional · string | null
View 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.

Save as request.json
{
  "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 (POSIX shell)
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.json

Responses

200 · Successful response.

application/json

200 example · synthetic data
{
  "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 · object
View notebook model
schema required · "weavers.notebook.v1"
version required · 1
notebookKey required · string
title required · string
cells required · array of object
View cells model

Array items:

id required · string
kind required · "bootstrap" | "code"
language required · "python" | "weavers-bootstrap"
locked required · boolean
strategyRunEnabled optional · false | true
source required · string
status required · "idle" | "running" | "success" | "stale" | "error" | "blocked"
outputs required · array of object
View outputs model

Array items:

id required · string
kind required · "error" | "text" | "json" | "table" | "chart"
text required · string
createdAt required · string
metadata optional · object
View metadata model

Additional fields: JSON value.

Additional fields: JSON values.

createdAt required · string
updatedAt required · string

Additional fields: JSON values.

createdAt required · string
updatedAt required · string
universeSource optional · null | object
View 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 · number
nicheKey required · string

Additional fields: JSON values.

Variant 4: object
type required · "ticker_pool"
symbols required · array of string
View symbols model

Array items:

string

Additional fields: JSON values.

Additional fields: JSON values.

savedAt required · string

Additional fields: JSON values.

400 · Invalid request.

application/json

400 example · synthetic data
{}
View response model

Error envelopes can include resource-specific details. Check the status before reading these fields.

error optional · string
code optional · string
message optional · string

Additional fields: JSON values.

401 · Authentication is missing or invalid.

application/json

401 example · synthetic data
{}
View response model

Error envelopes can include resource-specific details. Check the status before reading these fields.

error optional · string
code optional · string
message optional · string

Additional fields: JSON values.

403 · Permission, origin or CSRF check failed.

application/json

403 example · synthetic data
{}
View response model

Error envelopes can include resource-specific details. Check the status before reading these fields.

error optional · string
code optional · string
message optional · string

Additional fields: JSON values.

429 · Rate limit reached; honor Retry-After when supplied.

application/json

429 example · synthetic data
{}
View response model

Error envelopes can include resource-specific details. Check the status before reading these fields.

error optional · string
code optional · string
message optional · string

Additional fields: JSON values.

500 · Server failure.

application/json

500 example · synthetic data
{}
View response model

Error envelopes can include resource-specific details. Check the status before reading these fields.

error optional · string
code optional · string
message optional · string

Additional fields: JSON values.

default · Operation-specific error. Inspect error/code before deciding whether to retry.

application/json

default example · synthetic data
{
  "error": "example",
  "code": "example"
}
View response model
error required · string
code required · string

Additional fields: JSON values.