Partial Updates

Most PATCH endpoints support partial updates via a combination of a partial entity body and a fields parameter.

Fields parameter

The fields parameter accepts a set of field paths that specifies the entity data to update. In general, the fields path begins from the root of the request body.

When the fields parameter contains a sub-path of the entity fields, like event - all nested fields are included in the update: event.title, event.description, etc.

When the fields parameter is empty, the request will modify ALL entity fields.

fields parameter behavior follows google.protobuf.FieldMask semantics.

Examples

To update an Event title, and reschedule it to a later date, the request would look like this:

Copy
1
{
2
"event": {
3
"title": "My event (rescheduled & relocated)",
4
"scheduleConfig": {
5
"startDate": "2032-05-16T10:00:00.000+03:00",
6
"endDate": "2032-05-16T10:30:00.000+03:00"
7
}
8
},
9
"fields": {
10
"paths": [
11
"event.title",
12
"event.scheduleConfig.startDate",
13
"event.scheduleConfig.endDate"
14
]
15
}
16
}

To erase optional fields, send an empty body and list the field(s) to update in the fields parameter. For example, to clear an event description, the request would look like this:

Copy
1
{
2
"event": {},
3
"fields": {
4
"paths": [
5
"event.description"
6
]
7
}
8
}

When only one parameter can be updated, the fields parameter must still be passed. For example, to bulk update the status of multiple RSVPs to one event, the request would look like this:

Copy
1
{
2
"status": "WAITING",
3
"fields": {
4
"paths": [
5
"status"
6
]
7
}
8
}
Was this helpful?
Yes
No