Skip to content

Replan a goal view over the world's current steps and pin the compiled statement

POST
/api/v1/admin/kg/views/{name}/replan
curl --request POST \
--url http://localhost:11044/api/v1/admin/kg/views/example/replan \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'
name
required
string

The goal view’s name, as GET /views lists it.

username
string

Optional, and never needed: the call always acts as the signed-in principal. Naming the principal changes nothing; naming anyone else is refused with 403.

The goal was planned and its compiled statement pinned; savedCypher is that statement

Media typeapplication/json

A view was saved.

object
name
required

The name the view was saved under — the requested name, trimmed.

string
note

Why the stored query differs from the one sent

string
ok
required

Always true; a refusal answers 400 with a different body.

boolean
savedCypher

The stored query, when promotion inlined captured scopes into it

string

Example generated

{
"name": "example",
"note": "example",
"ok": true,
"savedCypher": "example"
}

Not a goal view, an unknown view, or a goal that no longer plans — unreachable, a tie, or refused

Media typeapplication/json

A view was refused: a bad name, an unrunnable body, or a name already taken.

object
error

Why the view was refused. Always present.

string
name

The requested name, trimmed. Absent when the declaration itself was malformed — a reserved or uncoercible param, say — and refused before a save was attempted.

string
ok
required

Always false.

boolean
violations

Preflight defects when the body names shapes the schema contradicts.

Array<string>

Example generated

{
"error": "example",
"name": "example",
"ok": true,
"violations": [
"example"
]
}

No authenticated principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}

username names someone other than the signed-in principal

Media typeapplication/json

A refusal carrying only a human-readable reason.

object
error
required

What went wrong, in the terms the caller can act on.

string

Example generated

{
"error": "example"
}