Skip to main content
POST
/
invite-users
Invite admin / merchant-team or coaching users
curl --request POST \
  --url https://cool.jobmojito.com/functions/v1/invite-users \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "users": [
    {
      "email": "hello@google.com",
      "name": "mr. Brown",
      "type": "merchant",
      "interview_id": "d1c00b60-7e75-4292-9190-7037b95b349a"
    }
  ],
  "force_invite": false,
  "merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
  "mojito_language_code": "en",
  "message_from_recruiter": "<string>"
}
'
import requests

url = "https://cool.jobmojito.com/functions/v1/invite-users"

payload = {
"users": [
{
"email": "hello@google.com",
"name": "mr. Brown",
"type": "merchant",
"interview_id": "d1c00b60-7e75-4292-9190-7037b95b349a"
}
],
"force_invite": False,
"merchant_id": "28106cba-1c27-4e53-b149-32113e5e8e31",
"mojito_language_code": "en",
"message_from_recruiter": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
users: [
{
email: 'hello@google.com',
name: 'mr. Brown',
type: 'merchant',
interview_id: 'd1c00b60-7e75-4292-9190-7037b95b349a'
}
],
force_invite: false,
merchant_id: '28106cba-1c27-4e53-b149-32113e5e8e31',
mojito_language_code: 'en',
message_from_recruiter: '<string>'
})
};

fetch('https://cool.jobmojito.com/functions/v1/invite-users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://cool.jobmojito.com/functions/v1/invite-users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'users' => [
[
'email' => 'hello@google.com',
'name' => 'mr. Brown',
'type' => 'merchant',
'interview_id' => 'd1c00b60-7e75-4292-9190-7037b95b349a'
]
],
'force_invite' => false,
'merchant_id' => '28106cba-1c27-4e53-b149-32113e5e8e31',
'mojito_language_code' => 'en',
'message_from_recruiter' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://cool.jobmojito.com/functions/v1/invite-users"

payload := strings.NewReader("{\n \"users\": [\n {\n \"email\": \"hello@google.com\",\n \"name\": \"mr. Brown\",\n \"type\": \"merchant\",\n \"interview_id\": \"d1c00b60-7e75-4292-9190-7037b95b349a\"\n }\n ],\n \"force_invite\": false,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"mojito_language_code\": \"en\",\n \"message_from_recruiter\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://cool.jobmojito.com/functions/v1/invite-users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"users\": [\n {\n \"email\": \"hello@google.com\",\n \"name\": \"mr. Brown\",\n \"type\": \"merchant\",\n \"interview_id\": \"d1c00b60-7e75-4292-9190-7037b95b349a\"\n }\n ],\n \"force_invite\": false,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"mojito_language_code\": \"en\",\n \"message_from_recruiter\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://cool.jobmojito.com/functions/v1/invite-users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"users\": [\n {\n \"email\": \"hello@google.com\",\n \"name\": \"mr. Brown\",\n \"type\": \"merchant\",\n \"interview_id\": \"d1c00b60-7e75-4292-9190-7037b95b349a\"\n }\n ],\n \"force_invite\": false,\n \"merchant_id\": \"28106cba-1c27-4e53-b149-32113e5e8e31\",\n \"mojito_language_code\": \"en\",\n \"message_from_recruiter\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "email": "<string>",
    "name": "<string>",
    "type": "<string>",
    "interview_id": "<string>",
    "result": "<string>",
    "profile_id": "<string>",
    "profile_interview_id": "<string>"
  }
]
{
"error": "Field is required.",
"name": "interview_result_id"
}
{
"error": "Field is required.",
"name": "interview_result_id"
}
{
"error": "Field is required.",
"name": "interview_result_id"
}

Authorizations

Authorization
string
header
required

Supabase JWT — Authorization: Bearer <token>.

Body

application/json
users
object[]
required

List of users to invite.

force_invite
boolean | null

When true, re-sends the invite email for still-pending (invited) profiles that did not otherwise produce a result.

Example:

false

merchant_id
string<uuid> | null

Target merchant id. Required with a service-role key; for admins / sub-merchant users it overrides the token's merchant.

Example:

"28106cba-1c27-4e53-b149-32113e5e8e31"

mojito_language_code
enum<string> | null

Language code applied to created profiles (one of the platform-languages.json codes). Defaults to 'en' when omitted.

Available options:
ar,
bg,
zh,
hr,
cs,
da,
nl,
en,
fil,
fi,
fr,
de,
el,
hi,
hu,
id,
it,
ja,
ko,
ms,
no,
pl,
pt,
br,
ro,
ru,
sk,
es,
sv,
ta,
th,
tr,
uk,
vi
Example:

"en"

message_from_recruiter
string | null

Optional custom message included in the invitation email.

Response

The users array with per-item invitation results.

email
string
required
name
string | null
type
string | null
interview_id
string | null
result
string

Outcome, e.g. 'Invited', 'Activated', 'SubMerchantAdded', 'Skipped', or 'Error: '.

profile_id
string | null
profile_interview_id
string | null
{key}
unknown