> ## Documentation Index
> Fetch the complete documentation index at: https://docs.emailbison.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inviting and Accepting Members

> [!NOTE]
>
> This workflow requires that the user has already registered on your EmailBison instance. If not, visit the [Creating Users](https://docs.emailbison.com/workspaces/creating-users.md) page to add them to your instance using the API.

Existing users can be invited to any workspace using the API. Furthermore, their invitations can be programmatically accepted using the API.

### Inviting Members

> [!TIP]
>
> If you are also going to be [accepting invitations](https://docs.emailbison.com/workspaces/inviting-and-accepting-members.md#accepting-invitations), you will use the ID given in the response of this API call.

Send a `POST` request to `/api/workspaces/v1.1/invite-member`.

This request takes a JSON body with the following 2 required fields:

**email** `string` *required*

The email of the registered user.

**role** `string` *required*

A role for the user. One of `admin`, `editor`, `client`.

> [accordion] Show example of request
>
> ```bash curl theme={null}
> curl https://dedi.emailbison.com/api/workspaces/v1.1/invite-members \
>   --request POST \
>   --header 'Content-Type: application/json' \
>   --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
>   --data '{
>   "email": "example@example.com",
>   "role": "admin"
> }'
> ```
>
> ```JavaScript JavaScript theme={null}
> fetch('https://dedi.emailbison.com/api/workspaces/v1.1/invite-members', {
>   method: 'POST',
>   headers: {
>     'Content-Type': 'application/json',
>     Authorization: 'Bearer YOUR_SECRET_TOKEN'
>   },
>   body: JSON.stringify({
>     email: 'example@example.com',
>     role: 'admin'
>   })
> })
> ```
>
> ```Python Python theme={null}
> import requests
>
> url = "https://dedi.emailbison.com/api/workspaces/v1.1/invite-members"
>
> payload = {
>     "email": "example@example.com",
>     "role": "admin"
> }
> headers = {
>     "Content-Type": "application/json",
>     "Authorization": "Bearer YOUR_SECRET_TOKEN"
> }
>
> response = requests.post(url, json=payload, headers=headers)
> ```

### Accepting Invitations

You can use the API to accept invitations to workspaces on behalf of users.

Send a `POST` request to `/api/workspaces/v1.1/accept/{team_invitation_id}` where `{team_invitation_id}` is the ID received back when [inviting members](https://docs.emailbison.com/workspaces/inviting-and-accepting-members.md#inviting-members).

This request does not take a body.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.