Creating a Workspace

This workflow requires a super-admin key.For a refresher on the difference between the key types, you can visit Authentication.
Workspaces can be created using the API.

Creating a Workspace

Send a POST request to /api/workspaces/v1.1. You must include a name field in a JSON body, this field is the name of the workspace you are creating. An example of a request to create a new workspace with the name new name:
curl https://dedi.emailbison.com/api/workspaces/v1.1 \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "New name"
}'

Creating API Keys

This workflow requires a super-admin key.For a refresher on the difference between the key types, you can visit Authentication.
You do not need to switch workspaces using the API or the UI for this workflow.
api-user keys can be generated for workspaces using the API.

Creating a Key

Send a POST request to /api/workspaces/v1.1/{workspace_id}/api-tokens where {workspace_id} is the ID of the workspace you want to generate a key for.
Workspace IDs can be aquired by sending a GET request to api/workspaces.
You must include a name field in a JSON body, this field is the name of the API key you are creating. An example of a request creating an API key named “New token” for the workspace with ID 54:
curl 'https://dedi.emailbison.com/api/workspaces/v1.1/54/api-tokens' \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "New token"
}'

Creating Users

If a user (associated with an email account) has not registered yet for any of your workspaces on your EmailBison instance, you can programmatically register that email account using the API. If they have already registered, and you want to give them access to other workspaces using the API, visit the Inviting and Accepting Members page.

Creating a User

Send a POST request to /api/workspaces/v1.1/users. This request needs a JSON body with the following 4 fields
name
string
required
A name for the user.
password
string
required
A password for the user.
email
string
required
The email address of the user.
role
string
required
A role for the user. One of admin, editor, client.
An example of a request creating a user:
curl https://dedi.emailbison.com/api/workspaces/v1.1/users \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "John Doe",
  "password": "securepasswordlol",
  "email": "example@example.com",
  "role": "admin"
}'

Inviting and Accepting Members

This workflow requires that the user has already registered on your EmailBison instance. If not, visit the Creating Users 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

If you are also going to be 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.

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. This request does not take a body.