@@ -1740,7 +1740,7 @@ paths:
1740
1740
application/x-www-form-urlencoded :
1741
1741
schema :
1742
1742
$ref : " #/components/schemas/CreateTimeOffPeriodRequest"
1743
- description : Absense data
1743
+ description : Absence data
1744
1744
required : true
1745
1745
x-readme :
1746
1746
code-samples :
@@ -1749,7 +1749,7 @@ paths:
1749
1749
- language : " php"
1750
1750
code : " Auto-generated code snippets for this language may not be supported"
1751
1751
responses :
1752
- " 201 " :
1752
+ " 200 " :
1753
1753
description : The absence period is successfully created
1754
1754
content :
1755
1755
application/json :
@@ -1831,7 +1831,7 @@ paths:
1831
1831
success : false
1832
1832
error :
1833
1833
code : 0
1834
- message : ' Something went wrong '
1834
+ message : ' Time-off type not found. '
1835
1835
1836
1836
" 422 " :
1837
1837
description : Validation error
@@ -2107,6 +2107,7 @@ paths:
2107
2107
type : AbsenceType
2108
2108
attributes :
2109
2109
id : " 9bba303f-0fbc-4514-9958-0befa21923fb"
2110
+ name : " Absence Type Name"
2110
2111
certificate :
2111
2112
status : not-required
2112
2113
start : " 2022-05-31T22:00:00.0Z"
@@ -2139,6 +2140,147 @@ paths:
2139
2140
problem+json :
2140
2141
schema :
2141
2142
$ref : " #/components/schemas/ErrorResponse"
2143
+ post :
2144
+ security :
2145
+ - BearerAuth : [ ]
2146
+ tags :
2147
+ - Absences
2148
+ description : Adds absence data for absence types **tracked in hours**.
2149
+ requestBody :
2150
+ content :
2151
+ application/x-www-form-urlencoded :
2152
+ schema :
2153
+ $ref : " #/components/schemas/CreateAbsencePeriodRequest"
2154
+ description : Absence data
2155
+ required : true
2156
+ x-readme :
2157
+ code-samples :
2158
+ - language : " powershell"
2159
+ code : " Auto-generated code snippets for this language may not be supported"
2160
+ - language : " php"
2161
+ code : " Auto-generated code snippets for this language may not be supported"
2162
+ responses :
2163
+ " 201 " :
2164
+ description : The absence period was successfully created
2165
+ content :
2166
+ application/json :
2167
+ schema :
2168
+ type : object
2169
+ properties :
2170
+ data :
2171
+ $ref : " #/components/schemas/HourlyAbsencePeriodResponse"
2172
+ examples :
2173
+ response :
2174
+ value :
2175
+ success : true
2176
+ data :
2177
+ - type : AbsencePeriod
2178
+ attributes :
2179
+ id : 9bba303f-0fbc-4514-9958-0befa21923fb
2180
+ measurement_unit : " hour"
2181
+ effective_duration : 960
2182
+ employee :
2183
+ type : Employee
2184
+ attributes :
2185
+ id :
2186
+ label : id
2187
+ value : 2367
2188
+ type : integer
2189
+ universal_id : id
2190
+ first_name :
2191
+ label : First name
2192
+ value : Michael
2193
+ type : standard
2194
+ universal_id : first_name
2195
+ last_name :
2196
+ label : Last name
2197
+ value : Miller
2198
+ type : standard
2199
+ universal_id : last_name
2200
+ email :
2201
+ label : Email
2202
+
2203
+ type : standard
2204
+ universal_id : email
2205
+ absence_type :
2206
+ type : AbsenceType
2207
+ attributes :
2208
+ id : " 9bba303f-0fbc-4514-9958-0befa21923fb"
2209
+ name : " Absence Type Name"
2210
+ certificate :
2211
+ status : not-required
2212
+ start : " 2022-05-31T22:00:00.0Z"
2213
+ end : " 2022-06-02T22:00:00.0Z"
2214
+ half_day_start : true
2215
+ half_day_end : false
2216
+ comment : " this is a comment"
2217
+ origin : " web"
2218
+ status : " approved"
2219
+ timezone : " Europe/Berlin"
2220
+ created_by : 1
2221
+ created_at : " 2022-06-20T14:29:56.510Z"
2222
+ updated_at : " 2022-06-20T14:29:56.510Z"
2223
+ approved_at : " 2022-06-20T14:29:56.510Z"
2224
+ breakdowns :
2225
+ - date : " 2022-06-01"
2226
+ effective_duration : 480
2227
+ - date : " 2022-06-02"
2228
+ effective_duration : 480
2229
+ " 400 " :
2230
+ description : Invalid request
2231
+ content :
2232
+ application/json :
2233
+ schema :
2234
+ $ref : " #/components/schemas/ErrorInsertingAbsenceResponse"
2235
+ examples :
2236
+ response :
2237
+ value :
2238
+ success : false
2239
+ error :
2240
+ code : 400
2241
+ message : ' Error when trying to insert absence period'
2242
+
2243
+ " 404 " :
2244
+ description : Employee or Absence type not found
2245
+ content :
2246
+ application/json :
2247
+ schema :
2248
+ $ref : " #/components/schemas/ErrorResponse"
2249
+ examples :
2250
+ response :
2251
+ value :
2252
+ success : false
2253
+ error :
2254
+ code : 0
2255
+ message : ' Absence type not found.'
2256
+
2257
+ " 422 " :
2258
+ description : Validation error
2259
+ content :
2260
+ application/json :
2261
+ schema :
2262
+ $ref : " #/components/schemas/ErrorCreateAbsenceResponse"
2263
+ examples :
2264
+ response :
2265
+ value :
2266
+ success : false
2267
+ error :
2268
+ code : 0
2269
+ message : ' The given data failed to pass validation.'
2270
+ error_data : ' {...}'
2271
+ " 500 " :
2272
+ description : Internal server error
2273
+ content :
2274
+ application/json :
2275
+ schema :
2276
+ $ref : " #/components/schemas/ErrorResponse"
2277
+ examples :
2278
+ response :
2279
+ value :
2280
+ success : false
2281
+ error :
2282
+ code : 0
2283
+ message : ' Something went wrong'
2142
2284
2143
2285
" /company/document-categories " :
2144
2286
parameters :
@@ -2721,7 +2863,7 @@ components:
2721
2863
example : The absence period was not found.
2722
2864
2723
2865
ErrorInsertingAbsenceResponse :
2724
- title : 400 absense error
2866
+ title : 400 absence error
2725
2867
type : object
2726
2868
properties :
2727
2869
success :
@@ -3808,11 +3950,11 @@ components:
3808
3950
half_day_start :
3809
3951
type : boolean
3810
3952
example : false
3811
- description : Weather the start date is a half-day off.
3953
+ description : Whether the start date is a half-day off.
3812
3954
half_day_end :
3813
3955
type : boolean
3814
3956
example : false
3815
- description : Weather the end date is a half-day off.
3957
+ description : Whether the end date is a half-day off.
3816
3958
comment :
3817
3959
type : string
3818
3960
example : Some Comment
@@ -3828,6 +3970,64 @@ components:
3828
3970
- end_date
3829
3971
- half_day_start
3830
3972
- half_day_end
3973
+ CreateAbsencePeriodRequest :
3974
+ title : Create Absence periods **tracked in hours**
3975
+ type : object
3976
+ properties :
3977
+ employee_id :
3978
+ type : integer
3979
+ description : Employee identifier
3980
+ example : 10735
3981
+ absence_type_id :
3982
+ type : string
3983
+ format : uuid
3984
+ description : Absence type identifier
3985
+ example : 9bba303f-0fbc-4514-9958-0befa21923fb
3986
+ start_date :
3987
+ type : string
3988
+ format : date
3989
+ description : " Absence start date. Format: yyyy-mm-dd"
3990
+ example : ' 2020-01-31'
3991
+ end_date :
3992
+ type : string
3993
+ format : date
3994
+ description : " Absence end date. Format: yyyy-mm-dd"
3995
+ example : ' 2020-01-31'
3996
+ full_day :
3997
+ type : boolean
3998
+ example : false
3999
+ description : Whether it's a full day absence or not, only required if the start_date and end_date are the same (one day absence at most)
4000
+ start_time :
4001
+ type : string
4002
+ format : date
4003
+ description : " Absence start time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4004
+ example : ' 03:00'
4005
+ end_time :
4006
+ type : string
4007
+ format : date
4008
+ description : " Absence end time. Format: HH:mm (hours and minutes) and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4009
+ example : ' 15:00'
4010
+ half_day_start :
4011
+ type : boolean
4012
+ example : false
4013
+ description : Whether the start date is a half-day off, only required if the start_date and end_date are not the same (more than one day absence)
4014
+ half_day_end :
4015
+ type : boolean
4016
+ example : false
4017
+ description : Whether the end date is a half-day off, only required if the start_date and end_date are not the same (more than one day absence)
4018
+ comment :
4019
+ type : string
4020
+ example : Some Comment
4021
+ description : Optional comment
4022
+ skip_approval :
4023
+ type : boolean
4024
+ example : false
4025
+ description : Optional, default value is true. If set to false, the approval status of the absence request will be "pending" if an approval rule is set for the absence type in Personio. The respective approval flow will be triggered.
4026
+ required :
4027
+ - employee_id
4028
+ - absence_type_id
4029
+ - start_date
4030
+ - end_date
3831
4031
AbsencePeriodsResponse :
3832
4032
title : List All Absence Periods response
3833
4033
type : object
@@ -4004,6 +4204,24 @@ components:
4004
4204
attributes :
4005
4205
$ref : " #/components/schemas/Absence"
4006
4206
4207
+ HourlyAbsencePeriodResponse :
4208
+ title : Absence Periods response
4209
+ type : object
4210
+ allOf :
4211
+ - $ref : " #/components/schemas/Response"
4212
+ - type : object
4213
+ properties :
4214
+ data :
4215
+ type : object
4216
+ required :
4217
+ - type
4218
+ - attributes
4219
+ properties :
4220
+ type :
4221
+ example : AbsencePeriod
4222
+ attributes :
4223
+ $ref : " #/components/schemas/HourlyAbsence"
4224
+
4007
4225
Absence :
4008
4226
type : object
4009
4227
properties :
@@ -4063,6 +4281,10 @@ components:
4063
4281
HourlyAbsence :
4064
4282
type : object
4065
4283
properties :
4284
+ id :
4285
+ type : string
4286
+ format : uuid
4287
+ example : 61fe126b-a7b3-449a-b5ee-3865a6fcc546
4066
4288
measurement_unit :
4067
4289
type : string
4068
4290
example : " hours"
@@ -4099,6 +4321,9 @@ components:
4099
4321
status :
4100
4322
type : string
4101
4323
example : approved
4324
+ timezone :
4325
+ type : string
4326
+ example : " Europe/Berlin"
4102
4327
created_by :
4103
4328
type : integer
4104
4329
example : 1
@@ -4127,6 +4352,9 @@ components:
4127
4352
type : string
4128
4353
format : uuid
4129
4354
example : 61fe126b-a7b3-449a-b5ee-3865a6fcc546
4355
+ name :
4356
+ type : string
4357
+ example : Absence Type Name
4130
4358
AbsencePeriodBreakdown :
4131
4359
type : object
4132
4360
required :
0 commit comments