Notion API · api · fg-0465

Retrying a Notion page create after a 502 or 503 leaves duplicate pages in the database

If you see Request to Notion API failed with status: 502, the cause and the fix for Notion API are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Request to Notion API failed with status: 502503 service_unavailable followed by two identical rows after a retryBulk import of a few thousand pages ends with more rows than the source
Cause
Notion can save a write and still answer with a timeout, so a blind retry of POST or PATCH repeats it. Notion's guidance is to retry 5xx only for GET and DELETE unless the caller has its own idempotency check, and the JS SDK follows that rule.
Fix
Before retrying a create, query for the row by a unique property you set on it. On 503, read additional_data.retry_guidance before deciding.
Apply
const hit = await notion.dataSources.query({ data_source_id, filter: { property: "External ID", rich_text: { equals: extId } } }); if (hit.results.length === 0) await notion.pages.create(payload);
Affected
Notion REST API and @notionhq/client 5.x retry behavior, as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun