Creates an absence with dates rounded to 00:00:00, 12:00:00, or 23:59:59 UTC to support full-day and half-day periods. The end date must be the same as or later than the start date, and overlapping absences are rejected unless the provider allows them.
Authentication
AuthorizationBearerSend your token in the Authorization: Bearer <token> header. See Authentication for API keys and OAuth.
Request body Required
The model to create the absence.
application/json
userIdstringRequiredThe id of the user to create the absence for.
startOnstringOptionalThe start time of the absence. The time of the date will be ignored.
endOnstringOptionalThe end time of the absence. The time of the date will be ignored.
descriptionstring or nullOptional0 maxLength: 1000 The reason for the absence.
externalProviderstring or nullOptional0 maxLength: 100 The external provider for the absence. If this value is set, the absence is treated as externally managed and therefore read-only in awork. This means users in awork can no longer edit or delete the absence.
isHalfDayOnStartbooleanOptionalIf it's true and it's a single day absence means that the absence to create is for the first half of the workday. If it's a multi day absence it started on the second half of the first day of the absence period.
isHalfDayOnEndbooleanOptionalIf it's true and it's a single day absence means that the absence to create is for the second half of the workday. If it's a multi day absence it ended on the first half of the last day of the absence period.
Responses
200 OK
application/json
idstringOptionalThe id of the entity.
createdOnstringOptionalThe date this entity was created.
createdBystringOptionalThe id of the user who created this entity.
updatedOnstringOptionalThe date this entity was last modified.
updatedBystringOptionalThe id of the user who last modified this entity.
userIdstring or nullOptionalThe id of the user to create the absence for.
startOnstringOptionalThe start time of the absence.
endOnstringOptionalThe end time of the absence.
descriptionstring or nullOptionalThe reason for the absence.
externalProviderstring or nullOptionalThe external provider for the absence. If this value is set, the absence is treated as externally managed and therefore read-only in awork. This means users in awork can no longer edit or delete the absence.
deletedOnstring or nullOptionalThe date the absence was deleted.
deletedBystring or nullOptionalThe id of the user that deleted the absence.
isReadOnlybooleanOptionalIf it's true it means that this Absence is read-only and cannot be edited/deleted by the user.
isHalfDayOnStartbooleanOptionalIf it's true and it's a single day absence means that the absence is for the first half of the workday. If it's a multi day absence it started on the second half of the first day of the absence period.
isHalfDayOnEndbooleanOptionalIf it's true and it's a single day absence means that the absence is for the second half of the workday. If it's a multi day absence it ended on the first half of the last day of the absence period.
400 Bad Request
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.
401 Unauthorized
application/json
codestringRequired1 The error code.
descriptionstringRequired1 The description of the error.
linkstringRequired1 The link to the API documentation page.
detailsarray of string or nullOptionalA list of details describing the error.
validationErrorsarray of object or nullOptionalIf a validation error occurred, this contains the validation errors for each property.
Show 2 properties
propertystring or nullOptionalThe name of the property that failed validation.
messagestring or nullOptionalThe reason why this property failed validation.
traceIdstring or nullOptionalThe request trace id for tracking the request.