Sync the browser's IANA timezone for the authenticated user
const url = 'http://localhost:11044/api/v1/context/timezone';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"zone":"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/context/timezone \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "zone": "example" }'Validates the timezone against ZoneId; rejects invalid zones. Returns 204 whether or not the value changed.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”zone: the browser’s IANA time zone id (e.g. Europe/London, as Intl.DateTimeFormat().resolvedOptions().timeZone reports it); anything java.time.ZoneId parses is accepted, fixed offsets such as +02:00 included. A new zone is saved on the user and the world’s time zone refreshed. A blank or unparseable zone is ignored and still answers 204, leaving the stored value as it was
The browser’s time zone, pushed by POST /context/timezone to keep the signed-in user’s stored time zone in step with it
object
Time zone id as the browser reports it, normally IANA such as Europe/London. Blank, or not an id java.time.ZoneId accepts, it is ignored and the stored zone is left as it was
Example generated
{ "zone": "example"}Responses
Section titled “Responses”No Content

