---
title: "TypeScript SDK: Account"
description: "The methods of the TypeScript client under Account. The account, its plan and usage, and account-wide counts."
url: https://doorman.fyi/docs/sdk/reference/account
markdown: https://doorman.fyi/docs/sdk/reference/account.md
area: "SDKs and tools"
section: "TypeScript SDK"
---

# TypeScript SDK: Account

The methods of the TypeScript client under Account. The account, its plan and usage, and account-wide counts.

Source: https://doorman.fyi/docs/sdk/reference/account

## client.me

TypeScript:
```ts
client.me(): Promise<Me>
```

Operation [`me`](https://doorman.fyi/docs/reference/account.md#me): `GET /v1/me`

The account, its plan and usage, the caller, the organization the account belongs to, and the inbox domain.

Access `any`: any API key, or a console session. An app token needs `account:read`.

## client.overview

TypeScript:
```ts
client.overview(): Promise<Overview>
```

Operation [`overview`](https://doorman.fyi/docs/reference/account.md#overview): `GET /v1/overview`

The account's counts and the getting-started checklist. Account scope.

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`. An app token needs `account:read`.

## client.metrics

TypeScript:
```ts
client.metrics(params: MetricsParams = {}): Promise<Metrics>
```

Operation [`metrics`](https://doorman.fyi/docs/reference/account.md#metrics): `GET /v1/metrics`

Received, sent, delivered and failed per UTC bucket over a range.

Access `any`: any API key, or a console session. An app token needs `account:read`.

## client.billing.checkout

TypeScript:
```ts
client.billing.checkout(): Promise<BillingRedirect>
```

Operation [`billing.checkout`](https://doorman.fyi/docs/reference/account.md#billing-checkout): `POST /v1/billing/checkout`

A checkout page at the payment provider. The plan changes when the payment is reported, not here.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused. Part of billing, which a deployment switches on: where it takes no payments, the call answers `404 not_found`.

## client.billing.portal

TypeScript:
```ts
client.billing.portal(): Promise<BillingRedirect>
```

Operation [`billing.portal`](https://doorman.fyi/docs/reference/account.md#billing-portal): `POST /v1/billing/portal`

The provider's portal for this account: the card, the invoices, cancelling.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused. Part of billing, which a deployment switches on: where it takes no payments, the call answers `404 not_found`.

## client.billing.sync

TypeScript:
```ts
client.billing.sync(): Promise<BillingSynced>
```

Operation [`billing.sync`](https://doorman.fyi/docs/reference/account.md#billing-sync): `POST /v1/billing/sync`

Read the subscription from the provider again and apply it.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused. Part of billing, which a deployment switches on: where it takes no payments, the call answers `404 not_found`.

## client.billing.seats

TypeScript:
```ts
client.billing.seats(body: SetSeats): Promise<BillingSynced>
```

Operation [`billing.seats`](https://doorman.fyi/docs/reference/account.md#billing-seats): `POST /v1/billing/seats`

Set how many seats an organization's Teams subscription holds. The number is the whole count. More seats are charged at once and made only if the charge succeeds (402 otherwise); fewer take effect when the paid period ends. Where the deployment does not sell the Teams plan it answers 404.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused. Part of billing, which a deployment switches on: where it takes no payments, the call answers `404 not_found`.

## client.push.get

TypeScript:
```ts
client.push.get(): Promise<PushSettings>
```

Operation [`push.get`](https://doorman.fyi/docs/reference/account.md#push-get): `GET /v1/push`

Whether this deployment can notify, the key a browser subscribes with, and the account's subscriptions without their addresses.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.push.subscriptions.create

TypeScript:
```ts
client.push.subscriptions.create(body: CreatePushSubscription): Promise<PushSubscription>
```

Operation [`push.subscriptions.create`](https://doorman.fyi/docs/reference/account.md#push-subscriptions-create): `POST /v1/push/subscriptions`

Record the address a browser was given when the owner allowed notifications there. It must be at a push service; an address the account already has answers that subscription.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.push.subscriptions.delete

TypeScript:
```ts
client.push.subscriptions.delete(subscriptionId: string): Promise<void>
```

Operation [`push.subscriptions.delete`](https://doorman.fyi/docs/reference/account.md#push-subscriptions-delete): `DELETE /v1/push/subscriptions/{subscriptionId}`

Forget a subscription, so nothing more is sent there.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.members.list

TypeScript:
```ts
client.members.list(): Promise<MemberList>
```

Operation [`members.list`](https://doorman.fyi/docs/reference/account.md#members-list): `GET /v1/members`

Everyone in the organization, in the order they joined. Every member may read it.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.members.update

TypeScript:
```ts
client.members.update(userId: string, body: UpdateMember): Promise<Member>
```

Operation [`members.update`](https://doorman.fyi/docs/reference/account.md#members-update): `PATCH /v1/members/{userId}`

Give a member another role, which holds from their next request. Only an owner may make an owner or change one (403 `owner_required`), and the last active owner keeps the role (409 `last_owner`).

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.invitations.list

TypeScript:
```ts
client.invitations.list(): Promise<InvitationList>
```

Operation [`invitations.list`](https://doorman.fyi/docs/reference/account.md#invitations-list): `GET /v1/invitations`

The organization's invitations, open and settled, newest first.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.invitations.create

TypeScript:
```ts
client.invitations.create(body: CreateInvitation): Promise<Invitation>
```

Operation [`invitations.create`](https://doorman.fyi/docs/reference/account.md#invitations-create): `POST /v1/invitations`

Record an invitation and the role it grants. An address that is a member's or already invited answers 409.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.invitations.update

TypeScript:
```ts
client.invitations.update(invitationId: string, body: UpdateInvitation): Promise<Invitation>
```

Operation [`invitations.update`](https://doorman.fyi/docs/reference/account.md#invitations-update): `PATCH /v1/invitations/{invitationId}`

Record which of the identity provider's invitations was sent for this one. A new one keeps it open longer.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.invitations.revoke

TypeScript:
```ts
client.invitations.revoke(invitationId: string): Promise<void>
```

Operation [`invitations.revoke`](https://doorman.fyi/docs/reference/account.md#invitations-revoke): `DELETE /v1/invitations/{invitationId}`

Take an open invitation back, so the role it would have granted is granted to nobody.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.

## client.organization.adopt

TypeScript:
```ts
client.organization.adopt(body: AdoptAccount): Promise<Account>
```

Operation [`organization.adopt`](https://doorman.fyi/docs/reference/account.md#organization-adopt): `POST /v1/organization/adopt`

Makes the signed-in person's personal account the account of the organization the session is working in, under the same account id. `accountId` names the personal account, so that nothing is moved by mistake. It works once for an organization, and only while the organization's own account has never been used (409 `organization_not_empty` otherwise), and cannot be undone.

Access `session`: a console session only; an API key gets 403 `session_required`. App tokens are refused.
