Skip to content

Switch a handler in your own world on or off

POST
/api/v1/handlers/set-enabled
curl --request POST \
--url 'http://localhost:11044/api/v1/handlers/set-enabled?name=example&enabled=true' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'

Adopting a realm-shipped handler that writes. Scoped to the authenticated user’s world; no parameter can name another.

name
required
string

Name of a TypeScript handler in the caller’s world, as name in GET /handlers; an exact match. 404 when the world has no handler of that name

enabled
required
boolean

true adopts the handler so it may fire, which a realm handler that writes needs because it defaults to off; false switches it off. Stored as the caller’s own override, keeping any schedule already recorded for it

Set

Media typeapplication/json

A handler in the caller’s own world switched on or off, echoing the state now in force

object
enabled
required

Whether it is now switched on

boolean
name
required

The handler switched

string
status
required

Always ok

string
Allowed values: ok

Example

{
"status": "ok"
}

No such handler in your world

Media typeapplication/json

A refusal from the cron or handler-adoption surface: the word error and the reason

object
message
required

Why the request was refused, written to be shown. Names the job or handler where the refusal is about one

string
status
required

Always error

string
Allowed values: error

Example

{
"status": "error"
}