Management

Invites

You can use the invites resource to invite others to join your Mode organization. Members of the same organization 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 organizations 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

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
{
  "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 an organization, 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 organization once they accept the invitation and verify their email address.

URL Params

organization

required
string Organization username
POST Body Params

Object: invite

invitee

required
object

message

required
string

Example: You're an analyist, Harry!

Responses

200

OrganizationInvite response

400

Bad request

401

Unauthorized

403

Forbidden

404

Membership not found for Organization

POST /{organization}/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://modeanalytics.com/api/{organization}/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://modeanalytics.com/api/{organization}/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://modeanalytics.com/api/{organization}/invites', data=values, headers=headers)

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

request({
  method: 'POST',
  url: 'https://modeanalytics.com/api/{organization}/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);
});