> ## 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](/workspaces/creating-users) page to add them to your instance using the API.
</Note>

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](/workspaces/inviting-and-accepting-members#accepting-invitations), you will use the ID given in the response of this API call.
</Tip>

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

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

<ParamField path="email" type="string" required>
  The email of the registered user.
</ParamField>

<ParamField path="role" type="string" required>
  A role for the user. One of `admin`, `editor`, `client`.
</ParamField>

<Accordion title="Show example of request">
  <CodeGroup>
    ```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)
    ```
  </CodeGroup>
</Accordion>

### 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](/workspaces/inviting-and-accepting-members#inviting-members).

This request does not take a body.
