---
title: "Remove an endpoint from a mailbox"
method: DELETE
path: "/v1/mailboxes/{id}/endpoints/{endpointId}"
tags: ["Mailboxes"]
---

# Remove an endpoint from a mailbox

`DELETE /v1/mailboxes/{id}/endpoints/{endpointId}`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/mailboxes/{id}/endpoints/{endpointId}`
- Auth: API key in header `x-api-key`

Removes an endpoint from a mailbox and returns the mailbox. Messages sent to it stop reaching the mailbox; its existing threads and messages stay, and replies in them leave from the mailbox's default endpoint on their channel. A mailbox keeps at least one endpoint, so removing the last one is refused (422). When the removed endpoint was the default on its channel, the oldest remaining endpoint there becomes the default.

## Path parameters

- `id` string, required
- `endpointId` string, required

## Response `200`

Mailbox

- Mailbox
  - `id` string, required
  - `namespaceId` string, required
  - `slug` string, required
  - `name` string, required
  - `status` 'active' | 'paused', required
  - `primaryAddress` string, nullable, required
  - `createdAt` string, required
  - `description` string, nullable, required
  - `metadata` MailboxMetadata, required
  - `endpoints` MailboxEndpoint[], required
    - `id` string, required
    - `address` string, required
    - `displayName` string, nullable, required
    - `default` boolean, required
    - `channel` 'email', required
    - `source` 'samvaHosted' | 'verifiedDomain', required
    - `domainId` string, nullable, required
  - `updatedAt` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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