POST /api/eureka/notebooks/:notebookKey/assistant/messages
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.
- 202 queues assistant work. Poll the requestId under this same notebook; receiving a request identifier does not mean an answer is ready.
- 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 |
x-idempotency-key | header | string · required Pattern: |
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
runId optional · string | nullView runId model
Variant 1: string
string
Variant 2: null
null
threadId optional · string | nullView threadId model
Variant 1: string
string
Variant 2: null
null
message required · stringminLength: 1. maxLength: 8000
selectedCellId optional · string | nullView selectedCellId model
Variant 1: string
string
Variant 2: null
null
includeDiagnostics optional · booleandiagnostics optional · array of stringmaxItems: 80
View diagnostics model
Array items:
string
strategyContextLines optional · array of stringmaxItems: 80
View strategyContextLines model
Array items:
string
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.
{
"message": "Explain this notebook's data inputs.",
"includeDiagnostics": false
}curl --include \
--request POST \
'https://api.weavers.app/api/eureka/notebooks/strategy-11111111-1111-4111-8111-111111111111/assistant/messages' \
--cookie cookies.txt --cookie-jar cookies.txt \
--header 'x-idempotency-key: example-request-0001' \
--header 'Origin: https://weavers.app' \
--header "X-CSRF-Token: ${CSRF_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @request.jsonResponses
202 · Work accepted. Poll the returned job or request identifier.
application/json
{
"conversationId": "1",
"scopeKey": "example",
"messages": [],
"request": {
"requestId": "1",
"status": "running",
"errorCode": null,
"errorMessage": null,
"createdAt": "2025-01-01T00:00:00.000Z",
"startedAt": null,
"finishedAt": null,
"updatedAt": "2025-01-01T00:00:00.000Z"
},
"assistant": null,
"provider": null,
"authType": null,
"modelId": null
}View response model
conversationId required · stringscopeKey required · stringmessages required · array of objectView messages model
Array items:
id required · stringrole required · "user" | "assistant"content required · stringcreatedAt required · stringAdditional fields: JSON values.
request required · objectView request model
requestId required · stringstatus required · "running" | "accepted" | "succeeded" | "failed" | "queued"errorCode required · null | stringView errorCode model
Variant 1: null
null
Variant 2: string
string
errorMessage required · null | stringView errorMessage model
Variant 1: null
null
Variant 2: string
string
createdAt required · stringstartedAt required · null | stringView startedAt model
Variant 1: null
null
Variant 2: string
string
finishedAt required · null | stringView finishedAt model
Variant 1: null
null
Variant 2: string
string
updatedAt required · stringAdditional fields: JSON values.
assistant required · null | objectView assistant model
Variant 1: null
null
Variant 2: object
schema required · "weavers.notebook.codex_assistant.v1"version required · 1message required · stringedits required · array of objectView edits model
Array items:
Variant 1: object
operation required · "replace_cell_source"cellId required · stringsource required · stringreason optional · stringAdditional fields: JSON values.
Variant 2: object
operation required · "create_cell"cellId optional · stringafterCellId optional · null | stringView afterCellId model
Variant 1: null
null
Variant 2: string
string
source required · stringreason optional · stringAdditional fields: JSON values.
Variant 3: object
operation required · "delete_cell"cellId required · stringreason optional · stringAdditional fields: JSON values.
Variant 4: object
operation required · "move_cell"cellId required · stringafterCellId optional · null | stringView afterCellId model
Variant 1: null
null
Variant 2: string
string
reason optional · stringAdditional fields: JSON values.
warnings required · array of stringView warnings model
Array items:
string
Additional fields: JSON values.
provider required · null | "codex"View provider model
Variant 1: null
null
Variant 2: "codex"
"codex"
authType required · null | "oauth" | "codex_access_token"View authType model
Variant 1: null
null
Variant 2: "oauth"
"oauth"
Variant 3: "codex_access_token"
"codex_access_token"
modelId required · null | stringView modelId model
Variant 1: null
null
Variant 2: string
string
Additional fields: JSON values.
400 · Invalid request.
application/json
{
"error": "example",
"code": "example"
}View response model
error required · stringcode required · 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.