Update the status of a machine instance
Set the status of the machine.
Machines in the 'paused' status will reject any events sent to them with a 409 error with a code of "invalid-state".
'running' instances will accept events normally.
It is dangerous to set an instance's status to 'paused'! You will drop events and, because delayed events are only retried 5 times (with ~30 seconds between each try), some delayed events may be dropped and never sent to your machine.
This exists purely to stop a runaway machine instance that is stuck in a loop of creating too many events.
This endpoint requires admin access.
Path parameters
-
The slug/name for the machine definition.
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
. -
The slug/name for the machine instance.
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
.
curl \
-X PUT https://api.statebacked.dev/machines/my-machine/i/user-1234/status \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"status":"running"}'
{
"status": "running"
}
{
"status": "running"
}
{
"error": "string",
"code": "specify-org",
"parameter": "string"
}
{
"error": "string",
"code": "specify-org",
"parameter": "string"
}
{
"error": "string",
"code": "missing-scope"
}
{
"error": "string",
"code": "missing-scope"
}
{
"code": "invalid-state",
"error": "string"
}
{
"code": "invalid-state",
"error": "string"
}