Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions fern/products/sdks/guides/configure-idempotency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ title: Configure Idempotency Headers
description: SDKs that safely support retrying requests
---

<Markdown src="/snippets/pro-callout.mdx" />
For endpoints you've configured as idempotent, Fern's SDKs allow you to
specify idempotency headers. Typically the headers include `Idempotency-Key`,
but you can also specify additional headers.

For any idempotent endpoints, Fern's SDKs will allow you to specify idempotency headers.
Typically the headers include `Idempotency-Key`, but you can also specify additional headers.
## How it works for SDK users

Your SDK users can specify an idempotency header like this:

<CodeBlocks>
<CodeBlock title="TypeScript">
Expand Down Expand Up @@ -55,15 +58,17 @@ Typically the headers include `Idempotency-Key`, but you can also specify additi
</CodeBlock>
</CodeBlocks>

Note that the generated SDKs will not allow you to specify idempotency headers
<Note>
The generated SDKs will not allow users to specify idempotency headers
for non-idempotent endpoints. This is to ensure that the user knows exactly
which invocations are idempotent and which are not.
</Note>

### Configuration
## Configuring idempotency headers

To enable idempotency headers in your API, you need to do the following in your overrides file:
To set up idempotency headers in your API, you need to do the following in your `overrides` file:
1. Configure the idempotency headers
2. Mark individual endpoints as idempotent
1. Mark individual endpoints as idempotent

<Tabs>
<Tab title="OpenAPI">
Expand Down Expand Up @@ -97,7 +102,7 @@ To enable idempotency headers in your API, you need to do the following in your
Idempotency-Expiration: integer
```
</CodeBlock>
<CodeBlock title="openapi-overrides.yml">
<CodeBlock title="service.yml">
```yaml
# Mark an individual endpoint as idempotent
endpoints:
Expand Down