# Invite member

`opensend.members.invite(input)`

Invites a person to the workspace by email, with the role they will hold.

Needs the scope: `workspace:write`

## Input

- `email` (string, required): The address to invite.
- `name` (string): The name of the person, shown until they sign in.
- `role` (string): What they may do: `admin`, `member` or `viewer`. Without it they join as a member. One of: `admin`, `member`, `viewer`.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("member"): Always `member`.
- `id` (string): The id of the member.
- `name` (string): The name of the person.
- `email` (string): The address of the person.
- `role` (string): What the member may do: `owner`, `admin`, `member` or `viewer`. One of: `owner`, `admin`, `member`, `viewer`.
- `status` (string): `invited` until the person signs in, `active` after that. One of: `active`, `invited`.
- `invitedBy` (string): The name of who invited them.
- `invitedAt` (string | null): When the invitation was sent, or `null` for the person who made the workspace.
- `lastActiveAt` (string | null): When the member last used the workspace, or `null`.
- `invitationUrl` (string | null): A link that lets an invited person choose a password and join without an emailed code, or `null`. Only the owner of a server a team hosts itself is given it, signed in, while the invitation is waiting.
- `createdAt` (string): When the member was added.

## Example

TypeScript:

```ts
await opensend.members.invite({
  email: 'joan@example.com',
  role: 'admin',
})
```

CLI:

```bash
opensend members invite --email joan@example.com --role admin
```

Answer:

```json
{
  "object": "member",
  "id": "mem_01",
  "name": "joan@example.com",
  "email": "joan@example.com",
  "role": "admin",
  "status": "invited",
  "invitedBy": "Backend",
  "invitedAt": "2026-11-27T09:30:00.000Z",
  "lastActiveAt": null,
  "invitationUrl": null,
  "createdAt": "2026-11-27T09:30:00.000Z"
}
```
