Setting an Employees Unavailability

Sometimes employees may have consistent times where they are unavailable to work. They may be a student with university lectures or have other regular family commitments. To help with this, via the API you are able to set an employees unavailability to work.

When this is done, it defines the periods of the week that the employee is unavailable to work. This can be done as both a one off, or a regular time block, for example weekly. When set this will mean that the system ignores this employee when building out auto schedules.

Process for adding Employee Unavailability

curl --location --request POST 'https://{install}.{geo}.deputy.com/api/v1/supervise/unavail

Sample Payload - Simple Unavailability

{"blnSubmitSuperUnavail":true,
 "intAssignedEmployeeId":639,
 "start":{"timestamp":"1736168400"},
 "end":{"timestamp":"1736254800"},
 "strComment":"Comment"}

Data ElementMandatoryInfo
blnSubmitSuperUnavailYesThis indicates you are submitting unavailability for the employee
intAssignedEmployeeIdYesThe record id of the employee you are submitting unavailability for
startYesThe start time of the unavailability in unix time
endYesThe end time of the unavailability in unix time
strCommentYesA comment to go along with the unavailability record that the manager will see. This can just be an empty string.

Sample Payload - Recurring Unavailability

{
 "blnSubmitSuperUnavail":true,
 "intAssignedEmployeeId":639,
 "start":{"timestamp":"1736168400"},
 "end":{"timestamp":"1736254800"},
 "strComment":"Weekly",
 "recurrence":{"FREQ":"WEEKLY","INTERVAL":1,"BYDAY":"MO"}
}


Data ElementMandatoryInfo
blnSubmitSuperUnavailYesThis indicates you are submitting unavailability for the employee
intAssignedEmployeeIdYesThe record id of the employee you are submitting unavailability for
startYesThe start time of the unavailability in unix time
endYesThe end time of the unavailability in unix time
strCommentYesA comment to go along with the unavailability record that the manager will see. This can just be an empty string.
recurrenceYes if recurringDefines the recurrence interval
recurrence - FREQYes if recurringDefines the frequency of the unavailability. WEEKLY or MONTHLY. For those which might be fortnightly etc or every four weeks, the INTERVAL is used.
recurrence - INTERVALYes if recurringThe interval for the unavailability. For example if FREQ is WEEKLY and INTERVAL is 1 it means every week. If INTERVAL is 2 it means fortnightly etc.
recurrence - BYDAYYes if recurringThe days of the week to set this unavailability. Can be more than one. Days are defined by the first two letters of the day so for example MO = Monday, WE = Wednesday etc.

If you are defining a monthly unavailability for example the 6th of every month this field is called BYMONTHDAY and you define the day of the month. For example BYMONTHDAY: 6

Sample Response

{
    "Id": 242,
    "Employee": 639,
    "Type": 0,
    "MaxDateRecurringGenerated": null,
    "StartTime": 1736168400,
    "EndTime": 1736254800,
    "Date": "2025-01-07T00:00:00+11:00",
    "Comment": "Comment",
    "Schedule": 0,
    "Creator": 1,
    "Created": "2025-01-06T11:35:11+11:00",
    "Modified": "2025-01-06T11:35:11+11:00",
    "StartTimeLocalized": "2025-01-07T00:00:00+11:00",
    "EndTimeLocalized": "2025-01-08T00:00:00+11:00",
}

Data ElementInfo
IdThe id of the new record which has been added
EmployeeThe id of the record for the Employee which has had the unavailability added
TypeThe type of unavailabilty. 0 = one off, 1 = recurring
MaxDateRecurringGeneratedIf it is a recurring record it will define here the maximum date that was generated for this record. Deputy does not add infinite records for future unavailability so it is important to track this date in a recurring situation.
StartTimeThe start time in unix time of the unavailability
EndTimeThe end time in unix time of the unavailability
DateThe first date of the unavailability in zulu format with timezone offset
CommentThe comment added against the unavailability
ScheduleIf recurring the id record of the schedule which is driving the recurrence is included here
CreatorThe id of the record of the Deputy user who created the record (even via API as API impersonates a user via bearer token etc)
CreatedThe created time of the record
StartTimeLocalizedThe start time in zulu format with the timezone offset for the record
EndTimeLocalizedThe end time in zulu format with the timezone offset for the record