Skip to main content
POST
/
absences
/
Create new absence
curl --request POST \
  --url http:localhost:3000/v2/absences/ \
  --header 'Content-Type: application/json' \
  --header 'x-API-Key: <api-key>' \
  --data '{
  "_id": "<string>",
  "number": 123,
  "companyId": "<string>",
  "status": {
    "status": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "lastModifiedAt": "2023-11-07T05:31:56Z",
    "lastModifiedBy": "<string>"
  },
  "chatId": "<string>",
  "userId": "<string>",
  "type": 123,
  "payTypeAbsenceId": "<string>",
  "calculationType": "<string>",
  "desc": "<string>",
  "dtStart": "2023-11-07T05:31:56Z",
  "dtEnd": "2023-11-07T05:31:56Z",
  "daysAbsent": 123,
  "fullDay": true,
  "approvedBy": "<string>",
  "declinedBy": "<string>",
  "affectedJobs": [
    "<string>"
  ],
  "isAssigned": true,
  "attachments": [
    "<string>"
  ],
  "imageIds": [
    "<string>"
  ],
  "objectManagerIds": [
    "<string>"
  ],
  "declineComment": "<string>",
  "sendEmailToCustomer": true,
  "affectedObjectIds": [
    "<string>"
  ],
  "absencePaidTimeArray": [
    {}
  ],
  "replacements": [
    {}
  ]
}'
{
  "absenceId": "<string>"
}

Authorizations

x-API-Key
string
header
required

Body

application/json

Absence data

Absence record for a user, including type, dates, and affected jobs. Base class for all entities that can have a chat associated with them. Base class for all entities in the system, providing common properties and methods.

_id
string<objectid>

Unique identifier for the absence Unique identifier of the entity

userId
string<objectid>

User ID for whom the absence is recorded

type
integer

Absence type (e.g., illness, vacation, unpaid leave)

payTypeAbsenceId
string<objectid> | null

Pay type absence ID

calculationType
string | null

Calculation type for the absence

desc
string | null

Description or comment for the absence

dtStart
string<date-time>

Start date/time of the absence

dtEnd
string<date-time>

End date/time of the absence

daysAbsent
number

Number of days absent

fullDay
boolean

Whether the absence is for a full day

approvedBy
string<objectid> | null

User ID who approved the absence

declinedBy
string<objectid> | null

User ID who declined the absence

affectedJobs
string<objectid>[]

List of job IDs affected by this absence

isAssigned
boolean

Whether all replacement jobs are assigned

attachments
string[]

Attachment IDs or file references

imageIds
string[]

Image IDs associated with the absence

objectManagerIds
string<objectid>[]

IDs of object managers

declineComment
string | null

Comment for declined absence

sendEmailToCustomer
boolean

Whether to send an email to the customer

affectedObjectIds
string<objectid>[]

IDs of affected objects

absencePaidTimeArray
object[]

Paid time for each day of the absence

replacements
object[]

Replacement assignments for the absence

status
object

Status struct for the absence Entity Status information

number
integer

Unique number of the entity, used for identification

companyId
string<objectid>

The ID of the company this entity belongs to

chatId
string<objectid> | null

ID of the chat associated with this entity

Response

Absence created successfully

absenceId
string<objectid>

ID of the created absence