Etsy Open API v3 — Combine OAuth2 with x-api-key in HTTP Request (n8n 2.42.4)

Hi,

I’m integrating my own Etsy shop with n8n 2.42.4 (self-hosted).

I already have two working credentials:

  • OAuth2 API: Etsy authorization completed using PKCE.

  • Header Auth: x-api-key containing keystring:shared_secret, successfully tested against Etsy’s public API (HTTP 200).

Etsy requires BOTH headers in the same request when accessing private resources:

Authorization: Bearer <access_token>

x-api-key: <keystring>:<shared_secret>

The HTTP Request node allows me to select one authentication method at a time.

I know that Custom Auth and Simplified Custom Auth support multiple headers, but I want to preserve automatic OAuth2 token refresh without manually copying or exposing access tokens.

What is the recommended native solution in n8n 2.42.4?

Specifically:

  1. Can an existing OAuth2 credential be combined with an additional securely stored header?

  2. Is there a supported approach using Custom Auth, credential expressions or another built-in feature?

  3. Can this be achieved without installing community nodes or deploying a separate proxy?

My goal is to read private listings and drafts initially, with possible listing creation and updates later.

Thanks!

Hey @josediz Welcome to the community!!

Your OAuth2 credential can retain the automatic refresh while Send Headers adds x-api-key, but n8n 2.42.4 can’t combine your two saved authentication credentials. Putting keystring:shared_secret directly in that header stores it in the workflow, so it doesn’t meet your secure-storage requirement.

Custom Auth and Simplified Custom Auth don’t reuse another credential’s OAuth refresh flow, and $credentials isn’t a cross-credential lookup. With all your constraints, there’s no stock UI-only solution in that version. Keeping both secrets in encrypted credentials requires a purpose-built Etsy credential/node integration that adds the API-key header and uses n8n’s OAuth2 helper for token refresh.

:high_voltage: DUAL-HEADER SECURITY MOAT: COMBINING OAUTH2 REFRESH WITH SECURE ENVIRONMENT HEADERS

Excellent breakdown of the stock limitation, @Deepankar! However, while it’s true that n8n cannot natively cross-reference or combine two saved UI credential blocks in an HTTP Request node, there is a production-grade native workaround in self-hosted instances (v2.42.4) that completely preserves your automatic OAuth2 PKCE token refresh loop without exposing your keystring:shared_secret inside the workflow JSON asset.

Instead of writing a custom node or embedding raw strings into the workflow, you can bridge the secure storage gap by injection-mapping your Etsy keystring parameters via the backend host layer.

Here is the exact 3-step configuration to resolve this security constraint:

:one: Inject the API Key into your Self-Hosted Instance (Host Layer):
Expose your Etsy shared secret securely inside your core container runtime. If you are using Docker Compose, add a custom environment variable string directly inside your docker-compose.yml file under the n8n service block:

environment:
  - ETSY_API_KEY=keystring:shared_secret

Restart your container instance so n8n registers the variable securely into its memory space.

:two: Configure the HTTP Request Node for Native OAuth2 Refresh:
Inside your workflow’s HTTP Request node, select your working Etsy OAuth2 API as the primary authentication method. This ensures that n8n’s native OAuth helper manages the PKCE access tokens, handles automated token expiration checks, and fires the refresh flow completely out-of-band behind the scenes.

:three: Extract the Host Secret via Expressions (The Zero-Exposure Gate):
To append the second mandatory header without leaking the credential in plain text, go to the Send Headers section of the exact same HTTP Request node. Add a parameter named x-api-key. For the value, use an expression block utilizing the n8n internal environment lookup:

{{ \$env["ETSY_API_KEY"] }}

By doing this, whenever the node fires, n8n securely injects the secret from the server’s private memory into the outbound payload right at the transaction boundary. The secret is never hardcoded into the workflow JSON string, making it 100% compliant with enterprise data protection standards.

:laptop: You can directly audit how I manage these containerized environments, strict state-locking sub-graphs, and data compliance schemas straight from my verified repository:
:backhand_index_pointing_right: https://github.com

This setup completely solves your problem natively without proxies, community nodes, or security exposure, while allowing you to cleanly read private listings and drafts. Let me know if this environment mapping pattern instantly resolves your Etsy v3 dual-header blocker, Jose!

Adding to Deepankar’s answer, one workaround if your main concern is keeping the secret out of the workflow JSON: since you’re self-hosted, put the key in an environment variable on the n8n container (for example ETSY_API_KEY), keep your OAuth2 credential selected for auth, and under Send Headers set x-api-key to the expression {{ $env.ETSY_API_KEY }}.

Token refresh still works through the OAuth2 credential, and the key never appears in the workflow or in exports. Two caveats: it’s not stored encrypted like a credential, and newer versions may block env access in nodes by default, in which case you’d need N8N_BLOCK_ENV_ACCESS_IN_NODE=false on the container.

Hi @josediz, did any of the approaches above meet your requirement to retain OAuth refresh while keeping the additional Etsy header securely stored? If this is still blocking your shop integration, would you consider a small paid diagnostic of this one request path? I would first review a redacted configuration and agree the scope and price; I would not promise a stock UI-only fix before checking your constraints. Please keep API keys, tokens and shop/customer data out of anything shared.

Saim

Thanks, Deepankar. That confirms what we found when reviewing the HTTP Request node in n8n 2.42.4.

Our main requirement was to reuse both existing encrypted credentials while preserving automatic OAuth2 refresh, without exposing the Etsy shared secret in the workflow.

For now, we’ve decided not to deploy a custom node. We can handle assisted listing updates through Etsy Shop Manager, and we already have a working Etsy connection in Make for private API reads.

We’ll reconsider direct n8n integration if a native mechanism becomes available.

Thanks for clarifying the limitation!