---
title: "Set or update the mailbox's webhook"
method: PUT
path: "/v1/domains/{domain}/mailboxes/{localPart}/webhook"
tags: ["Webhooks"]
---

# Set or update the mailbox's webhook

`PUT /v1/domains/{domain}/mailboxes/{localPart}/webhook`

## Request

- Base URL: `https://api.usemektup.com`
- URL: `https://api.usemektup.com/v1/domains/{domain}/mailboxes/{localPart}/webhook`
- Auth: HTTP bearer

Fires (HMAC-SHA256 signed) on every new inbound message - one URL per mailbox, setting a new one replaces the old. Must be https.

## Path parameters

- `domain` string, required
- `localPart` string, required

## Request body

- object
  - `url` string, uri, required: Must be https://
  - `regenerateSecret` boolean: Issue a new signing secret, invalidating the old one

## Response `200`

OK

- object
  - `address` string
  - `url` string, uri
  - `secret` string: Only present on first setup or when regenerateSecret was true - not recoverable later

## Other responses

- `400`: Invalid request
- `404`: Not found on this account (tenant-isolated - never reveals another account's data)

---

[API](https://skmtc.dev/usemektup/apis/mektup-api.md) · [All operations](https://skmtc.dev/usemektup/apis/mektup-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usemektup/apis/mektup-api/revisions/e394b91cbc53?raw)
