Skip to content

Switch this user's active context, creating a new one if the name hasn't been used before

PUT
/api/v1/context/current
curl --request PUT \
--url http://localhost:11044/api/v1/context/current \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "name": "example" }'

The context to switch to in name, trimmed and matched exactly. A name not used before starts a new, empty context; a blank one is a 400

Media typeapplication/json

The context to switch to, the body of PUT /context/current

object
name
required

Context name, trimmed. Must not be blank; a name not used before starts a new, empty context

string

Example generated

{
"name": "example"
}

The name is blank. An unused name is accepted and starts an empty context, but a blank one names nothing

Media type*/*

A refusal from the account surface. Carries only the reason; the status code is the only other fact and the body does not repeat it

object
error
required

Why the request was refused, written to be shown

string