Remove roles from community users
curl --request DELETE \
--url https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>'import requests
url = "https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
}
};
fetch('https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles', 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://apix.us.amity.co/api/v4/communities/{communityId}/users/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"communities": [
{
"communityId": "<string>",
"channelId": "<string>",
"displayName": "<string>",
"_id": "<string>",
"path": "<string>",
"userId": "<string>",
"userPublicId": "<string>",
"userInternalId": "<string>",
"avatarFileId": "<string>",
"description": "<string>",
"isOfficial": true,
"isPublic": true,
"onlyAdminCanPost": true,
"tags": [
"<string>"
],
"metadata": {},
"postsCount": 123,
"membersCount": 123,
"isJoined": true,
"categoryIds": [
"<string>"
],
"isDeleted": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hasFlaggedComment": false,
"hasFlaggedPost": false,
"needApprovalOnPostCreation": false,
"moderatorMemberCount": 123,
"allowCommentInStory": true,
"isDiscoverable": false,
"requiresJoinApproval": false
}
],
"communityUsers": [
{
"userId": "<string>",
"userPublicId": "<string>",
"userInternalId": "<string>",
"channelId": "<string>",
"communityId": "<string>",
"notMemberReason": "<string>",
"isBanned": false,
"lastActivity": "2023-11-07T05:31:56Z",
"roles": [
"<string>"
],
"permissions": [],
"lastJoin": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"categories": [
{
"categoryId": "<string>",
"name": "<string>",
"metadata": {},
"avatarFileId": "<string>",
"isDeleted": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"feeds": [
{
"targetId": "<string>",
"postCount": 123,
"feedId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"joinRequests": [
{
"_id": "<string>",
"networkId": "<string>",
"targetId": "<string>",
"targetType": "<string>",
"type": "<string>",
"userId": "<string>",
"status": "<string>",
"respondedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"joinRequestId": "<string>",
"requestorId": "<string>",
"requestorPublicId": "<string>",
"requestorInternalId": "<string>",
"responderId": "<string>",
"responderPublicId": "<string>",
"responderInternalId": "<string>"
}
]
}Community
Remove roles from community users
Remove roles from community users.
DELETE
/
api
/
v4
/
communities
/
{communityId}
/
users
/
roles
Remove roles from community users
curl --request DELETE \
--url https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-API-Key: <api-key>'import requests
url = "https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles"
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>",
"X-API-Key": "<api-key>"
}
response = requests.delete(url, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {
Authorization: '<authorization>',
'Content-Type': '<content-type>',
'X-API-Key': '<api-key>'
}
};
fetch('https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles', 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://apix.us.amity.co/api/v4/communities/{communityId}/users/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-API-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v4/communities/{communityId}/users/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"communities": [
{
"communityId": "<string>",
"channelId": "<string>",
"displayName": "<string>",
"_id": "<string>",
"path": "<string>",
"userId": "<string>",
"userPublicId": "<string>",
"userInternalId": "<string>",
"avatarFileId": "<string>",
"description": "<string>",
"isOfficial": true,
"isPublic": true,
"onlyAdminCanPost": true,
"tags": [
"<string>"
],
"metadata": {},
"postsCount": 123,
"membersCount": 123,
"isJoined": true,
"categoryIds": [
"<string>"
],
"isDeleted": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hasFlaggedComment": false,
"hasFlaggedPost": false,
"needApprovalOnPostCreation": false,
"moderatorMemberCount": 123,
"allowCommentInStory": true,
"isDiscoverable": false,
"requiresJoinApproval": false
}
],
"communityUsers": [
{
"userId": "<string>",
"userPublicId": "<string>",
"userInternalId": "<string>",
"channelId": "<string>",
"communityId": "<string>",
"notMemberReason": "<string>",
"isBanned": false,
"lastActivity": "2023-11-07T05:31:56Z",
"roles": [
"<string>"
],
"permissions": [],
"lastJoin": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"categories": [
{
"categoryId": "<string>",
"name": "<string>",
"metadata": {},
"avatarFileId": "<string>",
"isDeleted": false,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"feeds": [
{
"targetId": "<string>",
"postCount": 123,
"feedId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"joinRequests": [
{
"_id": "<string>",
"networkId": "<string>",
"targetId": "<string>",
"targetType": "<string>",
"type": "<string>",
"userId": "<string>",
"status": "<string>",
"respondedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"joinRequestId": "<string>",
"requestorId": "<string>",
"requestorPublicId": "<string>",
"requestorInternalId": "<string>",
"responderId": "<string>",
"responderPublicId": "<string>",
"responderInternalId": "<string>"
}
]
}Authorizations
Path Parameters
Required string length:
1 - 900Query Parameters
list of role id
Required array length:
1 - 100 elementsRole id
Required string length:
1 - 100list of user id
Required array length:
1 - 100 elementsRequired string length:
1 - 50Response
Communities Information
⌘I