Tickets API
POST/api/v1/tickets/recurring/preview
Product availabilityAlgaPSAAlgaDesk

Preview the next due dates of an unsaved recurring schedule

Computes the next 5 occurrences (nominal date, due date, create_at and due_at instants) of a draft schedule without saving anything, in the tenant time zone and with the business-day calendar the non_business_day_policy uses. Pass ticket_template_id to also get sample_title, the template title rendered for the first occurrence. Use it to check a rule before POST /api/v1/tickets/recurring. For a saved definition use GET /api/v1/tickets/recurring/{definitionId}/upcoming.

RBAC · recurring_ticket

Request body

Content type: application/json · schema WorkV1RecurringTicketPreviewBody

ticket_template_idstring <uuid>Nullable
Optional ticket template UUID; when given the response includes its title rendered for the first occurrence.
sample_client_namestringNullable
Client name used to render {{client}} in the sample title.
max length 200
recurrenceoneOfRequired
oneOf (option 1)object
frequencystringRequired
Enum: daily
intervalintegerRequired
Repeat every N units (days, weeks or months). Not used by yearly rules.
≥ 1 · ≤ 999
weekdaysOnlyboolean
Only weekdays (Mon-Fri); requires interval 1. Default false.
default false
endoneOf
When the recurrence stops.
oneOf (option 1)object
The schedule never ends.
typestringRequired
Enum: never
oneOf (option 2)object
Ends on a date.
typestringRequired
Enum: onDate
datestringRequired
Last date, YYYY-MM-DD.
pattern /^\d{4}-\d{2}-\d{2}$/
oneOf (option 3)object
Ends after a number of occurrences.
typestringRequired
Enum: afterCount
countintegerRequired
Total number of occurrences.
≥ 1 · ≤ 10000
oneOf (option 2)object
frequencystringRequired
Enum: weekly
intervalintegerRequired
Repeat every N units (days, weeks or months). Not used by yearly rules.
≥ 1 · ≤ 999
weekdaysarray of stringRequired
Weekdays it recurs on, unique, at least one.
min items 1
itemsstring
Enum: montuewedthufrisatsun
endoneOf
When the recurrence stops.
oneOf (option 1)object
The schedule never ends.
typestringRequired
Enum: never
oneOf (option 2)object
Ends on a date.
typestringRequired
Enum: onDate
datestringRequired
Last date, YYYY-MM-DD.
pattern /^\d{4}-\d{2}-\d{2}$/
oneOf (option 3)object
Ends after a number of occurrences.
typestringRequired
Enum: afterCount
countintegerRequired
Total number of occurrences.
≥ 1 · ≤ 10000
oneOf (option 3)object
frequencystringRequired
Enum: monthly
intervalintegerRequired
Repeat every N units (days, weeks or months). Not used by yearly rules.
≥ 1 · ≤ 999
ononeOfRequired
oneOf (option 1)object
typestringRequired
Enum: dayOfMonth
dayanyOfRequired
anyOf (option 1)integer
≥ 1 · ≤ 31
anyOf (option 2)string
Enum: last
oneOf (option 2)object
typestringRequired
Enum: nthWeekday
nthanyOfRequired
anyOf (option 1)number
Enum: 1
anyOf (option 2)number
Enum: 2
anyOf (option 3)number
Enum: 3
anyOf (option 4)number
Enum: 4
anyOf (option 5)string
Enum: last
weekdaystringRequired
Enum: montuewedthufrisatsun
endoneOf
When the recurrence stops.
oneOf (option 1)object
The schedule never ends.
typestringRequired
Enum: never
oneOf (option 2)object
Ends on a date.
typestringRequired
Enum: onDate
datestringRequired
Last date, YYYY-MM-DD.
pattern /^\d{4}-\d{2}-\d{2}$/
oneOf (option 3)object
Ends after a number of occurrences.
typestringRequired
Enum: afterCount
countintegerRequired
Total number of occurrences.
≥ 1 · ≤ 10000
oneOf (option 4)object
frequencystringRequired
Every year, on the given month and day. Has no interval.
Enum: yearly
monthintegerRequired
Month of the year, 1-12.
≥ 1 · ≤ 12
dayintegerRequired
Day of the month; must exist in that month (Feb 29 clamps to Feb 28 in non-leap years).
≥ 1 · ≤ 31
endoneOf
When the recurrence stops.
oneOf (option 1)object
The schedule never ends.
typestringRequired
Enum: never
oneOf (option 2)object
Ends on a date.
typestringRequired
Enum: onDate
datestringRequired
Last date, YYYY-MM-DD.
pattern /^\d{4}-\d{2}-\d{2}$/
oneOf (option 3)object
Ends after a number of occurrences.
typestringRequired
Enum: afterCount
countintegerRequired
Total number of occurrences.
≥ 1 · ≤ 10000
start_datestringRequired
First date the schedule can fall on, YYYY-MM-DD.
pattern /^\d{4}-\d{2}-\d{2}$/
create_timestringRequired
Wall-clock create time, HH:MM, tenant time zone.
due_timestringRequired
Wall-clock due time, HH:MM, tenant time zone.
lead_daysintegerRequired
Days before the due date the ticket is created.
≥ 0 · ≤ 365
non_business_day_policystringRequired
'keep', 'previous' or 'next' business day when the due date is not a business day.
Enum: keeppreviousnext

Response body

Success response 200 · schema WorkV1ApiSuccess

dataanyOfRequired
anyOf (option 1)object
anyOf (option 2)array of object
itemsobject
metaobject

Response codes

200
The next 5 occurrences, time_zone, calendar and sample_title.
400
Validation failure, an invalid id, or a reference that does not exist.
401
API key missing/invalid.
403
RBAC denied for recurring_ticket read.
500
Unexpected controller/service failure.