Create a named scope (a world-tier focus) asks can be narrowed to
const url = 'http://localhost:11044/api/v1/admin/kg/ask/scopes';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"description":"example","name":"example","realms":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/admin/kg/ask/scopes \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "description": "example", "name": "example", "realms": [ "example" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”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.
Request Bodyrequired
Section titled “Request Bodyrequired”The scope to declare: name, a slug matching [a-z0-9][a-z0-9-]* (otherwise a 400; a name already declared is a 409), an optional description, and realms, at least one and every one installed or a 400 naming the unknown ones. Written as a world-tier focus and the world refreshed, so scope=<name> is accepted at once
A named scope to declare: a world-tier focus the ask surface can be narrowed to.
object
A line on what the scope is for, written into the focus declaration. Defaults to empty.
Slug, [a-z0-9][a-z0-9-]* — the value scope= will accept. No +: unencoded it decodes to a space in a query parameter.
Installed realm names whose schema the scope’s asks see.
Example generated
{ "description": "example", "name": "example", "realms": [ "example" ]}Responses
Section titled “Responses”The scope as declared; scope=<name> accepts it immediately
A named scope: a declared realm set an ask can be narrowed to via scope=.
object
What the scope is for, as its focus declares it. Empty when the declaration gives none.
The scope’s name — the value scope= accepts.
The realm names whose schema the scoped ask sees (plus the always-on core).
Example generated
{ "description": "example", "name": "example", "realms": [ "example" ]}Bad name grammar, no realms, or realms not installed
The scope named realms that are not installed; the installed ones travel with the refusal.
object
Names the realms that are not installed.
The realm names actually installed in this world.
The requested realm names no installed realm answers to.
Example generated
{ "error": "example", "installed": [ "example" ], "unknown": [ "example" ]}No authenticated principal
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}username names someone other than the signed-in principal
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}A scope with that name already exists
A refusal carrying only a human-readable reason.
object
What went wrong, in the terms the caller can act on.
Example generated
{ "error": "example"}
