Organization
Edit a custom role
Requires a current human organization owner or admin, plus write:org for OAuth tokens and API keys. Service accounts are refused, including administrative ones. Browser writes require a live uncached session and trusted Origin. Changes the name, the scopes or both; scopes replaces the whole set. The create rules for names and scopes apply, except that a scope the role already holds is kept even if it has left supportedScopes.
PATCH
/
api
/
v1
/
authentication
/
orgs
/
{orgId}
/
roles
/
{roleId}
CSharp (SDK)
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Requests;
var sdk = new SDK();
var res = await sdk.Auth.Orgs.UpdateRoleAsync(
security: new UpdateOrgRoleSecurity() {
BearerAuth = "<YOUR_BEARER_TOKEN_HERE>",
},
orgId: "<id>",
roleId: "<id>",
body: new UpdateOrgRoleRequestBody() {}
);
// handle responsefrom meetkai_mka1 import SDK, models
with SDK() as sdk:
res = sdk.auth.orgs.update_role(security=models.UpdateOrgRoleSecurity(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
), org_id="<id>", role_id="<id>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.auth.orgs.updateRole({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
}, {
orgId: "<id>",
roleId: "<id>",
requestBody: {},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New()
res, err := s.Auth.Orgs.UpdateRole(ctx, operations.UpdateOrgRoleSecurity{
BearerAuth: mka1.Pointer("<YOUR_BEARER_TOKEN_HERE>"),
}, "<id>", "<id>", operations.UpdateOrgRoleRequestBody{}, nil)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}curl --request PATCH \
--url https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>']})
};
fetch('https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}', 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://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<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;
}HttpResponse<String> response = Unirest.patch("https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"role": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
bearerAuthsessionCookie
Was this page helpful?
⌘I
CSharp (SDK)
using MeetKai.MKA1;
using MeetKai.MKA1.Types.Requests;
var sdk = new SDK();
var res = await sdk.Auth.Orgs.UpdateRoleAsync(
security: new UpdateOrgRoleSecurity() {
BearerAuth = "<YOUR_BEARER_TOKEN_HERE>",
},
orgId: "<id>",
roleId: "<id>",
body: new UpdateOrgRoleRequestBody() {}
);
// handle responsefrom meetkai_mka1 import SDK, models
with SDK() as sdk:
res = sdk.auth.orgs.update_role(security=models.UpdateOrgRoleSecurity(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
), org_id="<id>", role_id="<id>")
# Handle response
print(res)import { SDK } from "@meetkai/mka1";
const sdk = new SDK();
async function run() {
const result = await sdk.auth.orgs.updateRole({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
}, {
orgId: "<id>",
roleId: "<id>",
requestBody: {},
});
console.log(result);
}
run();package main
import(
"context"
mka1 "github.com/MeetKai/mka1-sdks/go"
"github.com/MeetKai/mka1-sdks/go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := mka1.New()
res, err := s.Auth.Orgs.UpdateRole(ctx, operations.UpdateOrgRoleSecurity{
BearerAuth: mka1.Pointer("<YOUR_BEARER_TOKEN_HERE>"),
}, "<id>", "<id>", operations.UpdateOrgRoleRequestBody{}, nil)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}curl --request PATCH \
--url https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"scopes": [
"<string>"
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', scopes: ['<string>']})
};
fetch('https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}', 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://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'scopes' => [
'<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;
}HttpResponse<String> response = Unirest.patch("https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apigw.mka1.com/api/v1/authentication/orgs/{orgId}/roles/{roleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"scopes\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"role": {
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"scopes": [
"<string>"
],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}