Skip to content

Create a named scope (a world-tier focus) asks can be narrowed to

POST
/api/v1/admin/kg/ask/scopes
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" ] }'
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 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

Media typeapplication/json

A named scope to declare: a world-tier focus the ask surface can be narrowed to.

object
description
required

A line on what the scope is for, written into the focus declaration. Defaults to empty.

string
name
required

Slug, [a-z0-9][a-z0-9-]* — the value scope= will accept. No +: unencoded it decodes to a space in a query parameter.

string
realms
required

Installed realm names whose schema the scope’s asks see.

Array<string>

Example generated

{
"description": "example",
"name": "example",
"realms": [
"example"
]
}

The scope as declared; scope=<name> accepts it immediately

Media typeapplication/json

A named scope: a declared realm set an ask can be narrowed to via scope=.

object
description
required

What the scope is for, as its focus declares it. Empty when the declaration gives none.

string
name
required

The scope’s name — the value scope= accepts.

string
realms
required

The realm names whose schema the scoped ask sees (plus the always-on core).

Array<string>

Example generated

{
"description": "example",
"name": "example",
"realms": [
"example"
]
}

Bad name grammar, no realms, or realms not installed

Media typeapplication/json

The scope named realms that are not installed; the installed ones travel with the refusal.

object
error
required

Names the realms that are not installed.

string
installed
required

The realm names actually installed in this world.

Array<string>
unknown
required

The requested realm names no installed realm answers to.

Array<string>

Example generated

{
"error": "example",
"installed": [
"example"
],
"unknown": [
"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"
}

A scope with that name already exists

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"
}