Creates an absence.

POSThttps://api.awork.com/api/v1/absences
POST https://api.awork.com/api/v1/absences

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

AuthorizationBearer

Send 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

userIdstringRequired
format: uuid

The id of the user to create the absence for.

startOnstringOptional
format: date-time

The start time of the absence. The time of the date will be ignored.

endOnstringOptional
format: date-time

The end time of the absence. The time of the date will be ignored.

descriptionstring or nullOptional
minLength: 0 maxLength: 1000

The reason for the absence.

externalProviderstring or nullOptional
minLength: 0 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.

isHalfDayOnStartbooleanOptional

If 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.

isHalfDayOnEndbooleanOptional

If 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

idstringOptional
format: uuid

The id of the entity.

createdOnstringOptional
format: date-time

The date this entity was created.

createdBystringOptional
format: uuid

The id of the user who created this entity.

updatedOnstringOptional
format: date-time

The date this entity was last modified.

updatedBystringOptional
format: uuid

The id of the user who last modified this entity.

userIdstring or nullOptional
format: uuid

The id of the user to create the absence for.

startOnstringOptional
format: date-time

The start time of the absence.

endOnstringOptional
format: date-time

The end time of the absence.

descriptionstring or nullOptional

The reason for the absence.

externalProviderstring or nullOptional

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.

deletedOnstring or nullOptional
format: date-time

The date the absence was deleted.

deletedBystring or nullOptional
format: uuid

The id of the user that deleted the absence.

isReadOnlybooleanOptional

If it's true it means that this Absence is read-only and cannot be edited/deleted by the user.

isHalfDayOnStartbooleanOptional

If 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.

isHalfDayOnEndbooleanOptional

If 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

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

401 Unauthorized

application/json

codestringRequired
minLength: 1

The error code.

descriptionstringRequired
minLength: 1

The description of the error.

linkstringRequired
minLength: 1

The link to the API documentation page.

detailsarray of string or nullOptional

A list of details describing the error.

validationErrorsarray of object or nullOptional

If a validation error occurred, this contains the validation errors for each property.

Show 2 properties
propertystring or nullOptional

The name of the property that failed validation.

messagestring or nullOptional

The reason why this property failed validation.

traceIdstring or nullOptional

The request trace id for tracking the request.

Search documentation