Create or replace a tenant configuration entry by type
POST/tenant-configurations/by-configuration-type/:configurationTypeId
Creates or replaces (upserts) the configuration record for the given configurationTypeId and the tenant identified by the required tenant-id header.
Currently accepted type: only tenant-timezone-config is supported. Any other configurationTypeId value returns 400.
Request body — a JSON object with a single required field: timezone (string) must be a valid IANA time-zone identifier (e.g. "America/New_York"). An unrecognized zone ID returns 400.
Behavior: if no record exists for this tenant and type it is created; if one already exists it is fully replaced. Calling this endpoint twice with the same timezone value is safe and produces the same result (idempotent with respect to state).
Response — on success returns a flat TenantTimezoneResponse with fields tenantId, configurationTypeId, timezone, and timezoneAbbreviation. This shape differs from the TenantConfigurationItemDto envelope returned by the GET endpoints on this tag.
400 causes (three distinct triggers): (a) missing tenant-id header; (b) unsupported configurationTypeId; (c) missing or invalid timezone in the request body.
Side effects: persists the record to the data store. There is no automatic retry on write failures; a 500 indicates a persistent data-store error — consider a manual retry after a delay. The write is served by a different path than the cached GET-by-type read, so a successful write may not be immediately reflected by that read.
Request
Responses
- 200
- 400
- 401
- 500
- 502
- 503
The persisted timezone configuration as a flat TenantTimezoneResponse, including the resolved timezone abbreviation for the current date.
Request rejected for one of: missing tenant-id header (returns the nested ApiError shape via the header-validation filter); unsupported configurationTypeId; or a missing or invalid timezone in the body (the latter two are raised directly by this endpoint and return the flat BadRequestErrorResponse shape — a list of error strings, not the structured ApiError object). Correct the offending value and retry.
Authentication token is missing, expired, or invalid. Obtain a valid JWT and retry.
An unexpected error prevented the write; the configuration was not saved. The response body is a bare {"error": "..."} object, not the structured ApiError shape used elsewhere in this API. No automatic retry is performed — retry manually after a short delay and escalate if it persists.
The downstream data store (DAL) returned a server error (5xx) while persisting the configuration; the write was not saved. Retry after a short delay and escalate if it persists.
Unable to connect to the downstream data store (network/connectivity failure); the write was not saved. Retry after a short delay.