@@ -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,146 @@ 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 is 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
+ created_by : 1
2220
+ created_at : " 2022-06-20T14:29:56.510Z"
2221
+ updated_at : " 2022-06-20T14:29:56.510Z"
2222
+ approved_at : " 2022-06-20T14:29:56.510Z"
2223
+ breakdowns :
2224
+ - date : " 2022-06-01"
2225
+ effective_duration : 480
2226
+ - date : " 2022-06-02"
2227
+ effective_duration : 480
2228
+ " 400 " :
2229
+ description : Invalid request
2230
+ content :
2231
+ application/json :
2232
+ schema :
2233
+ $ref : " #/components/schemas/ErrorInsertingAbsenceResponse"
2234
+ examples :
2235
+ response :
2236
+ value :
2237
+ success : false
2238
+ error :
2239
+ code : 400
2240
+ message : ' Error when trying to insert absence period'
2241
+
2242
+ " 404 " :
2243
+ description : Employee or Absence type not found
2244
+ content :
2245
+ application/json :
2246
+ schema :
2247
+ $ref : " #/components/schemas/ErrorResponse"
2248
+ examples :
2249
+ response :
2250
+ value :
2251
+ success : false
2252
+ error :
2253
+ code : 0
2254
+ message : ' Absence type not found.'
2255
+
2256
+ " 422 " :
2257
+ description : Validation error
2258
+ content :
2259
+ application/json :
2260
+ schema :
2261
+ $ref : " #/components/schemas/ErrorCreateAbsenceResponse"
2262
+ examples :
2263
+ response :
2264
+ value :
2265
+ success : false
2266
+ error :
2267
+ code : 0
2268
+ message : ' The given data failed to pass validation.'
2269
+ error_data : ' {...}'
2270
+ " 500 " :
2271
+ description : Internal server error
2272
+ content :
2273
+ application/json :
2274
+ schema :
2275
+ $ref : " #/components/schemas/ErrorResponse"
2276
+ examples :
2277
+ response :
2278
+ value :
2279
+ success : false
2280
+ error :
2281
+ code : 0
2282
+ message : ' Something went wrong'
2142
2283
2143
2284
" /company/document-categories " :
2144
2285
parameters :
@@ -2721,7 +2862,7 @@ components:
2721
2862
example : The absence period was not found.
2722
2863
2723
2864
ErrorInsertingAbsenceResponse :
2724
- title : 400 absense error
2865
+ title : 400 absence error
2725
2866
type : object
2726
2867
properties :
2727
2868
success :
@@ -3808,11 +3949,11 @@ components:
3808
3949
half_day_start :
3809
3950
type : boolean
3810
3951
example : false
3811
- description : Weather the start date is a half-day off.
3952
+ description : Whether the start date is a half-day off.
3812
3953
half_day_end :
3813
3954
type : boolean
3814
3955
example : false
3815
- description : Weather the end date is a half-day off.
3956
+ description : Whether the end date is a half-day off.
3816
3957
comment :
3817
3958
type : string
3818
3959
example : Some Comment
@@ -3828,6 +3969,67 @@ components:
3828
3969
- end_date
3829
3970
- half_day_start
3830
3971
- half_day_end
3972
+ CreateAbsencePeriodRequest :
3973
+ title : Create Absence periods **tracked in hours**
3974
+ type : object
3975
+ properties :
3976
+ employee_id :
3977
+ type : integer
3978
+ description : Employee identifier
3979
+ absence_type_id :
3980
+ type : string
3981
+ format : uuid
3982
+ description : Absence type identifier
3983
+ start_date :
3984
+ type : string
3985
+ format : date
3986
+ description : " Absence start date. Format: yyyy-mm-dd"
3987
+ example : ' 2020-01-31'
3988
+ end_date :
3989
+ type : string
3990
+ format : date
3991
+ description : " Absence end date. Format: yyyy-mm-dd"
3992
+ example : ' 2020-01-31'
3993
+ full_day :
3994
+ type : boolean
3995
+ example : false
3996
+ 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)
3997
+ start_time :
3998
+ type : string
3999
+ format : date
4000
+ description : " Absence start time. Format: HH:ii and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4001
+ example : ' 03:00'
4002
+ end_time :
4003
+ type : string
4004
+ format : date
4005
+ description : " Absence end time. Format: HH:ii and only required if the start_date and end_date are the same, and full_day is false (partial-day absence)"
4006
+ example : ' 15:00'
4007
+ half_day_start :
4008
+ type : boolean
4009
+ example : false
4010
+ 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)
4011
+ half_day_end :
4012
+ type : boolean
4013
+ example : false
4014
+ 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)
4015
+ comment :
4016
+ type : string
4017
+ example : Some Comment
4018
+ description : Optional comment
4019
+ skip_approval :
4020
+ type : boolean
4021
+ example : false
4022
+ 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.
4023
+ required :
4024
+ - employee_id
4025
+ - absence_type_id
4026
+ - start_date
4027
+ - end_date
4028
+ - full_day
4029
+ - start_time
4030
+ - end_time
4031
+ - half_day_start
4032
+ - half_day_end
3831
4033
AbsencePeriodsResponse :
3832
4034
title : List All Absence Periods response
3833
4035
type : object
@@ -4004,6 +4206,24 @@ components:
4004
4206
attributes :
4005
4207
$ref : " #/components/schemas/Absence"
4006
4208
4209
+ HourlyAbsencePeriodResponse :
4210
+ title : Absence Periods response
4211
+ type : object
4212
+ allOf :
4213
+ - $ref : " #/components/schemas/Response"
4214
+ - type : object
4215
+ properties :
4216
+ data :
4217
+ type : object
4218
+ required :
4219
+ - type
4220
+ - attributes
4221
+ properties :
4222
+ type :
4223
+ example : AbsencePeriod
4224
+ attributes :
4225
+ $ref : " #/components/schemas/HourlyAbsence"
4226
+
4007
4227
Absence :
4008
4228
type : object
4009
4229
properties :
@@ -4127,6 +4347,9 @@ components:
4127
4347
type : string
4128
4348
format : uuid
4129
4349
example : 61fe126b-a7b3-449a-b5ee-3865a6fcc546
4350
+ name :
4351
+ type : string
4352
+ example : Absence Type Name
4130
4353
AbsencePeriodBreakdown :
4131
4354
type : object
4132
4355
required :
0 commit comments