Add Users to Group
curl --request PUT \
--url https://api.us.lexful.app/v1/groups/{groupId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <api-key>' \
--data '
[
"7c9e6679-7425-40de-944b-e07fc1f90ae7",
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
'import requests
url = "https://api.us.lexful.app/v1/groups/{groupId}/users"
payload = ["7c9e6679-7425-40de-944b-e07fc1f90ae7", "f47ac10b-58cc-4372-a567-0e02b2c3d479", "6ba7b810-9dad-11d1-80b4-00c04fd430c8"]
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Account-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
'7c9e6679-7425-40de-944b-e07fc1f90ae7',
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
])
};
fetch('https://api.us.lexful.app/v1/groups/{groupId}/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://api.us.lexful.app/v1/groups/{groupId}/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'7c9e6679-7425-40de-944b-e07fc1f90ae7',
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <api-key>"
],
]);
$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://api.us.lexful.app/v1/groups/{groupId}/users"
payload := strings.NewReader("[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Account-ID", "<api-key>")
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.put("https://api.us.lexful.app/v1/groups/{groupId}/users")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/groups/{groupId}/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Account-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]"
response = http.request(request)
puts response.read_body{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Groups
Add Users to Group
Add multiple users to a group in a single request. This operation is idempotent - duplicate memberships are silently ignored.
Behavior:
- Maximum 100 users per request
- Duplicate user IDs in the request are handled gracefully
- Users already in the group are silently ignored
- All user IDs must belong to the same account as the group
- All user IDs must exist (validated before any changes)
- If any user validation fails, the entire operation is rejected (no partial updates)
Permissions: Requires group_update permission
PUT
/
v1
/
groups
/
{groupId}
/
users
Add Users to Group
curl --request PUT \
--url https://api.us.lexful.app/v1/groups/{groupId}/users \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <api-key>' \
--data '
[
"7c9e6679-7425-40de-944b-e07fc1f90ae7",
"f47ac10b-58cc-4372-a567-0e02b2c3d479",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
'import requests
url = "https://api.us.lexful.app/v1/groups/{groupId}/users"
payload = ["7c9e6679-7425-40de-944b-e07fc1f90ae7", "f47ac10b-58cc-4372-a567-0e02b2c3d479", "6ba7b810-9dad-11d1-80b4-00c04fd430c8"]
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'X-Account-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify([
'7c9e6679-7425-40de-944b-e07fc1f90ae7',
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
])
};
fetch('https://api.us.lexful.app/v1/groups/{groupId}/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://api.us.lexful.app/v1/groups/{groupId}/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'7c9e6679-7425-40de-944b-e07fc1f90ae7',
'f47ac10b-58cc-4372-a567-0e02b2c3d479',
'6ba7b810-9dad-11d1-80b4-00c04fd430c8'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <api-key>"
],
]);
$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://api.us.lexful.app/v1/groups/{groupId}/users"
payload := strings.NewReader("[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Account-ID", "<api-key>")
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.put("https://api.us.lexful.app/v1/groups/{groupId}/users")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/groups/{groupId}/users")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Account-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"7c9e6679-7425-40de-944b-e07fc1f90ae7\",\n \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n]"
response = http.request(request)
puts response.read_body{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Authorizations
Bearer token
Account ID
Path Parameters
Group ID
Body
application/json
Array of user IDs to add to the group (max 100 per request)
Required array length:
1 - 100 elementsResponse
Allowed IP deleted successfully
Was this page helpful?
⌘I