roles
Create a role
Creates a new role in a gateway. model_policies cannot be set on create; bind registries first, then update the role.
POST
/
v1
/
gateways
/
{gateway_id}
/
roles
Create a role
curl --request POST \
--url https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"mcp_policies": {
"fail_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [
123
]
}
'import requests
url = "https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles"
payload = {
"mcp_policies": {
"fail_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": ["<string>"],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [123]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mcp_policies: {
fail_mode: '<string>',
toolkit: [
{
expose_as: '<string>',
prompt: '<string>',
registry_id: '<string>',
resource: '<string>',
tool: '<string>'
}
]
},
model_policies: [{allowed: ['<string>'], default: '<string>', registry_id: '<string>'}],
name: '<string>',
oidc_mapping: [123]
})
};
fetch('https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mcp_policies' => [
'fail_mode' => '<string>',
'toolkit' => [
[
'expose_as' => '<string>',
'prompt' => '<string>',
'registry_id' => '<string>',
'resource' => '<string>',
'tool' => '<string>'
]
]
],
'model_policies' => [
[
'allowed' => [
'<string>'
],
'default' => '<string>',
'registry_id' => '<string>'
]
],
'name' => '<string>',
'oidc_mapping' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles"
payload := strings.NewReader("{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"gateway_id": "<string>",
"id": "<string>",
"mcp_policies": {
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [
123
],
"registry_ids": [
"<string>"
],
"updated_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Gateway id
Body
application/json
Role to create
⌘I
Create a role
curl --request POST \
--url https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"mcp_policies": {
"fail_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [
123
]
}
'import requests
url = "https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles"
payload = {
"mcp_policies": {
"fail_mode": "<string>",
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": ["<string>"],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [123]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mcp_policies: {
fail_mode: '<string>',
toolkit: [
{
expose_as: '<string>',
prompt: '<string>',
registry_id: '<string>',
resource: '<string>',
tool: '<string>'
}
]
},
model_policies: [{allowed: ['<string>'], default: '<string>', registry_id: '<string>'}],
name: '<string>',
oidc_mapping: [123]
})
};
fetch('https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mcp_policies' => [
'fail_mode' => '<string>',
'toolkit' => [
[
'expose_as' => '<string>',
'prompt' => '<string>',
'registry_id' => '<string>',
'resource' => '<string>',
'tool' => '<string>'
]
]
],
'model_policies' => [
[
'allowed' => [
'<string>'
],
'default' => '<string>',
'registry_id' => '<string>'
]
],
'name' => '<string>',
'oidc_mapping' => [
123
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles"
payload := strings.NewReader("{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://agentgateway-admin.dev.neuraltrust.ai/v1/gateways/{gateway_id}/roles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mcp_policies\": {\n \"fail_mode\": \"<string>\",\n \"toolkit\": [\n {\n \"expose_as\": \"<string>\",\n \"prompt\": \"<string>\",\n \"registry_id\": \"<string>\",\n \"resource\": \"<string>\",\n \"tool\": \"<string>\"\n }\n ]\n },\n \"model_policies\": [\n {\n \"allowed\": [\n \"<string>\"\n ],\n \"default\": \"<string>\",\n \"registry_id\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"oidc_mapping\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "<string>",
"gateway_id": "<string>",
"id": "<string>",
"mcp_policies": {
"toolkit": [
{
"expose_as": "<string>",
"prompt": "<string>",
"registry_id": "<string>",
"resource": "<string>",
"tool": "<string>"
}
]
},
"model_policies": [
{
"allowed": [
"<string>"
],
"default": "<string>",
"registry_id": "<string>"
}
],
"name": "<string>",
"oidc_mapping": [
123
],
"registry_ids": [
"<string>"
],
"updated_at": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}