Day 10 created an event and got its ID. Day 12 uses that ID to update the event — change its summary, time, or description. Two-call shape: create-then-update.
# Step 1: create (we did this on day 10 — same shape, fresh event)
created = toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {
"calendar_id": "primary",
"summary": "zuzu-day-12 (will be updated)",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 30,
})
event_id = created.get("response_data", {}).get("id") or created.get("id")
# Step 2: update — modify the summary
result = toolset.execute_action(Action.GOOGLECALENDAR_UPDATE_EVENT, {
"calendar_id": "primary",
"event_id": event_id,
"summary": "zuzu-day-12 (updated)",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 30,
})
print(result.get("summary"))The update API takes the same parameters as create, plus event_id?
Roughly. Some APIs allow partial updates (only changed fields); others want the full record. Calendar's update wants the full event record — fields not included get overwritten with their defaults. Always pass at least the same fields you set on create, or you risk wiping them.
And the verification?
Asserts result.get("summary") == "zuzu-day-12 (updated)" — confirms the update landed and we got the new value back. The API only returns the new summary if the update actually wrote it.
Updates take an existing resource and change one or more of its fields. They almost always need:
Different APIs treat the request body differently:
When in doubt, send the full record — safer.
In one script, just save the ID from create into a variable:
created = toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, { ... })
event_id = created.get("response_data", {}).get("id") or created.get("id")
toolset.execute_action(Action.GOOGLECALENDAR_UPDATE_EVENT, {
"calendar_id": "primary",
"event_id": event_id,
...
})In a multi-run script, you'd persist event_id somewhere (Sheet, Notion page, file) so the update step on a later run knows which event to touch. That's Auto Intermediate territory.
assert result.get("summary") == "zuzu-day-12 (updated)"The response from UPDATE_EVENT echoes the updated record. If our new summary is in the response, the write committed.
If event_id is None (because create silently failed or returned an unexpected shape), the update call will fail with a confusing error. Defensive:
if not event_id:
raise RuntimeError(f"create returned no id: {created!r}")A two-line guard saves a 20-minute debug session.
Day 10 created an event and got its ID. Day 12 uses that ID to update the event — change its summary, time, or description. Two-call shape: create-then-update.
# Step 1: create (we did this on day 10 — same shape, fresh event)
created = toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, {
"calendar_id": "primary",
"summary": "zuzu-day-12 (will be updated)",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 30,
})
event_id = created.get("response_data", {}).get("id") or created.get("id")
# Step 2: update — modify the summary
result = toolset.execute_action(Action.GOOGLECALENDAR_UPDATE_EVENT, {
"calendar_id": "primary",
"event_id": event_id,
"summary": "zuzu-day-12 (updated)",
"start_datetime": "2026-12-31T11:00:00+00:00",
"event_duration_minutes": 30,
})
print(result.get("summary"))The update API takes the same parameters as create, plus event_id?
Roughly. Some APIs allow partial updates (only changed fields); others want the full record. Calendar's update wants the full event record — fields not included get overwritten with their defaults. Always pass at least the same fields you set on create, or you risk wiping them.
And the verification?
Asserts result.get("summary") == "zuzu-day-12 (updated)" — confirms the update landed and we got the new value back. The API only returns the new summary if the update actually wrote it.
Updates take an existing resource and change one or more of its fields. They almost always need:
Different APIs treat the request body differently:
When in doubt, send the full record — safer.
In one script, just save the ID from create into a variable:
created = toolset.execute_action(Action.GOOGLECALENDAR_CREATE_EVENT, { ... })
event_id = created.get("response_data", {}).get("id") or created.get("id")
toolset.execute_action(Action.GOOGLECALENDAR_UPDATE_EVENT, {
"calendar_id": "primary",
"event_id": event_id,
...
})In a multi-run script, you'd persist event_id somewhere (Sheet, Notion page, file) so the update step on a later run knows which event to touch. That's Auto Intermediate territory.
assert result.get("summary") == "zuzu-day-12 (updated)"The response from UPDATE_EVENT echoes the updated record. If our new summary is in the response, the write committed.
If event_id is None (because create silently failed or returned an unexpected shape), the update call will fail with a confusing error. Defensive:
if not event_id:
raise RuntimeError(f"create returned no id: {created!r}")A two-line guard saves a 20-minute debug session.
Create a free account to get started. Paid plans unlock all tracks.