# Unsubscribe from public collection

Unsubscribes the mailbox from a public collection and removes its read grant.

## `DELETE /api/v1/identities/{identityId}/pim/subscriptions/{publicId}`

### Path parameters

- `identityId` (string, required) — Identity ULID identifier
- `publicId` (string, required) — Public directory listing ULID identifier

### Responses

**200** — Unsubscribed successfully

`application/json` → object

- `deleted` (boolean, required)

**401** — unauthorized: the bearer credential is missing, malformed, expired, or revoked. Carries a `WWW-Authenticate: Bearer` challenge

`application/json` → ErrorBody

**404** — Not subscribed

`application/json` → ErrorBody

**503** — temporary_failure: the platform's storage could not answer just now; retry after the Retry-After window. Any operation can answer this. A write that got it may have been applied, so retry it with the same idempotency key where it takes one, or read the state back first (see Transient failures in the API description)

`application/json` → ErrorBody

### Example request

```bash
curl -X DELETE 'https://api.open.email/api/v1/identities/{identityId}/pim/subscriptions/{publicId}' \
  -H 'Authorization: Bearer oek_…'
```

## TypeScript SDK

[`openemail.pim.unsubscribe`](/docs/sdks/typescript/pim/unsubscribe)

```ts
const result = await openemail.pim.unsubscribe(identityId, publicId)
```
