# Add Or Invite A Workspace Member

`POST /shares/workspace/members`

Adds an existing Metakip user to the owner’s workspace or sends an invitation by email. Only the workspace owner can add members.
## Authentication

Use one of the following authentication alternatives:

- **API token** (`bearerToken`) : Send a named API token in the Authorization header. Send it in the `Authorization: Bearer <token>` header.
- **Better Auth browser session** (`browserSession`) : Use the Better Auth session cookie from a signed-in browser session. Send it in the `better-auth.session_token` cookie.
## Token permissions

API tokens must include `pages:write`.
## Request Body

Required.

### `application/json`

```json
{
  "email": "string",
  "role": "viewer"
}
```
## Responses

### 200

An existing user was added to the workspace.


### `application/json`

```json
{
  "ok": false,
  "memberId": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "invitation": {
    "id": "00000000-0000-0000-0000-000000000000",
    "targetType": "string",
    "targetId": "00000000-0000-0000-0000-000000000000",
    "email": "string",
    "permission": "viewer",
    "canManage": false,
    "deliveryStatus": "pending",
    "expiresAt": "string",
    "createdAt": "string"
  },
  "message": "string"
}
```

### 202

An invitation was queued for an email address without an account.


### `application/json`

```json
{
  "ok": false,
  "memberId": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "invitation": {
    "id": "00000000-0000-0000-0000-000000000000",
    "targetType": "string",
    "targetId": "00000000-0000-0000-0000-000000000000",
    "email": "string",
    "permission": "viewer",
    "canManage": false,
    "deliveryStatus": "pending",
    "expiresAt": "string",
    "createdAt": "string"
  },
  "message": "string"
}
```

### 403

The API token is missing a required scope: pages:write.


### `application/json`

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
