PUT Update bookings in bulk
Bulk update bookings
As with bulk creation, reset_all_on_error and stop_on_first_error are in order to get the transaction-like behavior. reset_all_on_error will reset all bookings in the request to the previous state if an error occurs.
Endpoint
PUT https://api.timekit.io/v2/bookings/bulk
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
bookings |
body | array_object | yes | The bookings to update, at most 30 per request. Each item has id (the booking ID), action (the action to apply) and an optional data object with the action's inputs, the same body you would send to update booking state. |
|
stop_on_first_error |
body | boolean | false | ||
reset_all_on_error |
body | boolean | false |
Request examples
curlcurl -X PUT \
-u :live_api_key_7nzvc7wsBQQISLeFSVhROys9V1bUJ1z7 \
-d '{
"bookings": [
{
"id": "b7dd8206-4849-4454-ac4f-fc361bc751f0",
"action": "confirm"
},
{
"id": "3d2f3a37-ff69-4dd1-bbdb-1bfa5fc96d4f",
"action": "confirm"
},
{
"id": "c7b69629-5467-4121-a82d-e9e1c8acb956",
"action": "confirm"
}
],
"reset_all_on_error": true,
"stop_on_first_error": false
}' \
https://api.timekit.io/v2/bookings/bulk
Response examples
200
json{
"data": [
{
"id": "b7dd8206-4849-4454-ac4f-fc361bc751f0",
"state": "confirmed",
"graph": "confirm_decline",
"completed": false,
"created_at": "2017-10-20 16:01:07",
"updated_at": "2017-10-20 16:01:08"
},
{
"id": "3d2f3a37-ff69-4dd1-bbdb-1bfa5fc96d4f",
"state": "confirmed",
"graph": "confirm_decline",
"completed": false,
"created_at": "2017-10-20 16:01:08",
"updated_at": "2017-10-20 16:01:08"
},
{
"id": "c7b69629-5467-4121-a82d-e9e1c8acb956",
"state": "confirmed",
"graph": "confirm_decline",
"completed": false,
"created_at": "2017-10-20 16:01:08",
"updated_at": "2017-10-20 16:01:08"
}
]
}