Skip to documentation
Weavers Docs

Pages and endpoints

Tab to navigate · Enter to openEsc to close

POST /api/optimisation/retarget-jobs/:jobId/cancel

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.
  • Protected writes require an allowed Origin, the CSRF cookie and matching X-CSRF-Token header.

Request

ParameterLocationType and requirement
jobIdpathstring · required
Originheaderstring · required

An origin allowed by this deployment.

X-CSRF-Tokenheaderstring · required

Must match the CSRF cookie issued to this browser.

No request body.

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.

cURL (POSIX shell)
curl --include \
  --request POST \
  'https://api.weavers.app/api/optimisation/retarget-jobs/1/cancel' \
  --cookie cookies.txt --cookie-jar cookies.txt \
  --header 'Origin: https://weavers.app' \
  --header "X-CSRF-Token: ${CSRF_TOKEN}"

Responses

200 · Successful response.

application/json

200 example · synthetic data
{
  "job": {
    "jobId": "1",
    "mode": "frozen_evaluation",
    "status": "running",
    "source": {
      "runId": "1",
      "artifactId": null,
      "artifactVersion": null,
      "candidateId": null,
      "sourceSymbols": [],
      "sourceStartDate": null,
      "sourceEndDate": null
    },
    "symbols": [],
    "startDate": "2025-01-01",
    "endDate": "2025-06-30",
    "overlap": {
      "sharedSymbols": [],
      "sharesSourceSymbols": false,
      "overlapsSourceDataWindow": false,
      "message": "Explain the data used in this research."
    },
    "result": null,
    "errorCode": null,
    "errorMessage": null,
    "createdAt": "2025-01-01T00:00:00.000Z",
    "updatedAt": "2025-01-01T00:00:00.000Z",
    "startedAt": null,
    "finishedAt": null
  }
}
View response model
job required · object
View job model
jobId required · string
mode required · "frozen_evaluation" | "retrain"
status required · "running" | "failed" | "cancelled" | "queued" | "completed" | "cancelling"
source required · object
View source model
runId required · string
artifactId required · null | number
View artifactId model
Variant 1: null

null

Variant 2: number

number

artifactVersion required · null | string
View artifactVersion model
Variant 1: null

null

Variant 2: string

string

candidateId required · null | string
View candidateId model
Variant 1: null

null

Variant 2: string

string

sourceSymbols required · array of string
View sourceSymbols model

Array items:

string

sourceStartDate required · null | string
View sourceStartDate model
Variant 1: null

null

Variant 2: string

string

sourceEndDate required · null | string
View sourceEndDate model
Variant 1: null

null

Variant 2: string

string

Additional fields: JSON values.

symbols required · array of string
View symbols model

Array items:

string

startDate required · string
endDate required · string
overlap required · object
View overlap model
sharedSymbols required · array of string
View sharedSymbols model

Array items:

string

sharesSourceSymbols required · boolean
overlapsSourceDataWindow required · boolean
message required · string

Additional fields: JSON values.

result required · null | object
View result model
Variant 1: null

null

Variant 2: object
kind required · "frozen_evaluation"
artifactId required · number
artifactVersion required · string
evaluatedSymbols required · array of string
View evaluatedSymbols model

Array items:

string

startDate required · string
endDate required · string
signalCount required · number
tradeCount required · number
totalReturn required · number
sharpe required · number
maxDrawdown required · number
trades required · array of object
View trades model

Array items:

symbol required · string
signalDay required · string
entryDay required · string
exitDay required · string
entryPrice required · number
exitPrice required · number
exitReason required · string
netReturn required · number
netPnl required · number

Additional fields: JSON values.

truncatedTradeCount required · number

Additional fields: JSON values.

Variant 3: object
kind required · "retrain"
runId required · string

Additional fields: JSON values.

errorCode required · null | string
View errorCode model
Variant 1: null

null

Variant 2: string

string

errorMessage required · null | string
View errorMessage model
Variant 1: null

null

Variant 2: string

string

createdAt required · string
updatedAt required · string
startedAt required · null | string
View startedAt model
Variant 1: null

null

Variant 2: string

string

finishedAt required · null | string
View finishedAt model
Variant 1: null

null

Variant 2: string

string

Additional fields: JSON values.

Additional fields: JSON values.

400 · Invalid request.

application/json

400 example · synthetic data
{
  "code": "example",
  "error": "example"
}
View response model
code required · string
error required · 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.

404 · Resource or enabled capability not found.

application/json

404 example · synthetic data
{
  "code": "example",
  "error": "example"
}
View response model
code required · string
error required · 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
{
  "code": "example",
  "error": "example"
}
View response model
code required · string
error required · string

Additional fields: JSON values.

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

application/json

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

Additional fields: JSON values.