Skip to main content
POST
/
resource-planner
/
assignments
/
time-off
Create Time Off
curl --request POST \
  --url https://api.everhour.com/resource-planner/assignments/time-off \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "endDate": "2019-02-01",
  "startDate": "2019-01-21",
  "type": "time-off",
  "timeOffType": 16539,
  "user": 79786,
  "timeOffPeriod": "full-day",
  "status": "pending",
  "sendNotification": false,
  "reviewer": 79786,
  "considerAllocations": true,
  "attachments": [
    68797,
    68798
  ],
  "forceOverride": true
}
'
{
  "days": 10,
  "endDate": "2019-02-01",
  "id": 41827,
  "startDate": "2019-01-21",
  "type": "time-off",
  "user": 79786,
  "timeOffPeriod": "full-day",
  "reviewer": 79786,
  "attachments": [
    {
      "id": 514,
      "name": "avatar.jpg",
      "token": "9a04b8a1fb99cbfadf3386ad6a338c14"
    }
  ]
}

Authorizations

X-Api-Key
string
header
required

Body

application/json
endDate
string
Example:

"2019-02-01"

startDate
string
Example:

"2019-01-21"

type
enum<string>
Available options:
time-off
Example:

"time-off"

timeOffType
number
Example:

16539

user
number
Example:

79786

timeOffPeriod
enum<string>
Available options:
full-day,
half-of-day,
quarter-of-day,
half-and-quarter-of-day
Example:

"full-day"

status
enum<string>

User with admin rights can set the "approved" status on create, regular users create a pending that must be approved by an admin.

Available options:
pending,
approved
Example:

"pending"

sendNotification
boolean
Example:

false

reviewer
number

Admin who must receive notification for approval

Example:

79786

considerAllocations
boolean

Switch on/off allocations considering. Allow creating time-off even when the allocated limits are exceeded.

Example:

true

attachments
number[]
Example:
[68797, 68798]
forceOverride
boolean
Example:

true

Response

Created

days
number

Number of workdays

Example:

10

endDate
string
Example:

"2019-02-01"

id
number
Example:

41827

startDate
string
Example:

"2019-01-21"

type
string
Example:

"time-off"

user
number
Example:

79786

timeOffPeriod
enum<string>
Available options:
full-day,
half-of-day,
quarter-of-day,
half-and-quarter-of-day
Example:

"full-day"

reviewer
number

Admin who must receive notification for approval

Example:

79786

attachments
object[]