Invoke a named view
const url = 'http://localhost:11044/api/v1/views/example/invoke';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"args":{"additionalProperty":"example"},"idempotencyKey":"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/views/example/invoke \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "args": { "additionalProperty": "example" }, "idempotencyKey": "example" }'Run an authored Virtual-Cypher view by name and return a redacted, typed result envelope. The runnable query is never exposed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The authored view name
Request Body
Section titled “Request Body”The view’s arguments under args, keyed by its declared parameter names; an argument that is missing or does not fit the view’s parameters is refused with 400. Omitting the body, or args, runs the view on its defaults. Any top-level field other than args and idempotencyKey is refused with 400 rather than ignored; idempotencyKey is accepted but does not deduplicate invocations here
The body of POST /lenses/{lensId}/invoke and POST /views/{name}/invoke: arguments and an optional idempotency key. Any other top-level field is refused with 400.
object
Arguments by the lens’s or view’s declared parameter name. A name it does not declare, or a required parameter left out, is refused with 400; an optional one left out takes its declared default
object
Accepted but not yet acted on: a repeated call with the same key runs again
Example generated
{ "args": { "additionalProperty": "example" }, "idempotencyKey": "example"}Responses
Section titled “Responses”Arguments do not match the view’s declared parameters, or the body has a field other than args/idempotencyKey; a body that will not parse answers an ApiError
A request-level refusal from the headless surface. Carries only the reason; an execution that ran and failed answers 200 with the outcome in its envelope instead
object
Why the request was refused, written to be shown: the unknown lens, view or run, the argument at fault, or the field the body should not have
A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly
object
Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own
Extra context where there is some, such as the fields a body may carry; null otherwise
A plain-language explanation, written to be shown. Never carries an exception message
The body the servlet error dispatch answers for a status raised by an exception rather than written by the endpoint. Every failure except 404, which answers the not-found HTML page
object
The status’s standard reason phrase, such as Bad Request or Forbidden
The request path that failed
The HTTP status code, repeated from the status line
Example generated
{ "error": "example"}Not authenticated. The filter chain answers an ApiError; a principal that resolves to no user answers the refusal
A request-level refusal from the headless surface. Carries only the reason; an execution that ran and failed answers 200 with the outcome in its envelope instead
object
Why the request was refused, written to be shown: the unknown lens, view or run, the argument at fault, or the field the body should not have
A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly
object
Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own
Extra context where there is some, such as the fields a body may carry; null otherwise
A plain-language explanation, written to be shown. Never carries an exception message
The body the servlet error dispatch answers for a status raised by an exception rather than written by the endpoint. Every failure except 404, which answers the not-found HTML page
object
The status’s standard reason phrase, such as Bad Request or Forbidden
The request path that failed
The HTTP status code, repeated from the status line
Example generated
{ "error": "example"}No such view
A request-level refusal from the headless surface. Carries only the reason; an execution that ran and failed answers 200 with the outcome in its envelope instead
object
Why the request was refused, written to be shown: the unknown lens, view or run, the argument at fault, or the field the body should not have
Example generated
{ "error": "example"}
