curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/group-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group_ids": [
"68c9a0f1d2e4b5001f3a7c90"
],
"role": "user"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/group-shares"
payload = {
"group_ids": ["68c9a0f1d2e4b5001f3a7c90"],
"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({group_ids: ['68c9a0f1d2e4b5001f3a7c90'], role: 'user'})
};
fetch('https://app.base44.com/api/apps/{app_id}/group-shares', 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}/group-shares",
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([
'group_ids' => [
'68c9a0f1d2e4b5001f3a7c90'
],
'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}/group-shares"
payload := strings.NewReader("{\n \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\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}/group-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\n ],\n \"role\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/group-shares")
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 \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\n ],\n \"role\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"group_id": "68c9a0f1d2e4b5001f3a7c90",
"success": true
}
]
}Share app with groups
Shares the app with one or more workspace groups, giving every member of each group access to the app.
All the groups get the same role. A member’s role in the app is the highest of the role you gave them directly and the roles of all the groups they’re in that the app is shared with. Members usually get access right away, and always by their next sign-in. Members your identity provider synced who don’t have a Base44 account yet get access once they have one. Each member who gets access is also sent an invitation email, at most once per app.
Each group succeeds or fails on its own, so read results rather than treating a successful response as every group shared. Sending a group the app is already shared with fails that group with already_shared and changes nothing, so retrying is safe. Change a share’s role afterwards with Update group share.
You need editor access to the app, and an editor or admin role in the app’s workspace. Your workspace’s plan must include workspace groups.
This is limited to 30 requests per minute. A signed-in session has its own limit, and every personal access token for the workspace shares one. Some workspaces have a different limit.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/group-shares \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"group_ids": [
"68c9a0f1d2e4b5001f3a7c90"
],
"role": "user"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/group-shares"
payload = {
"group_ids": ["68c9a0f1d2e4b5001f3a7c90"],
"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({group_ids: ['68c9a0f1d2e4b5001f3a7c90'], role: 'user'})
};
fetch('https://app.base44.com/api/apps/{app_id}/group-shares', 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}/group-shares",
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([
'group_ids' => [
'68c9a0f1d2e4b5001f3a7c90'
],
'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}/group-shares"
payload := strings.NewReader("{\n \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\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}/group-shares")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\n ],\n \"role\": \"user\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/group-shares")
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 \"group_ids\": [\n \"68c9a0f1d2e4b5001f3a7c90\"\n ],\n \"role\": \"user\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"group_id": "68c9a0f1d2e4b5001f3a7c90",
"success": true
}
]
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Path Parameters
ID of the app.
Body
IDs of the workspace groups to share the app with, 1 to 50. A repeated ID counts once.
1 - 50 elements["68c9a0f1d2e4b5001f3a7c90"]
App role every member of these groups gets, one of the roles defined on the app's User entity. Leave it out, or send null, to assign no role, so members get the default user role.
"user"
Response
One result per group.
One result per group, in the order you sent them.
Show child attributes
Show child attributes
[
{
"group_id": "68c9a0f1d2e4b5001f3a7c90",
"success": true
}
]
Was this page helpful?