Create Role Template
Create Role Template
POST
https://api.ocamba.com/v1/hood/role-templates
Creates a role template. Required field is name. Optional description and permissions. The first template in the application gets both assign_on_install and assign_on_join set to 1. Later templates get both set to 0 — use the set-assign endpoints to change that.
Warning
Only the application owner may create role templates. Other callers receive 403.
Note
Do not send id, assign_on_install, assign_on_join, deprecated, or permissions_counter. The server sets those.
Rate limits:
- Burst: 10/s
- Steady: 150/m
Request schema
bodyResponse schemas
›
201
application/json
›
400
application/json
›
403
application/json
›
500
application/json
curl -X POST \
"https://api.ocamba.com/v1/hood/role-templates" \
-H "Authorization: Bearer {TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "Admin",
"description": "Full access for the person who installs the app.",
"permissions": [
"members.get",
"roles.get",
"containers.get"
]
}'const url = 'https://api.ocamba.com/v1/hood/role-templates';
const options = {
method: 'POST',
headers: {
Authorization: "Bearer {TOKEN}",
'Content-Type': "application/json"
},
body: JSON.stringify(
{
"name": "Admin",
"description": "Full access for the person who installs the app.",
"permissions": [
"members.get",
"roles.get",
"containers.get"
]
}
)
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}$ch = curl_init("https://api.ocamba.com/v1/hood/role-templates");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer {TOKEN}",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"name" => "Admin",
"description" => "Full access for the person who installs the app.",
"permissions" => [
"members.get",
"roles.get",
"containers.get"
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);Responses
201 Created
{
"id": "100",
"name": "Admin",
"description": "Full access for the person who installs the app.",
"assign_on_install": 1,
"assign_on_join": 1,
"permissions": [
"members.get",
"roles.get",
"containers.get"
],
"permissions_counter": 3,
"deprecated": 0,
"create_time": "2026-03-20 14:00:00",
"update_time": "2026-03-20 14:00:00"
}
400 Bad Request
{
"code": 400,
"title": "Bad request.",
"message": "The request is not valid.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
403 Forbidden
{
"code": 403,
"title": "Forbidden",
"message": "You are not allowed to perform this action.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
500 Internal Server Error
{
"code": 500,
"title": "Internal server error.",
"trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses