Create a custom role (members.manage)
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/roles"
payload = {
"slug": "<string>",
"name": "<string>"
}
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({slug: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/organisation/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/organisation/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
],
"kube_grants": [
{
"scope": "cluster",
"k8s_role": "view",
"namespace": "<string>"
}
]
}Organisation IAM
Create a custom role (members.manage)
POST
/
api
/
v1
/
org
/
organisation
/
roles
Create a custom role (members.manage)
import requests
url = "https://platform.ankra.app/api/v1/org/organisation/roles"
payload = {
"slug": "<string>",
"name": "<string>"
}
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({slug: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/org/organisation/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/organisation/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "<string>",
"name": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": [
"<string>"
],
"kube_grants": [
{
"scope": "cluster",
"k8s_role": "view",
"namespace": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json