Skip to content

Conversation

@cjbell
Copy link
Contributor

@cjbell cjbell commented Oct 17, 2025

Description

This PR adds documentation for the new default Content-Type: application/json header that Knock automatically adds to HTTP fetch steps and webhook channel steps when request bodies are present (implemented in https://github.com/knocklabs/switchboard/pull/4793).

What changed:

  • Added "Default headers" section to fetch function documentation (content/designing-workflows/fetch-function.mdx)
  • Added "Default headers" section to webhook overview documentation (content/integrations/webhook/overview.mdx)
  • Both sections explain the automatic header addition, user override capability, and GET/empty body behavior

Why:
Users need to understand that Knock now automatically adds standards-compliant Content-Type headers to requests with bodies, and that they can override this behavior if needed.

Key points documented:

  1. Content-Type: application/json is automatically added when a request body is present
  2. Users can override by explicitly setting their own Content-Type header
  3. No default header is added for GET requests or requests without bodies

Human review checklist

  • Verify documentation accurately reflects the switchboard implementation behavior
  • Check that the wording clearly explains the override mechanism
  • Confirm the examples given (application/xml, text/plain) are appropriate
  • Ensure section placement makes sense in the document flow
  • Verify consistency between fetch function and webhook documentation

Tasks


Session info:


Note

Documents automatic Content-Type: application/json for requests with bodies in fetch and webhook steps, including override support and no default for GET/empty body.

  • Docs:
    • content/designing-workflows/fetch-function.mdx:
      • Adds a new "Default headers" section explaining automatic Content-Type: application/json when a request body is present, ability to override via explicit header, and no default for GET/no-body.
    • content/integrations/webhook/overview.mdx:
      • Adds a matching "Default headers" section detailing the same default/override behavior and exception for GET/no-body.

Written by Cursor Bugbot for commit 6996ad5. This will update automatically on new commits. Configure here.

- Add section explaining default Content-Type: application/json header
- Document that users can override the default header
- Clarify that no header is added for GET requests or empty bodies
- Apply documentation to both fetch function and webhook channel pages

Co-Authored-By: Chris Bell <cjbell1988@gmail.com>
@linear
Copy link

linear bot commented Oct 17, 2025

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Oct 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 17, 2025 7:22pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Contributor

@cellomatt cellomatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Should we also document the User-Agent: Knock/1.0 (https://docs.knock.app/http-fetch-function) header?

(I'm not sure how that looks on a webhook send, actually)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants