---
title: "Your account"
description: "The workspaces, email, photo, username, apps, invitations, signed-in devices and passkeys of the person."
url: "https://nextmail.sh/docs/mcp/tools/account"
area: "MCP server"
category: "Tools"
---

# Your account

The workspaces, email, photo, username, apps, invitations, signed-in devices and passkeys of the person.

## Your account tools

| Tool | What it does |
| --- | --- |
| listAccountWorkspaces | Every workspace your account can open, owned or joined, with the one the app opens for you and the one these tools act on. |
| switchAppWorkspace | Choose the workspace the app opens for you. These tools keep acting on the workspace they act on now. |
| createWorkspace | Create a workspace you own, on the Free plan, which the app opens for you from then on. An account can own one Free workspace. |
| deleteWorkspace | Delete the workspace these tools act on, with everything in it, once `confirm` names it. Only its owner may, and never the first workspace an account made. In the app’s chat it always asks first. |
| getNotificationSettings | Which kinds of email Nextmail sends you, and the workspaces muted on your phone. |
| setEmailNotification | Turn `activity` or `product` email on or off. `account` and `billing` email are always on. |
| setWorkspacePushMuted | Mute or unmute the phone notifications of one workspace. |
| setProfilePhoto | Set your profile photo from an image in base64. |
| removeProfilePhoto | Remove your profile photo. In the app’s chat it always asks first. |
| getUsername | Your username, whether you chose it, and the free address it gives you. |
| checkUsername | Whether you could choose a username, and why not when you could not. |
| chooseUsername | Choose your username for good, since it never changes once chosen. In the app’s chat it always asks first. |
| listConnectedApps | The apps you connected, with what each may reach and until when. |
| revokeConnectedApp | Remove a connected app, so it has to ask again. In the app’s chat it always asks first. |
| listReceivedInvitations | The invitations to join a workspace that wait for you. `listInvitations` is the one for the invitations a workspace sent. |
| acceptInvitation | Join the workspace of an invitation, and with `activate` make it the one the app opens. |
| declineInvitation | Turn an invitation down, for good. In the app’s chat it always asks first. |
| listSessions | The browsers and phones you are signed in on, each with its country and city, how it signed in and when it was last used. |
| revokeSession | Sign one browser or phone out, so its next request is refused. In the app’s chat it always asks first. |
| revokeOtherSessions | Sign every browser and phone out at once, the one you are using included, and with `connectedApps` remove every connected app too. In the app’s chat it always asks first. |
| listSecurityEvents | Your security log, newest first: sign-ins with their device and place, devices signed out, password and two-factor changes, and passkeys added or removed. Returned a page at a time. |
| listPasskeys | The passkeys that can sign in to your account, with the name of each, whether it is synced between your devices and when it was last used. |
| renamePasskey | Give a passkey a name you will recognise. |
| removePasskey | Remove a passkey, so it can no longer sign in or confirm a change. You are told by email. In the app’s chat it always asks first. |
| listConnectedAppRequests | The request log of an app you connected: each REST call it made, newest first, with its status and how long it took. |

> These tools act on the person who connected the client, never on anyone else, and in the app’s chat on you. Reading needs `account:read` and every change needs `account:write`, which no role limits, so a client a member connected reaches that member’s own account too.

> Three things stay in the app: changing what a connected app may reach, letting one make changes without a verification code, and deleting the whole account.

> The workspace tools never move the other tools: `switchAppWorkspace` changes what the app opens, and `setActiveConnection` what the tools act on.

> Some tools on this server make a change the REST API guards with a verification code, and ask for the same code. Until the client has verified a code in the last 60 minutes, or the person has chosen Allow changes for 60 minutes on it in Account → Connected apps, such a tool answers with a result that starts `Refused (step_up_required):` and changes nothing. `emptyAudience` never asks for a code. The API Authentication page lists every tool that asks, and shows how to ask for a code and verify it.

> A passkey is added in Account → General → Security on the device that holds it, never through a tool. `revokeOtherSessions` leaves nothing signed in: it signs out the browser or phone you are using as well, and with `connectedApps` it removes the client you are talking through.

## Reference

### `listAccountWorkspaces`

Every workspace your Nextmail account can open, the ones you own and the ones you joined, as the workspace switcher of the app lists them, with the one the app opens for you. It is about your account, not this connection: getConnections lists what these tools can act on, and switchAppWorkspace changes only what the app opens, never what these tools act on.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /workspaces`](https://nextmail.sh/docs/api/reference/workspaces#get-workspaces), [`GET /workspaces/active`](https://nextmail.sh/docs/api/reference/workspaces#get-workspaces-active); TypeScript [`nextmail.workspaces.list()`](https://nextmail.sh/docs/sdk/reference/workspaces#list), [`nextmail.workspaces.getActive()`](https://nextmail.sh/docs/sdk/reference/workspaces#getActive); Python [`workspaces.list()`](https://nextmail.sh/docs/python/reference/workspaces#list), [`workspaces.get_active()`](https://nextmail.sh/docs/python/reference/workspaces#getActive); Ruby [`workspaces.list`](https://nextmail.sh/docs/ruby/reference/workspaces#list), [`workspaces.get_active`](https://nextmail.sh/docs/ruby/reference/workspaces#getActive); PHP [`workspaces->list`](https://nextmail.sh/docs/php/reference/workspaces#list), [`workspaces->getActive`](https://nextmail.sh/docs/php/reference/workspaces#getActive); Go [`Workspaces.List`](https://nextmail.sh/docs/go/reference/workspaces#list), [`Workspaces.GetActive`](https://nextmail.sh/docs/go/reference/workspaces#getActive); Java [`workspaces().list`](https://nextmail.sh/docs/java/reference/workspaces#list), [`workspaces().getActive`](https://nextmail.sh/docs/java/reference/workspaces#getActive); C# [`Workspaces.ListAsync`](https://nextmail.sh/docs/csharp/reference/workspaces#list), [`Workspaces.GetActiveAsync`](https://nextmail.sh/docs/csharp/reference/workspaces#getActive).

### `switchAppWorkspace`

Choose which workspace the Nextmail app opens for you, as the workspace switcher does. Pass a workspace id from listAccountWorkspaces. It changes the app only: these tools keep acting on the workspace they act on now.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `workspaceId` (`string`, required, 1 to 128 characters)

Also available in: API [`PUT /workspaces/active`](https://nextmail.sh/docs/api/reference/workspaces#put-workspaces-active); TypeScript [`nextmail.workspaces.setActive()`](https://nextmail.sh/docs/sdk/reference/workspaces#setActive); Python [`workspaces.set_active()`](https://nextmail.sh/docs/python/reference/workspaces#setActive); Ruby [`workspaces.set_active`](https://nextmail.sh/docs/ruby/reference/workspaces#setActive); PHP [`workspaces->setActive`](https://nextmail.sh/docs/php/reference/workspaces#setActive); Go [`Workspaces.SetActive`](https://nextmail.sh/docs/go/reference/workspaces#setActive); Java [`workspaces().setActive`](https://nextmail.sh/docs/java/reference/workspaces#setActive); C# [`Workspaces.SetActiveAsync`](https://nextmail.sh/docs/csharp/reference/workspaces#setActive).

### `createWorkspace`

Create a new workspace that you own, on the Free plan, and make it the one the app opens for you, as creating one in the app does. An account can own one Free workspace, so while you own one this is refused until you upgrade it.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `name` (`string`, required, 1 to 64 characters)

Also available in: API [`POST /workspaces`](https://nextmail.sh/docs/api/reference/workspaces#post-workspaces); TypeScript [`nextmail.workspaces.create()`](https://nextmail.sh/docs/sdk/reference/workspaces#create); Python [`workspaces.create()`](https://nextmail.sh/docs/python/reference/workspaces#create); Ruby [`workspaces.create`](https://nextmail.sh/docs/ruby/reference/workspaces#create); PHP [`workspaces->create`](https://nextmail.sh/docs/php/reference/workspaces#create); Go [`Workspaces.Create`](https://nextmail.sh/docs/go/reference/workspaces#create); Java [`workspaces().create`](https://nextmail.sh/docs/java/reference/workspaces#create); C# [`Workspaces.CreateAsync`](https://nextmail.sh/docs/csharp/reference/workspaces#create).

### `deleteWorkspace`

Delete the workspace these tools act on, with its domains, addresses, mail and members, and cancel its plan. It cannot be undone. Only its owner may do it, never through an app limited to some addresses, and your first workspace can never be deleted. confirm has to be the name of the workspace, as listAccountWorkspaces shows it.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`DELETE /workspaces/{id}`](https://nextmail.sh/docs/api/reference/workspaces#delete-workspaces-id).
- Toolkit: `account`.

**Inputs**

- `confirm` (`string`, required, 1 to 256 characters): The name of the workspace being deleted, typed out.

Also available in: API [`DELETE /workspaces/{id}`](https://nextmail.sh/docs/api/reference/workspaces#delete-workspaces-id); TypeScript [`nextmail.workspaces.delete()`](https://nextmail.sh/docs/sdk/reference/workspaces#delete); Python [`workspaces.delete()`](https://nextmail.sh/docs/python/reference/workspaces#delete); Ruby [`workspaces.delete`](https://nextmail.sh/docs/ruby/reference/workspaces#delete); PHP [`workspaces->delete`](https://nextmail.sh/docs/php/reference/workspaces#delete); Go [`Workspaces.Delete`](https://nextmail.sh/docs/go/reference/workspaces#delete); Java [`workspaces().delete`](https://nextmail.sh/docs/java/reference/workspaces#delete); C# [`Workspaces.DeleteAsync`](https://nextmail.sh/docs/csharp/reference/workspaces#delete).

### `getNotificationSettings`

Which kinds of email Nextmail sends you, as Account, Notifications shows them, and the workspaces whose notifications are muted on your phone. Account and billing email are always on.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/notifications`](https://nextmail.sh/docs/api/reference/your-account#get-account-notifications); TypeScript [`nextmail.account.getNotifications()`](https://nextmail.sh/docs/sdk/reference/account#getNotifications); Python [`account.get_notifications()`](https://nextmail.sh/docs/python/reference/account#getNotifications); Ruby [`account.get_notifications`](https://nextmail.sh/docs/ruby/reference/account#getNotifications); PHP [`account->getNotifications`](https://nextmail.sh/docs/php/reference/account#getNotifications); Go [`Account.GetNotifications`](https://nextmail.sh/docs/go/reference/account#getNotifications); Java [`account().getNotifications`](https://nextmail.sh/docs/java/reference/account#getNotifications); C# [`Account.GetNotificationsAsync`](https://nextmail.sh/docs/csharp/reference/account#getNotifications).

### `setEmailNotification`

Turn one kind of email from Nextmail on or off for you. activity and product can be turned off; account and billing cannot.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `category` (`string`, required, one of `"account"`, `"billing"`, `"activity"`, `"product"`)
- `enabled` (`boolean`, required)

Also available in: API [`PUT /account/notifications/email/{category}`](https://nextmail.sh/docs/api/reference/your-account#put-account-notifications-email-category); TypeScript [`nextmail.account.setEmailNotification()`](https://nextmail.sh/docs/sdk/reference/account#setEmailNotification); Python [`account.set_email_notification()`](https://nextmail.sh/docs/python/reference/account#setEmailNotification); Ruby [`account.set_email_notification`](https://nextmail.sh/docs/ruby/reference/account#setEmailNotification); PHP [`account->setEmailNotification`](https://nextmail.sh/docs/php/reference/account#setEmailNotification); Go [`Account.SetEmailNotification`](https://nextmail.sh/docs/go/reference/account#setEmailNotification); Java [`account().setEmailNotification`](https://nextmail.sh/docs/java/reference/account#setEmailNotification); C# [`Account.SetEmailNotificationAsync`](https://nextmail.sh/docs/csharp/reference/account#setEmailNotification).

### `setWorkspacePushMuted`

Mute or unmute the notifications of one workspace on your phone, on every phone you signed in on. Pass a workspace id from listAccountWorkspaces.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `workspaceId` (`string`, required, 1 to 128 characters)
- `muted` (`boolean`, required)

Also available in: API [`PUT /account/notifications/push/{workspaceId}`](https://nextmail.sh/docs/api/reference/your-account#put-account-notifications-push-workspaceid); TypeScript [`nextmail.account.setPushMuted()`](https://nextmail.sh/docs/sdk/reference/account#setPushMuted); Python [`account.set_push_muted()`](https://nextmail.sh/docs/python/reference/account#setPushMuted); Ruby [`account.set_push_muted`](https://nextmail.sh/docs/ruby/reference/account#setPushMuted); PHP [`account->setPushMuted`](https://nextmail.sh/docs/php/reference/account#setPushMuted); Go [`Account.SetPushMuted`](https://nextmail.sh/docs/go/reference/account#setPushMuted); Java [`account().setPushMuted`](https://nextmail.sh/docs/java/reference/account#setPushMuted); C# [`Account.SetPushMutedAsync`](https://nextmail.sh/docs/csharp/reference/account#setPushMuted).

### `setProfilePhoto`

Set your profile photo, replacing any there was, as Account, Profile does. Pass the picture in base64 as image, with its type as contentType: image/png, image/jpeg, image/webp, image/gif, up to 5 MB. It is fitted into a 512 pixel square.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `image` (`string`, required, 1 to 7340032 characters): The image in base64, or as a data: URL.
- `contentType` (`string`, required, 1 to 100 characters): The type of the image: image/png, image/jpeg, image/webp, image/gif.

Also available in: API [`PUT /account/photo`](https://nextmail.sh/docs/api/reference/your-account#put-account-photo); TypeScript [`nextmail.account.setPhoto()`](https://nextmail.sh/docs/sdk/reference/account#setPhoto); Python [`account.set_photo()`](https://nextmail.sh/docs/python/reference/account#setPhoto); Ruby [`account.set_photo`](https://nextmail.sh/docs/ruby/reference/account#setPhoto); PHP [`account->setPhoto`](https://nextmail.sh/docs/php/reference/account#setPhoto); Go [`Account.SetPhoto`](https://nextmail.sh/docs/go/reference/account#setPhoto); Java [`account().setPhoto`](https://nextmail.sh/docs/java/reference/account#setPhoto); C# [`Account.SetPhotoAsync`](https://nextmail.sh/docs/csharp/reference/account#setPhoto).

### `removeProfilePhoto`

Remove your profile photo and delete the stored image, so the app shows your initials again. Removing it when there is none changes nothing.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`DELETE /account/photo`](https://nextmail.sh/docs/api/reference/your-account#delete-account-photo); TypeScript [`nextmail.account.removePhoto()`](https://nextmail.sh/docs/sdk/reference/account#removePhoto); Python [`account.remove_photo()`](https://nextmail.sh/docs/python/reference/account#removePhoto); Ruby [`account.remove_photo`](https://nextmail.sh/docs/ruby/reference/account#removePhoto); PHP [`account->removePhoto`](https://nextmail.sh/docs/php/reference/account#removePhoto); Go [`Account.RemovePhoto`](https://nextmail.sh/docs/go/reference/account#removePhoto); Java [`account().removePhoto`](https://nextmail.sh/docs/java/reference/account#removePhoto); C# [`Account.RemovePhotoAsync`](https://nextmail.sh/docs/csharp/reference/account#removePhoto).

### `getUsername`

Your Nextmail username, whether you chose it or it was made for you, and the free address it gives you. A username you chose never changes.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/username`](https://nextmail.sh/docs/api/reference/your-account#get-account-username); TypeScript [`nextmail.account.getUsername()`](https://nextmail.sh/docs/sdk/reference/account#getUsername); Python [`account.get_username()`](https://nextmail.sh/docs/python/reference/account#getUsername); Ruby [`account.get_username`](https://nextmail.sh/docs/ruby/reference/account#getUsername); PHP [`account->getUsername`](https://nextmail.sh/docs/php/reference/account#getUsername); Go [`Account.GetUsername`](https://nextmail.sh/docs/go/reference/account#getUsername); Java [`account().getUsername`](https://nextmail.sh/docs/java/reference/account#getUsername); C# [`Account.GetUsernameAsync`](https://nextmail.sh/docs/csharp/reference/account#getUsername).

### `checkUsername`

Whether you could choose a username, without choosing it, and why not when you could not. It is lowercased and its spaces become dots before it is checked.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

- `username` (`string`, required, 1 to 60 characters)

Also available in: API [`GET /account/username/availability`](https://nextmail.sh/docs/api/reference/your-account#get-account-username-availability); TypeScript [`nextmail.account.checkUsername()`](https://nextmail.sh/docs/sdk/reference/account#checkUsername); Python [`account.check_username()`](https://nextmail.sh/docs/python/reference/account#checkUsername); Ruby [`account.check_username`](https://nextmail.sh/docs/ruby/reference/account#checkUsername); PHP [`account->checkUsername`](https://nextmail.sh/docs/php/reference/account#checkUsername); Go [`Account.CheckUsername`](https://nextmail.sh/docs/go/reference/account#checkUsername); Java [`account().checkUsername`](https://nextmail.sh/docs/java/reference/account#checkUsername); C# [`Account.CheckUsernameAsync`](https://nextmail.sh/docs/csharp/reference/account#checkUsername).

### `chooseUsername`

Choose your username, and with it your free address, for good. Once chosen it never changes, so check it with checkUsername first and make sure it is the one you want.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `username` (`string`, required, 1 to 60 characters)

Also available in: API [`PUT /account/username`](https://nextmail.sh/docs/api/reference/your-account#put-account-username); TypeScript [`nextmail.account.setUsername()`](https://nextmail.sh/docs/sdk/reference/account#setUsername); Python [`account.set_username()`](https://nextmail.sh/docs/python/reference/account#setUsername); Ruby [`account.set_username`](https://nextmail.sh/docs/ruby/reference/account#setUsername); PHP [`account->setUsername`](https://nextmail.sh/docs/php/reference/account#setUsername); Go [`Account.SetUsername`](https://nextmail.sh/docs/go/reference/account#setUsername); Java [`account().setUsername`](https://nextmail.sh/docs/java/reference/account#setUsername); C# [`Account.SetUsernameAsync`](https://nextmail.sh/docs/csharp/reference/account#setUsername).

### `listConnectedApps`

Every app you connected to your account with OAuth, as Account, Connected apps lists them: what each may reach, until when, and its client id, which revokeConnectedApp takes. What an app may reach is changed in the app, never from here.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/connected-apps`](https://nextmail.sh/docs/api/reference/your-account#get-account-connected-apps); TypeScript [`nextmail.account.listConnectedApps()`](https://nextmail.sh/docs/sdk/reference/account#listConnectedApps); Python [`account.list_connected_apps()`](https://nextmail.sh/docs/python/reference/account#listConnectedApps); Ruby [`account.list_connected_apps`](https://nextmail.sh/docs/ruby/reference/account#listConnectedApps); PHP [`account->listConnectedApps`](https://nextmail.sh/docs/php/reference/account#listConnectedApps); Go [`Account.ListConnectedApps`](https://nextmail.sh/docs/go/reference/account#listConnectedApps); Java [`account().listConnectedApps`](https://nextmail.sh/docs/java/reference/account#listConnectedApps); C# [`Account.ListConnectedAppsAsync`](https://nextmail.sh/docs/csharp/reference/account#listConnectedApps).

### `revokeConnectedApp`

Remove an app you connected: every token it holds and the access you gave it are deleted, so its next call is refused and it has to ask again. Pass its client id from listConnectedApps. Removing the app you are talking through disconnects it.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `clientId` (`string`, required, 1 to 128 characters)

Also available in: API [`DELETE /account/connected-apps/{clientId}`](https://nextmail.sh/docs/api/reference/your-account#delete-account-connected-apps-clientid); TypeScript [`nextmail.account.revokeConnectedApp()`](https://nextmail.sh/docs/sdk/reference/account#revokeConnectedApp); Python [`account.revoke_connected_app()`](https://nextmail.sh/docs/python/reference/account#revokeConnectedApp); Ruby [`account.revoke_connected_app`](https://nextmail.sh/docs/ruby/reference/account#revokeConnectedApp); PHP [`account->revokeConnectedApp`](https://nextmail.sh/docs/php/reference/account#revokeConnectedApp); Go [`Account.RevokeConnectedApp`](https://nextmail.sh/docs/go/reference/account#revokeConnectedApp); Java [`account().revokeConnectedApp`](https://nextmail.sh/docs/java/reference/account#revokeConnectedApp); C# [`Account.RevokeConnectedAppAsync`](https://nextmail.sh/docs/csharp/reference/account#revokeConnectedApp).

### `listReceivedInvitations`

The invitations to join a workspace that are waiting for you, oldest first, each with the id acceptInvitation and declineInvitation take. It is not listInvitations, which lists the invitations this workspace sent.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/invitations`](https://nextmail.sh/docs/api/reference/your-account#get-account-invitations); TypeScript [`nextmail.account.listInvitations()`](https://nextmail.sh/docs/sdk/reference/account#listInvitations); Python [`account.list_invitations()`](https://nextmail.sh/docs/python/reference/account#listInvitations); Ruby [`account.list_invitations`](https://nextmail.sh/docs/ruby/reference/account#listInvitations); PHP [`account->listInvitations`](https://nextmail.sh/docs/php/reference/account#listInvitations); Go [`Account.ListInvitations`](https://nextmail.sh/docs/go/reference/account#listInvitations); Java [`account().listInvitations`](https://nextmail.sh/docs/java/reference/account#listInvitations); C# [`Account.ListInvitationsAsync`](https://nextmail.sh/docs/csharp/reference/account#listInvitations).

### `acceptInvitation`

Accept an invitation that is waiting for you and join its workspace with the role and the addresses it gives. activate also makes it the workspace the app opens for you. A workspace that asks for two-factor sign-in is refused until you turn it on.

- Scopes: `account:write`.
- The app's assistant asks first unless you asked for it.
- Toolkit: `account`.

**Inputs**

- `invitationId` (`string`, required, 1 to 128 characters)
- `activate` (`boolean`)

Also available in: API [`POST /account/invitations/{invitationId}/accept`](https://nextmail.sh/docs/api/reference/your-account#post-account-invitations-invitationid-accept); TypeScript [`nextmail.account.acceptInvitation()`](https://nextmail.sh/docs/sdk/reference/account#acceptInvitation); Python [`account.accept_invitation()`](https://nextmail.sh/docs/python/reference/account#acceptInvitation); Ruby [`account.accept_invitation`](https://nextmail.sh/docs/ruby/reference/account#acceptInvitation); PHP [`account->acceptInvitation`](https://nextmail.sh/docs/php/reference/account#acceptInvitation); Go [`Account.AcceptInvitation`](https://nextmail.sh/docs/go/reference/account#acceptInvitation); Java [`account().acceptInvitation`](https://nextmail.sh/docs/java/reference/account#acceptInvitation); C# [`Account.AcceptInvitationAsync`](https://nextmail.sh/docs/csharp/reference/account#acceptInvitation).

### `declineInvitation`

Decline an invitation that is waiting for you. Its link stops working and whoever sent it is told. It cannot be taken back: they would have to invite you again.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `invitationId` (`string`, required, 1 to 128 characters)

Also available in: API [`POST /account/invitations/{invitationId}/decline`](https://nextmail.sh/docs/api/reference/your-account#post-account-invitations-invitationid-decline); TypeScript [`nextmail.account.declineInvitation()`](https://nextmail.sh/docs/sdk/reference/account#declineInvitation); Python [`account.decline_invitation()`](https://nextmail.sh/docs/python/reference/account#declineInvitation); Ruby [`account.decline_invitation`](https://nextmail.sh/docs/ruby/reference/account#declineInvitation); PHP [`account->declineInvitation`](https://nextmail.sh/docs/php/reference/account#declineInvitation); Go [`Account.DeclineInvitation`](https://nextmail.sh/docs/go/reference/account#declineInvitation); Java [`account().declineInvitation`](https://nextmail.sh/docs/java/reference/account#declineInvitation); C# [`Account.DeclineInvitationAsync`](https://nextmail.sh/docs/csharp/reference/account#declineInvitation).

### `listSessions`

Every browser and phone you are signed in on, as Account, Security lists them: the browser and system, the country and city it was last used from, how it signed in, when it was last used, and its id, which revokeSession takes. No address is recorded, only the place.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/sessions`](https://nextmail.sh/docs/api/reference/your-account#get-account-sessions); TypeScript [`nextmail.account.listSessions()`](https://nextmail.sh/docs/sdk/reference/account#listSessions); Python [`account.list_sessions()`](https://nextmail.sh/docs/python/reference/account#listSessions); Ruby [`account.list_sessions`](https://nextmail.sh/docs/ruby/reference/account#listSessions); PHP [`account->listSessions`](https://nextmail.sh/docs/php/reference/account#listSessions); Go [`Account.ListSessions`](https://nextmail.sh/docs/go/reference/account#listSessions); Java [`account().listSessions`](https://nextmail.sh/docs/java/reference/account#listSessions); C# [`Account.ListSessionsAsync`](https://nextmail.sh/docs/csharp/reference/account#listSessions).

### `revokeSession`

Sign one browser or phone out of your account. Its next request is refused at once, and a phone stops getting notifications. Pass its id from listSessions.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `sessionId` (`string`, required, 1 to 128 characters)

Also available in: API [`DELETE /account/sessions/{sessionId}`](https://nextmail.sh/docs/api/reference/your-account#delete-account-sessions-sessionid); TypeScript [`nextmail.account.revokeSession()`](https://nextmail.sh/docs/sdk/reference/account#revokeSession); Python [`account.revoke_session()`](https://nextmail.sh/docs/python/reference/account#revokeSession); Ruby [`account.revoke_session`](https://nextmail.sh/docs/ruby/reference/account#revokeSession); PHP [`account->revokeSession`](https://nextmail.sh/docs/php/reference/account#revokeSession); Go [`Account.RevokeSession`](https://nextmail.sh/docs/go/reference/account#revokeSession); Java [`account().revokeSession`](https://nextmail.sh/docs/java/reference/account#revokeSession); C# [`Account.RevokeSessionAsync`](https://nextmail.sh/docs/csharp/reference/account#revokeSession).

### `revokeOtherSessions`

Sign every browser and phone out of your account at once, for when a device is lost or a password may have leaked. That includes the browser or phone you are using, if you are signed in there. With connectedApps true, every connected app is removed as well, the one you are talking through included.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `connectedApps` (`boolean`): Also remove every app connected to the account. Left out, apps stay.

Also available in: API [`DELETE /account/sessions`](https://nextmail.sh/docs/api/reference/your-account#delete-account-sessions); TypeScript [`nextmail.account.revokeSessions()`](https://nextmail.sh/docs/sdk/reference/account#revokeSessions); Python [`account.revoke_sessions()`](https://nextmail.sh/docs/python/reference/account#revokeSessions); Ruby [`account.revoke_sessions`](https://nextmail.sh/docs/ruby/reference/account#revokeSessions); PHP [`account->revokeSessions`](https://nextmail.sh/docs/php/reference/account#revokeSessions); Go [`Account.RevokeSessions`](https://nextmail.sh/docs/go/reference/account#revokeSessions); Java [`account().revokeSessions`](https://nextmail.sh/docs/java/reference/account#revokeSessions); C# [`Account.RevokeSessionsAsync`](https://nextmail.sh/docs/csharp/reference/account#revokeSessions).

### `listSecurityEvents`

Your security log, newest first: each sign-in with its device and place, devices signed out, password changes and resets, two-factor turned on or off, and passkeys added or removed. Nothing is ever removed from it.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

- `limit` (`integer`, at least 1, at most 100): How many entries to return, newest first. 50 when left out.
- `cursor` (`string`, not empty): The cursor the previous page ended with, to read the entries before it.

Also available in: API [`GET /account/security-events`](https://nextmail.sh/docs/api/reference/your-account#get-account-security-events); TypeScript [`nextmail.account.listSecurityEvents()`](https://nextmail.sh/docs/sdk/reference/account#listSecurityEvents), [`nextmail.account.listAllSecurityEvents()`](https://nextmail.sh/docs/sdk/reference/account#listAllSecurityEvents), [`nextmail.account.iterateSecurityEvents()`](https://nextmail.sh/docs/sdk/reference/account#iterateSecurityEvents); Python [`account.list_security_events()`](https://nextmail.sh/docs/python/reference/account#listSecurityEvents), [`account.list_all_security_events()`](https://nextmail.sh/docs/python/reference/account#listAllSecurityEvents), [`account.iterate_security_events()`](https://nextmail.sh/docs/python/reference/account#iterateSecurityEvents); Ruby [`account.list_security_events`](https://nextmail.sh/docs/ruby/reference/account#listSecurityEvents), [`account.list_all_security_events`](https://nextmail.sh/docs/ruby/reference/account#listAllSecurityEvents), [`account.iterate_security_events`](https://nextmail.sh/docs/ruby/reference/account#iterateSecurityEvents); PHP [`account->listSecurityEvents`](https://nextmail.sh/docs/php/reference/account#listSecurityEvents), [`account->listAllSecurityEvents`](https://nextmail.sh/docs/php/reference/account#listAllSecurityEvents), [`account->iterateSecurityEvents`](https://nextmail.sh/docs/php/reference/account#iterateSecurityEvents); Go [`Account.ListSecurityEvents`](https://nextmail.sh/docs/go/reference/account#listSecurityEvents), [`Account.ListAllSecurityEvents`](https://nextmail.sh/docs/go/reference/account#listAllSecurityEvents), [`Account.IterateSecurityEvents`](https://nextmail.sh/docs/go/reference/account#iterateSecurityEvents); Java [`account().listSecurityEvents`](https://nextmail.sh/docs/java/reference/account#listSecurityEvents), [`account().listAllSecurityEvents`](https://nextmail.sh/docs/java/reference/account#listAllSecurityEvents), [`account().iterateSecurityEvents`](https://nextmail.sh/docs/java/reference/account#iterateSecurityEvents); C# [`Account.ListSecurityEventsAsync`](https://nextmail.sh/docs/csharp/reference/account#listSecurityEvents), [`Account.ListAllSecurityEventsAsync`](https://nextmail.sh/docs/csharp/reference/account#listAllSecurityEvents), [`Account.IterateSecurityEventsAsync`](https://nextmail.sh/docs/csharp/reference/account#iterateSecurityEvents).

### `listPasskeys`

The passkeys that can sign in to your account, with the name of each, whether it is synced between your devices, when it was last used, and its id, which renamePasskey and removePasskey take. A passkey is added on the device that holds it, in Account, Security, never from here.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

Takes no input.

Also available in: API [`GET /account/passkeys`](https://nextmail.sh/docs/api/reference/your-account#get-account-passkeys); TypeScript [`nextmail.account.listPasskeys()`](https://nextmail.sh/docs/sdk/reference/account#listPasskeys); Python [`account.list_passkeys()`](https://nextmail.sh/docs/python/reference/account#listPasskeys); Ruby [`account.list_passkeys`](https://nextmail.sh/docs/ruby/reference/account#listPasskeys); PHP [`account->listPasskeys`](https://nextmail.sh/docs/php/reference/account#listPasskeys); Go [`Account.ListPasskeys`](https://nextmail.sh/docs/go/reference/account#listPasskeys); Java [`account().listPasskeys`](https://nextmail.sh/docs/java/reference/account#listPasskeys); C# [`Account.ListPasskeysAsync`](https://nextmail.sh/docs/csharp/reference/account#listPasskeys).

### `renamePasskey`

Give a passkey a name you will recognise. Pass its id from listPasskeys.

- Scopes: `account:write`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

- `passkeyId` (`string`, required, 1 to 128 characters)
- `name` (`string`, required, 1 to 60 characters)

Also available in: API [`PATCH /account/passkeys/{passkeyId}`](https://nextmail.sh/docs/api/reference/your-account#patch-account-passkeys-passkeyid); TypeScript [`nextmail.account.renamePasskey()`](https://nextmail.sh/docs/sdk/reference/account#renamePasskey); Python [`account.rename_passkey()`](https://nextmail.sh/docs/python/reference/account#renamePasskey); Ruby [`account.rename_passkey`](https://nextmail.sh/docs/ruby/reference/account#renamePasskey); PHP [`account->renamePasskey`](https://nextmail.sh/docs/php/reference/account#renamePasskey); Go [`Account.RenamePasskey`](https://nextmail.sh/docs/go/reference/account#renamePasskey); Java [`account().renamePasskey`](https://nextmail.sh/docs/java/reference/account#renamePasskey); C# [`Account.RenamePasskeyAsync`](https://nextmail.sh/docs/csharp/reference/account#renamePasskey).

### `removePasskey`

Remove a passkey from your account, so it can no longer sign in or confirm a change. You are told by email. The passkey stays on the device until you delete it there. Pass its id from listPasskeys.

- Scopes: `account:write`.
- The app's assistant always asks first.
- Toolkit: `account`.

**Inputs**

- `passkeyId` (`string`, required, 1 to 128 characters)

Also available in: API [`DELETE /account/passkeys/{passkeyId}`](https://nextmail.sh/docs/api/reference/your-account#delete-account-passkeys-passkeyid); TypeScript [`nextmail.account.removePasskey()`](https://nextmail.sh/docs/sdk/reference/account#removePasskey); Python [`account.remove_passkey()`](https://nextmail.sh/docs/python/reference/account#removePasskey); Ruby [`account.remove_passkey`](https://nextmail.sh/docs/ruby/reference/account#removePasskey); PHP [`account->removePasskey`](https://nextmail.sh/docs/php/reference/account#removePasskey); Go [`Account.RemovePasskey`](https://nextmail.sh/docs/go/reference/account#removePasskey); Java [`account().removePasskey`](https://nextmail.sh/docs/java/reference/account#removePasskey); C# [`Account.RemovePasskeyAsync`](https://nextmail.sh/docs/csharp/reference/account#removePasskey).

### `listConnectedAppRequests`

The request log of an app you connected, newest first: each REST call it made with the access you gave it, with the method, the path, the status, how long it took and the error code of a refusal. Pass its client id from listConnectedApps. failedOnly keeps the refused calls, and cursor takes the cursor of the previous answer.

- Scopes: `account:read`.
- The app's assistant runs it without asking.
- Toolkit: `account`.

**Inputs**

- `clientId` (`string`, required, 1 to 128 characters)
- `failedOnly` (`boolean`): True keeps the calls answered with 400 or more.
- `cursor` (`string`, up to 2048 characters): The cursor the previous answer ended with, to read the next page.

Also available in: API [`GET /account/connected-apps/{clientId}/requests`](https://nextmail.sh/docs/api/reference/your-account#get-account-connected-apps-clientid-requests); TypeScript [`nextmail.account.listConnectedAppRequests()`](https://nextmail.sh/docs/sdk/reference/account#listConnectedAppRequests), [`nextmail.account.listAllConnectedAppRequests()`](https://nextmail.sh/docs/sdk/reference/account#listAllConnectedAppRequests), [`nextmail.account.iterateConnectedAppRequests()`](https://nextmail.sh/docs/sdk/reference/account#iterateConnectedAppRequests); Python [`account.list_connected_app_requests()`](https://nextmail.sh/docs/python/reference/account#listConnectedAppRequests), [`account.list_all_connected_app_requests()`](https://nextmail.sh/docs/python/reference/account#listAllConnectedAppRequests), [`account.iterate_connected_app_requests()`](https://nextmail.sh/docs/python/reference/account#iterateConnectedAppRequests); Ruby [`account.list_connected_app_requests`](https://nextmail.sh/docs/ruby/reference/account#listConnectedAppRequests), [`account.list_all_connected_app_requests`](https://nextmail.sh/docs/ruby/reference/account#listAllConnectedAppRequests), [`account.iterate_connected_app_requests`](https://nextmail.sh/docs/ruby/reference/account#iterateConnectedAppRequests); PHP [`account->listConnectedAppRequests`](https://nextmail.sh/docs/php/reference/account#listConnectedAppRequests), [`account->listAllConnectedAppRequests`](https://nextmail.sh/docs/php/reference/account#listAllConnectedAppRequests), [`account->iterateConnectedAppRequests`](https://nextmail.sh/docs/php/reference/account#iterateConnectedAppRequests); Go [`Account.ListConnectedAppRequests`](https://nextmail.sh/docs/go/reference/account#listConnectedAppRequests), [`Account.ListAllConnectedAppRequests`](https://nextmail.sh/docs/go/reference/account#listAllConnectedAppRequests), [`Account.IterateConnectedAppRequests`](https://nextmail.sh/docs/go/reference/account#iterateConnectedAppRequests); Java [`account().listConnectedAppRequests`](https://nextmail.sh/docs/java/reference/account#listConnectedAppRequests), [`account().listAllConnectedAppRequests`](https://nextmail.sh/docs/java/reference/account#listAllConnectedAppRequests), [`account().iterateConnectedAppRequests`](https://nextmail.sh/docs/java/reference/account#iterateConnectedAppRequests); C# [`Account.ListConnectedAppRequestsAsync`](https://nextmail.sh/docs/csharp/reference/account#listConnectedAppRequests), [`Account.ListAllConnectedAppRequestsAsync`](https://nextmail.sh/docs/csharp/reference/account#listAllConnectedAppRequests), [`Account.IterateConnectedAppRequestsAsync`](https://nextmail.sh/docs/csharp/reference/account#iterateConnectedAppRequests).
