---
title: "Unsubscribe a pipeline from a mailbox"
method: DELETE
path: "/api/v1/pipelines/{pipelineId}/email-subscriptions/{subscriptionId}"
tags: ["Pipelines"]
---

# Unsubscribe a pipeline from a mailbox

`DELETE /api/v1/pipelines/{pipelineId}/email-subscriptions/{subscriptionId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/pipelines/{pipelineId}/email-subscriptions/{subscriptionId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Stops delivery to this pipeline. Gmail: deletes the Pub/Sub push subscription and, when nothing else subscribes to that mailbox, stops the Gmail watch and removes the topic. Outlook: deletes the Microsoft Graph subscription (already-missing counts as deleted); returns 502 provider_error and keeps the subscription if Graph refuses, so the call can be retried.

## Path parameters

- `pipelineId` string, required
- `subscriptionId` string, required

## Response `200`

The subscription was removed.

- object
  - `deleted` true, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.
- `502`: Response.

---

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