Management

Invites

You can use the invites resource to invite others to join your Mode Workspace. Members of the same Workspace can securely share database connections and analysis.

New users must be invited by an existing member. By default, any Mode user can invite others to join Workspaces of which they’re a member. If you’re a Mode Business customer, you can allow only admins to invite new members, or you can require admin approval before new members can join. Learn more about managing memberships and adding new members.

Invite object

Properties

email

required

string

message

required

string

inviter_id

required

string

invitee_id

required

string

organization_id

required

string

limited

required

string

sent_at

string

resent_at

string

clicked_at

string

accepted_at

string

expires_at

required

string

created_at

required

string

_links

required

object

All resource responses contain a set of links that describe other related resources or actions that you can take on this resource. A link is comprised of two main pieces: its name (which describes its relationship to this resource) and its href (the URL of the related action or resource). All resources have at least a _self link which is the URL that will return a representation of this resource.

  • invitee
  • inviter
  • web_self_resend
{
  "email": "invitee@example.com",
  "message": "minim dolore vo",
  "inviter_id": 123,
  "invitee_id": 456,
  "organization_id": 1,
  "limited": "quis enim voluptate",
  "created_at": "YYYY-MM-DDTHH:MM:SS.msZ",
  "sent_at": "YYYY-MM-DDTHH:MM:SS.msZ",
  "resent_at": "YYYY-MM-DDTHH:MM:SS.msZ",
  "clicked_at": "YYYY-MM-DDTHH:MM:SS.msZ",
  "accepted_at": "YYYY-MM-DDTHH:MM:SS.msZ",
  "_links": {
    "inviter": {
      "href": "Excepteur ullamco cupidatat exercitation aute",
      "templated": false
    },
    "invitee": {
      "href": "deserunt est",
      "templated": false
    }
  },
  "_embedded": {}
}

Create an invitation

If you have permission to invite new members to a Workspace, you can do so by sending a POST request to invites. You’ll need to include the invitee’s email address and an invitation message in your request’s body.

Mode then sends an email containing your invitation message to the provided email address. The invitee will become a member of your Workspace once they accept the invitation and verify their email address.

URL Params

workspace

required
string Workspace username
POST Body Params

Object: invite

invitee

required
object

message

required
string

Example: You are an analyst, Harry!

Responses

200

WorkspaceInvite response

400

Bad request

401

Unauthorized

403

Forbidden

404

Membership not found for Workspace

POST /{workspace}/invites

curl --include \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Accept: application/hal+json" \
     --data-binary "{
  \"invite\": {
    \"invitee\": {
      \"email\": \"harold.ceramicist@example.com\"
    },
    \"message\": \"You are an analyst, Harry!\"
  }
}" \
'https://app.mode.com/api/{workspace}/invites'
require 'http'

values = {
  invite: {
    invitee: {
      email: 'harold.ceramicist@example.com'
    },
    message: 'You are an analyst, Harry!'
  }
}

headers = {
  content_type: 'application/json',
  accept: 'application/hal+json'
}

response = HTTP.basic_auth(user: username, pass: password)
               .headers(headers)
               .post('https://app.mode.com/api/{workspace}/invites', json: values)
puts response
from urllib2 import Request, urlopen

values = """
  {
    "invite": {
      "invitee": {
        "email": "harold.ceramicist@example.com"
      },
      "message": "You are an analyst, Harry!"
    }
  }
"""

headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/hal+json'
}
request = Request('https://app.mode.com/api/{workspace}/invites', data=values, headers=headers)

response_body = urlopen(request).read()
print(response_body)
var request = require('request');

request({
  method: 'POST',
  url: 'https://app.mode.com/api/{workspace}/invites',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/hal+json'
  },
  body: "{  \"invite\": {    \"invitee\": {      \"email\": \"harold.ceramicist@example.com\"    },    \"message\": \"You are an analyst, Harry!\"  }}"
}, function (error, response, body) {
  console.log('Status:', response.statusCode);
  console.log('Headers:', JSON.stringify(response.headers));
  console.log('Response:', body);
});