Safe retries on write requests with Idempotency-Key
Every write (POST, PUT, PATCH, DELETE) requires an Idempotency-Key
header — in both production and sandbox. It makes retries safe: a network
timeout on POST /bookings can be retried without double-booking.
The original response is replayed. No second operation.
Same key, different body
409idempotency.key.conflict. No action performed.
New key
Processed normally.
Generate the key before the first attempt and reuse the same key for every
retry of that operation. Generating a fresh key per retry defeats the protection.
Send the request. On 2xx/4xx (except 429), you have a definitive answer — stop.
On timeout, 5xx, or 429, retry with the same key after a backoff.
A replayed success returns the original body — safe to treat as success.
Idempotency is independent from request signing:
sandbox sk_test_* keys skip the signature but still require Idempotency-Key.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SafarAPI","description":"Developer documentation for the SafarAPI partner channel — quote, book and settle Moroccan adventures from your app.","colors":{"primary":"#f2460d","light":"#fb923c","dark":"#c2410c"},"logo":{"light":"https://mintcdn.com/safariat/uq0i7jK0LmN_yZ-e/logo/safarapi-light.svg?fit=max\u0026auto=format\u0026n=uq0i7jK0LmN_yZ-e\u0026q=85\u0026s=6e54d448368f1737309eebb08e5e571c","dark":"https://mintcdn.com/safariat/uq0i7jK0LmN_yZ-e/logo/safarapi-dark.svg?fit=max\u0026auto=format\u0026n=uq0i7jK0LmN_yZ-e\u0026q=85\u0026s=007f52ec9befa6071011db06b432b61d"},"favicon":"https://mintcdn.com/safariat/uq0i7jK0LmN_yZ-e/favicon.svg?fit=max\u0026auto=format\u0026n=uq0i7jK0LmN_yZ-e\u0026q=85\u0026s=a5d5d7ecbe37e9205bda58ca868f2853","api":{"playground":{"display":"interactive","proxy":true}},"navbar":{"links":[{"href":"/status","label":"Status"},{"href":"https://console.safarapi.com","label":"Console"}],"primary":{"type":"button","label":"Get sandbox access","href":"https://console.safarapi.com/signup"}},"footer":{"socials":{"website":"https://safarapi.com","linkedin":"https://www.linkedin.com/company/safarapi"}},"search":{"prompt":"Search the SafarAPI docs — quotes, bookings, webhooks, settlements"},"seo":{"metatags":{"og:title":"SafarAPI — Morocco travel API for banks \u0026 fintechs","og:description":"Quote, book and settle curated Moroccan travel from your banking app. Sandbox in minutes, production in 7 days.","og:type":"website"},"indexing":"navigable"},"fonts":{"heading":{"family":"Space Grotesk"},"body":{"family":"Inter"}},"styling":{"eyebrows":"section","codeblocks":{"theme":"github-dark-dimmed"},"latex":false},"errors":{"404":{"redirect":false,"title":"Page not found","description":"This page does not exist. Start from the [welcome guide](/introduction/welcome), the [quickstart](/introduction/quickstart), or the [API reference](/api-reference/openapi)."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"safariat","hasAudioNarration":false,"actualSubdomain":"safariat","customDomains":["developers.safarapi.com"],"gitSource":{"type":"github","owner":"adnanahouzi","repo":"maroc-voyages-r-v-s","deployBranch":"main","contentDirectory":"docs-portal","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a9c766b0d95020accd6ba30","collectionId":"ffbff38d-bd54-4930-96e6-24689d9a11de","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6a9c766b0d95020accd6ba30"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a9c766b0d95020accd6ba30","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API Reference","count":67},{"language":"default","tag":"Endpoints","count":58},{"language":"default","tag":"Guides","count":22},{"language":"default","tag":"API concepts","count":10},{"language":"default","tag":"Catalog","count":8},{"language":"default","tag":"Webhooks","count":7},{"language":"default","tag":"Bookings","count":6},{"language":"default","tag":"Dashboard","count":5},{"language":"default","tag":"Settlements","count":5},{"language":"default","tag":"Introduction","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":":root{--safarapi-ink: #1a1a1a;--safarapi-rule: #ececec;--safarapi-accent: #f2460d}.dark{--safarapi-ink: #ededed;--safarapi-rule: #2a2a2a;--safarapi-accent: #fb923c}body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}main p,main li{line-height:1.68}main h2{margin-top:2.5rem;letter-spacing:-0.01em}main h3{margin-top:1.75rem}main a:not([class]){color:var(--safarapi-accent);text-decoration:none;border-bottom:1px solid transparent;transition:border-color 120ms ease}main a:not([class]):hover{border-bottom-color:currentColor}pre,code{border:1px solid var(--safarapi-rule);border-radius:6px}pre{box-shadow:none}table{border-collapse:collapse}table th,table td{border-color:var(--safarapi-rule)}a:focus-visible,button:focus-visible{outline:2px solid var(--safarapi-accent);outline-offset:2px}"}],"page":{"pagePath":"api-concepts/idempotency","slug":"/api-concepts/idempotency","pageMetadata":{"title":"Idempotency","description":"Safe retries on write requests with Idempotency-Key","href":"/api-concepts/idempotency"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Safe retries on write requests with Idempotency-Key\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Every write (`,_jsx(_components.code,{children:`POST`}),`, `,_jsx(_components.code,{children:`PUT`}),`, `,_jsx(_components.code,{children:`PATCH`}),`, `,_jsx(_components.code,{children:`DELETE`}),`) requires an `,_jsx(_components.code,{children:`Idempotency-Key`}),`\nheader — in `,_jsx(_components.strong,{children:`both`}),` production and sandbox. It makes retries safe: a network\ntimeout on `,_jsx(_components.code,{children:`POST /bookings`}),` can be retried without double-booking.`]}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-dark-dimmed github-dark-dimmed`,style:{backgroundColor:`#22272e`,\"--shiki-dark-bg\":`#22272e`,color:`#adbac7`,\"--shiki-dark\":`#adbac7`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Idempotency-Key: 3f1c6b90-8e2a-4d77-b5c4-9a0e1f2d3c4b`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`UUID v4`}),`, unique per logical operation (one per booking attempt, not one per process).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`255 characters maximum`}),`. A longer key is rejected with `,_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`idempotency.key.too.long`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Retained `,_jsx(_components.strong,{children:`24 hours`}),`. After that the key is forgotten and a reuse is treated as a new operation.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`semantics`,children:`Semantics`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Situation`}),_jsx(_components.th,{children:`Result`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Same key, same body`}),_jsx(_components.td,{children:`The original response is replayed. No second operation.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Same key, different body`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`idempotency.key.conflict`}),`. `,_jsx(_components.strong,{children:`No action performed.`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`New key`}),_jsx(_components.td,{children:`Processed normally.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Generate the key `,_jsx(_components.strong,{children:`before`}),` the first attempt and reuse the `,_jsx(_components.em,{children:`same`}),` key for every\nretry of that operation. Generating a fresh key per retry defeats the protection.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`recommended-retry-pattern`,children:`Recommended retry pattern`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Mint one `,_jsx(_components.code,{children:`Idempotency-Key`}),` for the operation.`]}),`\n`,_jsxs(_components.li,{children:[`Send the request. On `,_jsx(_components.code,{children:`2xx`}),`/`,_jsx(_components.code,{children:`4xx`}),` (except `,_jsx(_components.code,{children:`429`}),`), you have a definitive answer — stop.`]}),`\n`,_jsxs(_components.li,{children:[`On timeout, `,_jsx(_components.code,{children:`5xx`}),`, or `,_jsx(_components.code,{children:`429`}),`, retry `,_jsx(_components.strong,{children:`with the same key`}),` after a backoff.`]}),`\n`,_jsx(_components.li,{children:`A replayed success returns the original body — safe to treat as success.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Idempotency is independent from `,_jsx(_components.a,{href:`/introduction/authentication`,children:`request signing`}),`:\nsandbox `,_jsx(_components.code,{children:`sk_test_*`}),` keys skip the signature but still require `,_jsx(_components.code,{children:`Idempotency-Key`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":"github-dark-dimmed"},"config":{},"pageMetadata":{"title":"Idempotency","description":"Safe retries on write requests with Idempotency-Key","href":"/api-concepts/idempotency"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Semantics","slug":"semantics","depth":2,"children":[]},{"title":"Recommended retry pattern","slug":"recommended-retry-pattern","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/safariat/f751755c840beb5a/trust/tools/generate-cobranded-pdf.js"],"subdomain":"safariat","siteName":"SafarAPI","title":"SafarAPI — Morocco travel API for banks \u0026 fintechs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-18T12:19:58.633Z","originalFileLocation":"api-concepts/idempotency.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Safe retries on write requests with Idempotency-Key\">\u003cmeta data-mint-head name=\"application-name\" content=\"SafarAPI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SafarAPI — Morocco travel API for banks \u0026amp; fintechs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Quote, book and settle curated Moroccan travel from your banking app. Sandbox in minutes, production in 7 days.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SafarAPI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.safarapi.com/api-concepts/idempotency\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://safariat.mintlify.site/_mintlify/api/og/v2?division=API+concepts\u0026amp;title=Idempotency\u0026amp;description=Safe+retries+on+write+requests+with+Idempotency-Key\u0026amp;theme=3b8c95b43b12f994ae542965\u0026amp;signature=d1043ff80009ff2cb899133fb22e593f24e2b5a17556eb03707c1e2937675b6c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SafarAPI — Morocco travel API for banks \u0026amp; fintechs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Quote, book and settle curated Moroccan travel from your banking app. Sandbox in minutes, production in 7 days.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://safariat.mintlify.site/_mintlify/api/og/v2?division=API+concepts\u0026amp;title=Idempotency\u0026amp;description=Safe+retries+on+write+requests+with+Idempotency-Key\u0026amp;theme=3b8c95b43b12f994ae542965\u0026amp;signature=d1043ff80009ff2cb899133fb22e593f24e2b5a17556eb03707c1e2937675b6c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/safariat/edKFf_9gmlxKUwaY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SafarAPI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#f2460d\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.safarapi.com/api-concepts/idempotency\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-concepts/idempotency.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.safarapi.com/#organization\",\"name\":\"SafarAPI\",\"url\":\"https://developers.safarapi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/safariat/uq0i7jK0LmN_yZ-e/logo/safarapi-light.svg?fit=max\u0026auto=format\u0026n=uq0i7jK0LmN_yZ-e\u0026q=85\u0026s=6e54d448368f1737309eebb08e5e571c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.safarapi.com#website\",\"name\":\"SafarAPI\",\"url\":\"https://developers.safarapi.com\",\"publisher\":{\"@id\":\"https://developers.safarapi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.safarapi.com/api-concepts/idempotency#webpage\",\"url\":\"https://developers.safarapi.com/api-concepts/idempotency\",\"name\":\"Idempotency\",\"description\":\"Safe retries on write requests with Idempotency-Key\",\"dateModified\":\"2026-08-18T12:19:58.633Z\",\"isPartOf\":{\"@id\":\"https://developers.safarapi.com#website\"},\"breadcrumb\":{\"@id\":\"https://developers.safarapi.com/api-concepts/idempotency#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.safarapi.com/api-concepts/idempotency#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API concepts\",\"item\":\"https://developers.safarapi.com/api-concepts/errors\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Idempotency\",\"item\":\"https://developers.safarapi.com/api-concepts/idempotency\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://developers.safarapi.com/api-concepts/idempotency#article\",\"headline\":\"Idempotency\",\"name\":\"Idempotency\",\"description\":\"Safe retries on write requests with Idempotency-Key\",\"url\":\"https://developers.safarapi.com/api-concepts/idempotency\",\"mainEntityOfPage\":{\"@id\":\"https://developers.safarapi.com/api-concepts/idempotency#webpage\"},\"dateModified\":\"2026-08-18T12:19:58.633Z\",\"publisher\":{\"@id\":\"https://developers.safarapi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.safarapi.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SafarAPI\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"SafarAPI","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Introduction","pages":[{"title":"Welcome to SafarAPI","href":"/introduction/welcome"},{"title":"5-minute quickstart","href":"/introduction/quickstart"},{"title":"Authentication","href":"/introduction/authentication"},{"title":"Sandbox","href":"/introduction/sandbox"}]},{"group":"Concepts","pages":[{"title":"Quotes","href":"/concepts/quotes"},{"title":"Bookings","href":"/concepts/bookings"}]},{"group":"API concepts","pages":[{"title":"Errors","description":"Error envelope, HTTP status mapping, and the stable error codes","href":"/api-concepts/errors"},{"title":"Idempotency","href":"/api-concepts/idempotency"},{"title":"Pagination","description":"Opaque cursor pagination on list endpoints","href":"/api-concepts/pagination"},{"title":"Rate limiting","href":"/api-concepts/rate-limiting"},{"title":"Money \u0026 currency","href":"/api-concepts/money"},{"title":"Localization","href":"/api-concepts/localization"},{"title":"Webhooks","href":"/api-concepts/webhooks"},{"title":"Settlements \u0026 reconciliation","href":"/api-concepts/settlements"},{"title":"Troubleshooting","href":"/api-concepts/troubleshooting"},{"title":"Glossary","href":"/api-concepts/glossary"}]},{"group":"Security \u0026 Compliance","pages":[{"title":"Security \u0026 Compliance","href":"/security/overview"}]},{"group":"Trust \u0026 Legal","pages":[{"title":"Data Processing Agreement","href":"/trust/dpa"},{"title":"Service Level Agreement","href":"/trust/sla"},{"title":"Security Attestations","href":"/trust/attestations"}]},{"group":"Service status","pages":[{"title":"Service status","href":"/status/index"}]},{"group":"Changelog","pages":[{"title":"Changelog","href":"/changelog/overview"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/openapi"}]}]},"basePath":"","title":"SafarAPI — Morocco travel API for banks \u0026 fintechs","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":[],"chunks":[]}