Integrations can now maintain their own items in a stop’s custom content1 with a single request: Upsert Custom Content Item2 inserts your item, or replaces the item it matches, and leaves everything else on the stop3 as it is. There’s no need to read the custom content1 first and send it back complete.
This pays off as soon as more than one system writes onto the same stops3. Say one integration adds an order checklist when the booking is created, and another adds a support chat link once a driver is assigned: each sends just its own item, and every item is kept, even when the requests arrive at the same moment.
How it works
Send your item together with match_by, the fields that identify it among the stop’s3 items of the same
type:
PATCH /api/stops/{stop_id}/content
{
"stop": {
"item": {
"type": "link",
"title": "Need help?",
"link": "https://chat.example.com/?tour=8c5d2a4e",
"description": null,
"icon": "message"
},
"match_by": ["title"]
}
}
- If a link titled “Need help?” is already on the stop3, yours replaces it and keeps its place in the list.
- Otherwise your item is added at the end, or at the start with
"placement": "prepend". - If the stored item already equals yours, nothing is written and no webhooks are sent.
The response tells you what happened and where your item now sits, counting from 1:
{ "result": "inserted", "position": 3 }
Both your item and the resulting custom content1 are validated, so a stop3 still holds at most 10 items.
Which endpoint to use
To add or change items, we recommend the new endpoint over Update Custom Content4. That one replaces the whole list, which is what you want only to replace or clear all of a stop’s3 custom content1 at once. Both endpoints carry the change over between a booking’s stop3 and the matching tour stop3, as before.
If your API tokens are restricted to specific endpoints, get in touch with us to enable the new one for them.