Time Periods API
POST/api/v1/time-period-settings
Product availabilityAlgaPSA

Create time period settings

Creates an active time period setting. When effective_from is omitted it defaults to the start of the period containing today in the caller's timezone; if an earlier setting ended on or after that day, the new setting starts the day after it ended (the default may then be in the future). An explicit effective_from is used as given. Returns 409 when the setting overlaps an active setting.

RBAC · time_period

Request body

Content type: application/json · schema WorkV1TimePeriodSettingsCreateBody

frequencyintegerRequired
Number of frequency_unit units per period (e.g. 1 with week = weekly).
frequency_unitstringRequired
Enum: dayweekmonthyear
start_dayinteger
week: first weekday (1=Monday … 7=Sunday); month: first day of the month. Defaults to 1.
≥ 1 · ≤ 31
end_dayinteger
month: last day of the period, or 0 for the end of the month. Defaults to 0.
≥ 0 · ≤ 31
start_monthinteger
year: first month. Defaults to 1.
≥ 1 · ≤ 12
start_day_of_monthinteger
year: first day of start_month. Defaults to 1.
≥ 1 · ≤ 31
end_monthinteger
year: last month. Defaults to 12.
≥ 1 · ≤ 12
end_day_of_monthinteger
year: last day of end_month, or 0 for the end of the month. Defaults to 0.
≥ 0 · ≤ 31
effective_fromstring
First day the setting is in force. When omitted, defaults to the start of the period containing today in the caller's timezone; if an earlier setting ended on or after that day, it starts the day after that setting ended.
pattern /^\d{4}-\d{2}-\d{2}$/
effective_tostring
Last day the setting is in force (inclusive). Omit for open-ended.
pattern /^\d{4}-\d{2}-\d{2}$/

Response body

Success response 201 · schema WorkV1TimePeriodSettingsResponse

dataobjectRequired
time_period_settings_idstring <uuid>Required
frequencynumberRequired
frequency_unitstringRequired
Enum: dayweekmonthyear
start_daynumberRequiredNullable
end_daynumberRequiredNullable
start_monthnumberRequired
start_day_of_monthnumberRequired
end_monthnumberRequired
end_day_of_monthnumberRequired
effective_fromstringRequired
pattern /^\d{4}-\d{2}-\d{2}$/
effective_tostring
pattern /^\d{4}-\d{2}-\d{2}$/
is_activebooleanRequired
created_atstring <date-time>Required
updated_atstring <date-time>Required
tenantstring <uuid>Required

Response codes

201
Setting created.
400
Validation failure (field ranges, effective_to before effective_from).
401
API key missing/invalid or associated user missing.
403
Permission denied (time_period:manage for writes, time_period:read for reads).
409
The setting overlaps an active setting (same or conflicting period cells over intersecting effective dates). Nothing is written; explicit dates are never adjusted.
500
Unexpected failure.