> ## Documentation Index
> Fetch the complete documentation index at: https://agentmail.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://agentmail.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://agentmail.manicule.dev/api/mcp.
> Every agent surface: https://agentmail.manicule.dev/.well-known/llms-manifest.json

# Update Webhook Headers (/api-reference/update-webhook-headers-2)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1371 · updated: 2026-09-29 -->
Related: [Sign Up](/api-reference/sign-up.md), [Attach Human](/api-reference/attach-human.md), [Verify](/api-reference/verify.md), [List Inboxes](/api-reference/list-inboxes.md), [Create Inbox](/api-reference/create-inbox.md), [Search Inboxes](/api-reference/search-inboxes.md)

# Update Webhook Headers

`PATCH /v0/webhooks/{webhook_id}/headers`

> Atomically set, replace, or remove custom HTTP headers included with deliveries to this webhook.
> Header values remain write-only.

Base URL: `https://api.agentmail.to`

Base URL: `https://x402.api.agentmail.to`

Base URL: `https://mpp.api.agentmail.to`

Base URL: `https://api.agentmail.eu`

## OpenAPI

```json
{
  "servers": [
    {
      "url": "https://api.agentmail.to",
      "description": "prod"
    },
    {
      "url": "https://x402.api.agentmail.to",
      "description": "prod-x402"
    },
    {
      "url": "https://mpp.api.agentmail.to",
      "description": "prod-mpp"
    },
    {
      "url": "https://api.agentmail.eu",
      "description": "eu-prod"
    }
  ],
  "security": [
    {
      "Bearer": []
    }
  ],
  "securitySchemes": {
    "Bearer": {
      "type": "http",
      "scheme": "bearer"
    }
  },
  "parameters": [
    {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "description": "ID of webhook.",
        "title": "WebhookId"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "headers": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "description": "Custom HTTP headers to include with every delivery to this webhook. Header values are write-only:\nAgentMail never returns them from webhook read endpoints. The map must contain at least one entry\nwhen provided, and every name and value must be a valid HTTP header.",
              "title": "WebhookHeaders"
            },
            "remove_headers": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Names of custom delivery headers to remove."
            }
          },
          "description": "Set, replace, or remove custom delivery headers. Provide at least one of `headers` or\n`remove_headers`. A header cannot be set and removed in the same request, regardless of casing.",
          "title": "UpdateWebhookHeadersRequest"
        }
      }
    }
  },
  "responses": {
    "204": {
      "description": "Response with status 204",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {}
          }
        }
      }
    },
    "400": {
      "description": "Error response with status 400",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of error.",
                "title": "ErrorName"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.",
                "title": "ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Error message.",
                "title": "ErrorMessage"
              },
              "errors": {
                "description": "Validation errors. Each entry has a path and a message identifying the invalid field."
              },
              "fix": {
                "type": "string",
                "description": "The concrete next action that resolves the error.",
                "title": "ErrorFix"
              },
              "docs": {
                "type": "string",
                "description": "Link to the error reference entry for this code.",
                "title": "ErrorDocs"
              }
            },
            "required": [
              "name",
              "errors"
            ],
            "title": "ValidationErrorResponse"
          }
        }
      }
    },
    "404": {
      "description": "Error response with status 404",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of error.",
                "title": "ErrorName"
              },
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text.",
                "title": "ErrorCode"
              },
              "message": {
                "type": "string",
                "description": "Error message.",
                "title": "ErrorMessage"
              },
              "fix": {
                "type": "string",
                "description": "The concrete next action that resolves the error.",
                "title": "ErrorFix"
              },
              "docs": {
                "type": "string",
                "description": "Link to the error reference entry for this code.",
                "title": "ErrorDocs"
              }
            },
            "required": [
              "name",
              "message"
            ],
            "title": "ErrorResponse"
          }
        }
      }
    }
  }
}
```
