curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/users/invite-users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_emails": [
"jane@acme.com",
"sam@acme.com"
],
"role": "user"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/users/invite-users"
payload = {
"user_emails": ["jane@acme.com", "sam@acme.com"],
"role": "user"
}
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({user_emails: ['jane@acme.com', 'sam@acme.com'], role: 'user'})
};
fetch('https://app.base44.com/api/apps/{app_id}/users/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://app.base44.com/api/apps/{app_id}/users/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([
'user_emails' => [
'jane@acme.com',
'sam@acme.com'
],
'role' => 'user'
]),
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://app.base44.com/api/apps/{app_id}/users/invite-users"
payload := strings.NewReader("{\n \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\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://app.base44.com/api/apps/{app_id}/users/invite-users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/users/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 \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"email": "jane@acme.com",
"success": true
},
{
"email": "sam@acme.com",
"error": "Builder already exists.",
"success": false
}
]
}Invite app users
Invites people to the app by email. Each address gets an invitation email with a link to the app.
Set role to the role they get in the app, user unless you say otherwise. Set collaborator_role to editor to also let them edit the app in Base44. An editor invitation only goes to members of the app’s workspace unless you also set add_as_guest, which adds anyone else to the workspace as a guest. Only workspace editors and admins can add guests.
An invitation that fails doesn’t fail the call. You get a 200 with one entry per address in results, so check success on each. Invited people appear in List app users once they sign in to the app.
Every address counts toward the app’s daily invitation allowance, which depends on your plan, including addresses whose invitation then fails. A call that would go over it is refused with a 429 and sends nothing.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/users/invite-users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_emails": [
"jane@acme.com",
"sam@acme.com"
],
"role": "user"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/users/invite-users"
payload = {
"user_emails": ["jane@acme.com", "sam@acme.com"],
"role": "user"
}
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({user_emails: ['jane@acme.com', 'sam@acme.com'], role: 'user'})
};
fetch('https://app.base44.com/api/apps/{app_id}/users/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://app.base44.com/api/apps/{app_id}/users/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([
'user_emails' => [
'jane@acme.com',
'sam@acme.com'
],
'role' => 'user'
]),
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://app.base44.com/api/apps/{app_id}/users/invite-users"
payload := strings.NewReader("{\n \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\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://app.base44.com/api/apps/{app_id}/users/invite-users")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/users/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 \"user_emails\": [\n \"jane@acme.com\",\n \"sam@acme.com\"\n ],\n \"role\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"email": "jane@acme.com",
"success": true
},
{
"email": "sam@acme.com",
"error": "Builder already exists.",
"success": false
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app to invite the users to.
Body
Email addresses to invite, up to 50 per call.
50["jane@acme.com", "sam@acme.com"]
Role the invited people get in the app, such as user or admin. It isn't checked against the roles the app defines.
"user"
Set to editor to also let them edit the app in Base44.
editor "editor"
With collaborator_role set to editor, adds anyone outside the app's workspace to it as a guest instead of failing their invitation.
false
Response
The outcome of each invitation.
The outcome of each invitation, in the order you sent them.
One entry per address you sent.
Show child attributes
Show child attributes
[
{ "email": "jane@acme.com", "success": true },
{
"email": "sam@acme.com",
"error": "Builder already exists.",
"success": false
}
]
Was this page helpful?