# invite_workspace_member

Source: https://modulify.ai/docs/api/workspaces/invite-workspace-member

Invites one or more people to a workspace by email, each with a join link.

- Title: Invite someone to a workspace
- Scope: `members:write`
- Access: Makes changes
- Endpoint: `POST /v1/invite_workspace_member`

Each person gets an email with a join link that expires after 7 days, so this reaches real people. The tool tells the client to confirm the addresses with you first and never to invite anyone you did not name. Check each address with `check_member_email` first to avoid a duplicate invitation.

It needs the **Manage members** permission (`members.manage`), and the workspace must be on Pro or Enterprise, otherwise it is refused with `This workspace must be on the Pro plan to invite members!` Assigning a role at the same time also needs the **Manage roles** permission (`roles.manage`). Without it the roles are ignored silently and everyone is invited on the stock Member role.

The whole call is refused if any address already belongs to a member (`Some users are already members!`) or already has a pending invitation (`Some users already have pending invitations!`), if you invite yourself, or if the invitations would take the workspace past 50 people besides its owner, pending invitations included. An address that belongs to a Modulify site cannot be invited either. See [Members and roles](https://modulify.ai/docs/reference/members-and-roles#invite-someone).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/invite_workspace_member`, sending the inputs below as a JSON object. The token needs the `members:write` scope.

It makes changes, so send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

```bash
curl -X POST https://api.modulify.ai/v1/invite_workspace_member \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID","emails":[]}'
```

Over MCP, the same method is the [invite_workspace_member tool](https://modulify.ai/docs/mcp/workspaces/invite-workspace-member).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace to invite them to. |
| `emails` | array of strings | Yes | The email addresses to invite. |
| `roles` | object | No | Role ids keyed by the lowercased email address, for example `{ "sam@example.com": "<roleId>" }`. An address with no entry, or with an id that is not one of the workspace's custom roles, is invited on the stock Member role. Needs the **Manage roles** permission and is ignored without it. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.