# Remove another user's access to this mailbox

Takes away an identity's access to this mailbox. Access stops immediately — rights are re-read on every request, so a session that is already open loses the mailbox on its next operation rather than at some later expiry.

The read/unread marks that identity had made in this mailbox are their own, and are discarded with the grant. Nothing belonging to the mailbox owner is deleted.

## `DELETE /api/v1/mailboxes/{mailboxId}/shares/{granteeIdentityId}`

### Path parameters

- `mailboxId` (string, required) — ULID of the mailbox whose access is being managed
- `granteeIdentityId` (string, required) — ULID of the identity being given (or losing) access

### Responses

**200** — The grant was removed

`application/json` → DeletedResult

- `deleted` (boolean, required) — True if the resource was successfully deleted

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

`application/json` → ErrorBody

**404** — `not_found` — the mailbox does not exist or is not yours to manage, or that identity had no grant on it

`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/mailboxes/{mailboxId}/shares/{granteeIdentityId}' \
  -H 'Authorization: Bearer oek_…'
```

## TypeScript SDK

[`openemail.mailboxShares.revoke`](/docs/sdks/typescript/mailbox-shares/revoke)

```ts
const deletedResult = await openemail.mailboxShares.revoke(mailboxId, granteeIdentityId)
```
