---
title: "How a workspace changes owner"
description: "A workspace changes owner only when both people agree. The owner offers it to one of its members, and that member accepts or declines. Over the API the owner reads, makes and withdraws the offer, and the member lists and answers the offers made to them."
url: "https://nextmail.sh/docs/api/workspaces/ownership"
area: "API"
category: "Your account"
---

# How a workspace changes owner

A workspace changes owner only when both people agree. The owner offers it to one of its members, and that member accepts or declines. Over the API the owner reads, makes and withdraws the offer, and the member lists and answers the offers made to them.

## Offering the workspace

`POST /workspaces/{id}/ownership-offer` with `{ "userId": "…" }` offers the workspace to one of its members, so they can become its owner and take over its plan and billing. They are told by email and have 7 days to answer, and nothing changes until they accept.

**POST /workspaces/{id}/ownership-offer**

```
curl -X POST "$API/workspaces/10417196-e324-4283-af98-66ec62167c47/ownership-offer" -H "$AUTH" \
  -H "Content-Type: application/json" -d '{ "userId": "kZ8nR2vX5qT1wL7mB4cY9hF3sJ6dG0aE" }'

{
  "object": "ownership_offer",
  "workspaceId": "10417196-e324-4283-af98-66ec62167c47",
  "to": { "userId": "kZ8nR2vX5qT1wL7mB4cY9hF3sJ6dG0aE", "name": "Ana Lima", "email": "ana@acme.com" },
  "offeredAt": "2026-10-25T09:00:00.000Z",
  "expiresAt": "2026-11-01T09:00:00.000Z"
}
```

- `{id}` is the workspace the key or the app belongs to, and any other id is a 404.
- The member has to have confirmed their email address and may not be a password sign-in for one address, or the offer is a 409 `ownership_not_eligible` or a 403 `mailbox_login`. Somebody who is not a member is a 422 `member_not_found`.
- A new offer replaces one that is waiting, and the person that one went to is told.
- `GET /workspaces/{id}/ownership-offer` reads the offer while it waits, and is a 404 `ownership_offer_not_found` when none does.
- `DELETE /workspaces/{id}/ownership-offer` withdraws it before it is answered, and the person it went to is told. `withdrawn` is false when no offer was waiting.
- While a domain is being moved into or out of the workspace, offering and accepting are a 409 `domain_moving`.

## Answering an offer

`GET /account/ownership-offers` lists the offers waiting for the person, in any workspace they belong to, each with `workspaceId`, `workspaceName`, the owner who made it in `from`, and `expiresAt`.

- `POST /account/ownership-offers/{workspaceId}/accept` makes the person the owner, with the plan and billing. The owner who made the offer stays in the workspace, usually with the Admin role, which `previousOwnerRoleName` names, and is told.
- `POST /account/ownership-offers/{workspaceId}/decline` declines it. The owner is told, and nothing else changes.
- An offer that is not waiting for the person, because it ended, was withdrawn or went to somebody else, is a 404 `ownership_offer_not_found`.
- Accepting a workspace that requires two-factor sign-in is a 403 `two_factor_required` until the person has an authenticator app or a passkey. An account that already owns a workspace on the Starter plan cannot take over another one on Starter (403 `workspace_allowance_reached`), and a workspace that changed while the answer was on its way is a 409 `ownership_changed`.

## Verification codes

- An OAuth access token needs a verification code to make an offer and to accept one, as the app asks the person for their own. Until the app has verified one in the last 60 minutes, those two calls answer `403` `step_up_required` and change nothing.
- Withdrawing and declining ask for no code, as in the app, because they hand nothing over.

- [Verification codes](https://nextmail.sh/docs/api/authentication#step-up): How an app asks for a code and verifies it.

## Who can do it

- Reading needs `account:read`, and every change or answer needs `account:write`, which no role limits.
- Only the owner makes or withdraws the offer, in the app or through an app they connected. An access token acting for a member is refused with 403 `owner_only`, and reading the offer answers it with a 404, as the app shows the offer to the owner alone. An app limited to particular addresses or domains is refused making or withdrawing it with 422 `capability_unsupported`, because the owner holds every address.
- An offer is answered by the person it went to, in the app or through an app they connected.
- An API key never hands a workspace over. It can read the offer and the offers waiting for the owner it acts for, but making, withdrawing, accepting or declining one is a 403 `console_only`, because handing a workspace over is confirmed with a verification code and a key cannot give one.

## From code, the terminal and agents

In the SDKs the owner side is `getOwnershipOffer`, `offerOwnership` and `withdrawOwnershipOffer` under `workspaces`, and the answering side `listOwnershipOffers`, `acceptOwnershipOffer` and `declineOwnershipOffer` under `account`. The CLI has the same commands under `workspaces` and `account`, and the MCP tools have the same names. In a chat, each tool that changes something asks first.

- [REST API](https://nextmail.sh/docs/api/reference/workspaces.md): The offer of a workspace, with the other workspace operations.
- [TypeScript SDK](https://nextmail.sh/docs/sdk/reference/workspaces.md): The methods of `workspaces`.
- [CLI](https://nextmail.sh/docs/cli/reference/workspaces.md): The `workspaces` commands.
- [MCP tools](https://nextmail.sh/docs/mcp/tools/account.md): The account tools, the answers to an offer among them.
