Access Profile API
Create Access Profile
Create a new access profile for a workspace.
POST
/
v2
/
access-profiles
Create Access Profile
curl --request POST \
--url https://public.api.serval.com/v2/access-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"matchingCriteria": {
"groups": {
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123
}
]
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"scopedId": "<string>",
"birthright": {
"enabled": true,
"matchingCriteria": {
"groups": {
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123
}
]
}
},
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"accessBundleIds": [
"<string>"
]
},
"accessBundles": {
"accessBundleIds": [
"<string>"
]
}
}
'import requests
url = "https://public.api.serval.com/v2/access-profiles"
payload = {
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"matchingCriteria": {
"groups": {
"includedGroupIds": ["<string>"],
"excludedGroupIds": ["<string>"]
},
"currentTeam": {
"teamRoles": [],
"customRoles": { "customRoleIds": ["<string>"] }
},
"attributes": { "criteria": [
{
"attributeKey": "<string>",
"matchValues": ["<string>"],
"isExcluded": True,
"conditionGroup": 123
}
] }
},
"grants": {
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"workflows": [{ "workflowId": "<string>" }],
"forms": [{ "formId": "<string>" }],
"skills": { "skills": [{ "skillId": "<string>" }] }
},
"scopedId": "<string>",
"birthright": {
"enabled": True,
"matchingCriteria": {
"groups": {
"includedGroupIds": ["<string>"],
"excludedGroupIds": ["<string>"]
},
"currentTeam": {
"teamRoles": [],
"customRoles": { "customRoleIds": ["<string>"] }
},
"attributes": { "criteria": [
{
"attributeKey": "<string>",
"matchValues": ["<string>"],
"isExcluded": True,
"conditionGroup": 123
}
] }
},
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"accessBundleIds": ["<string>"]
},
"accessBundles": { "accessBundleIds": ["<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({
teamId: '<string>',
name: '<string>',
description: '<string>',
matchingCriteria: {
groups: {includedGroupIds: ['<string>'], excludedGroupIds: ['<string>']},
currentTeam: {teamRoles: [], customRoles: {customRoleIds: ['<string>']}},
attributes: {
criteria: [
{
attributeKey: '<string>',
matchValues: ['<string>'],
isExcluded: true,
conditionGroup: 123
}
]
}
},
grants: {
appResourceRoles: [{appResourceRoleId: '<string>'}],
workflows: [{workflowId: '<string>'}],
forms: [{formId: '<string>'}],
skills: {skills: [{skillId: '<string>'}]}
},
scopedId: '<string>',
birthright: {
enabled: true,
matchingCriteria: {
groups: {includedGroupIds: ['<string>'], excludedGroupIds: ['<string>']},
currentTeam: {teamRoles: [], customRoles: {customRoleIds: ['<string>']}},
attributes: {
criteria: [
{
attributeKey: '<string>',
matchValues: ['<string>'],
isExcluded: true,
conditionGroup: 123
}
]
}
},
appResourceRoles: [{appResourceRoleId: '<string>'}],
accessBundleIds: ['<string>']
},
accessBundles: {accessBundleIds: ['<string>']}
})
};
fetch('https://public.api.serval.com/v2/access-profiles', 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://public.api.serval.com/v2/access-profiles",
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([
'teamId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'matchingCriteria' => [
'groups' => [
'includedGroupIds' => [
'<string>'
],
'excludedGroupIds' => [
'<string>'
]
],
'currentTeam' => [
'teamRoles' => [
],
'customRoles' => [
'customRoleIds' => [
'<string>'
]
]
],
'attributes' => [
'criteria' => [
[
'attributeKey' => '<string>',
'matchValues' => [
'<string>'
],
'isExcluded' => true,
'conditionGroup' => 123
]
]
]
],
'grants' => [
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'workflows' => [
[
'workflowId' => '<string>'
]
],
'forms' => [
[
'formId' => '<string>'
]
],
'skills' => [
'skills' => [
[
'skillId' => '<string>'
]
]
]
],
'scopedId' => '<string>',
'birthright' => [
'enabled' => true,
'matchingCriteria' => [
'groups' => [
'includedGroupIds' => [
'<string>'
],
'excludedGroupIds' => [
'<string>'
]
],
'currentTeam' => [
'teamRoles' => [
],
'customRoles' => [
'customRoleIds' => [
'<string>'
]
]
],
'attributes' => [
'criteria' => [
[
'attributeKey' => '<string>',
'matchValues' => [
'<string>'
],
'isExcluded' => true,
'conditionGroup' => 123
]
]
]
],
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'accessBundleIds' => [
'<string>'
]
],
'accessBundles' => [
'accessBundleIds' => [
'<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.api.serval.com/v2/access-profiles"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://public.api.serval.com/v2/access-profiles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/access-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"isTeamDefault": true,
"createdAt": "2025-01-15T01:30:15.000Z",
"matchingCriteria": {
"groups": {
"matchType": "ACCESS_PROFILE_GROUP_MATCH_TYPE_UNSPECIFIED",
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [
"TEAM_ROLE_UNSPECIFIED"
],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123,
"operator": "ACCESS_PROFILE_ATTRIBUTE_OPERATOR_UNSPECIFIED"
}
]
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"builtinProfileType": "<string>",
"scopedId": "<string>",
"birthright": {
"enabled": true,
"matchingCriteria": {
"groups": {
"matchType": "ACCESS_PROFILE_GROUP_MATCH_TYPE_UNSPECIFIED",
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [
"TEAM_ROLE_UNSPECIFIED"
],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123,
"operator": "ACCESS_PROFILE_ATTRIBUTE_OPERATOR_UNSPECIFIED"
}
]
}
},
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"unmatchAction": "ACCESS_PROFILE_UNMATCH_ACTION_UNSPECIFIED",
"accessBundleIds": [
"<string>"
]
},
"accessBundles": {
"accessBundleIds": [
"<string>"
]
}
}
}Authentication and permissions
Token requirements: User-based token (OAuth) or Organization-scoped API key or Workspace-scoped API key. Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
| Credential | Access requirements |
|---|---|
| Organization-scoped API key | Request eligibility: settings:writeWith a birthright policy: access-profiles:assign + settings:write |
| Workspace-scoped API key | Request eligibility: settings:writeWith a birthright policy: access-profiles:assign + settings:write |
| User-based token (OAuth) | Supported, subject to permissions |
- Request eligibility: The birthright policy is omitted.
- With a birthright policy: A birthright policy is supplied, including when disabled. Its audience and automatic roles are independent of request eligibility.
Authorizations
Body
application/json
Deprecated: create the profile first, then attach grants through the access-profile-grant endpoints (/v2/access-profile-grants). Still honored for compatibility until writes are rejected. Roles listed here control request eligibility; birthright has a separate role list.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Create Access Profile
curl --request POST \
--url https://public.api.serval.com/v2/access-profiles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"matchingCriteria": {
"groups": {
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123
}
]
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"scopedId": "<string>",
"birthright": {
"enabled": true,
"matchingCriteria": {
"groups": {
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123
}
]
}
},
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"accessBundleIds": [
"<string>"
]
},
"accessBundles": {
"accessBundleIds": [
"<string>"
]
}
}
'import requests
url = "https://public.api.serval.com/v2/access-profiles"
payload = {
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"matchingCriteria": {
"groups": {
"includedGroupIds": ["<string>"],
"excludedGroupIds": ["<string>"]
},
"currentTeam": {
"teamRoles": [],
"customRoles": { "customRoleIds": ["<string>"] }
},
"attributes": { "criteria": [
{
"attributeKey": "<string>",
"matchValues": ["<string>"],
"isExcluded": True,
"conditionGroup": 123
}
] }
},
"grants": {
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"workflows": [{ "workflowId": "<string>" }],
"forms": [{ "formId": "<string>" }],
"skills": { "skills": [{ "skillId": "<string>" }] }
},
"scopedId": "<string>",
"birthright": {
"enabled": True,
"matchingCriteria": {
"groups": {
"includedGroupIds": ["<string>"],
"excludedGroupIds": ["<string>"]
},
"currentTeam": {
"teamRoles": [],
"customRoles": { "customRoleIds": ["<string>"] }
},
"attributes": { "criteria": [
{
"attributeKey": "<string>",
"matchValues": ["<string>"],
"isExcluded": True,
"conditionGroup": 123
}
] }
},
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"accessBundleIds": ["<string>"]
},
"accessBundles": { "accessBundleIds": ["<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({
teamId: '<string>',
name: '<string>',
description: '<string>',
matchingCriteria: {
groups: {includedGroupIds: ['<string>'], excludedGroupIds: ['<string>']},
currentTeam: {teamRoles: [], customRoles: {customRoleIds: ['<string>']}},
attributes: {
criteria: [
{
attributeKey: '<string>',
matchValues: ['<string>'],
isExcluded: true,
conditionGroup: 123
}
]
}
},
grants: {
appResourceRoles: [{appResourceRoleId: '<string>'}],
workflows: [{workflowId: '<string>'}],
forms: [{formId: '<string>'}],
skills: {skills: [{skillId: '<string>'}]}
},
scopedId: '<string>',
birthright: {
enabled: true,
matchingCriteria: {
groups: {includedGroupIds: ['<string>'], excludedGroupIds: ['<string>']},
currentTeam: {teamRoles: [], customRoles: {customRoleIds: ['<string>']}},
attributes: {
criteria: [
{
attributeKey: '<string>',
matchValues: ['<string>'],
isExcluded: true,
conditionGroup: 123
}
]
}
},
appResourceRoles: [{appResourceRoleId: '<string>'}],
accessBundleIds: ['<string>']
},
accessBundles: {accessBundleIds: ['<string>']}
})
};
fetch('https://public.api.serval.com/v2/access-profiles', 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://public.api.serval.com/v2/access-profiles",
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([
'teamId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'matchingCriteria' => [
'groups' => [
'includedGroupIds' => [
'<string>'
],
'excludedGroupIds' => [
'<string>'
]
],
'currentTeam' => [
'teamRoles' => [
],
'customRoles' => [
'customRoleIds' => [
'<string>'
]
]
],
'attributes' => [
'criteria' => [
[
'attributeKey' => '<string>',
'matchValues' => [
'<string>'
],
'isExcluded' => true,
'conditionGroup' => 123
]
]
]
],
'grants' => [
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'workflows' => [
[
'workflowId' => '<string>'
]
],
'forms' => [
[
'formId' => '<string>'
]
],
'skills' => [
'skills' => [
[
'skillId' => '<string>'
]
]
]
],
'scopedId' => '<string>',
'birthright' => [
'enabled' => true,
'matchingCriteria' => [
'groups' => [
'includedGroupIds' => [
'<string>'
],
'excludedGroupIds' => [
'<string>'
]
],
'currentTeam' => [
'teamRoles' => [
],
'customRoles' => [
'customRoleIds' => [
'<string>'
]
]
],
'attributes' => [
'criteria' => [
[
'attributeKey' => '<string>',
'matchValues' => [
'<string>'
],
'isExcluded' => true,
'conditionGroup' => 123
]
]
]
],
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'accessBundleIds' => [
'<string>'
]
],
'accessBundles' => [
'accessBundleIds' => [
'<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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public.api.serval.com/v2/access-profiles"
payload := strings.NewReader("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://public.api.serval.com/v2/access-profiles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public.api.serval.com/v2/access-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"teamId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"grants\": {\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"workflows\": [\n {\n \"workflowId\": \"<string>\"\n }\n ],\n \"forms\": [\n {\n \"formId\": \"<string>\"\n }\n ],\n \"skills\": {\n \"skills\": [\n {\n \"skillId\": \"<string>\"\n }\n ]\n }\n },\n \"scopedId\": \"<string>\",\n \"birthright\": {\n \"enabled\": true,\n \"matchingCriteria\": {\n \"groups\": {\n \"includedGroupIds\": [\n \"<string>\"\n ],\n \"excludedGroupIds\": [\n \"<string>\"\n ]\n },\n \"currentTeam\": {\n \"teamRoles\": [],\n \"customRoles\": {\n \"customRoleIds\": [\n \"<string>\"\n ]\n }\n },\n \"attributes\": {\n \"criteria\": [\n {\n \"attributeKey\": \"<string>\",\n \"matchValues\": [\n \"<string>\"\n ],\n \"isExcluded\": true,\n \"conditionGroup\": 123\n }\n ]\n }\n },\n \"appResourceRoles\": [\n {\n \"appResourceRoleId\": \"<string>\"\n }\n ],\n \"accessBundleIds\": [\n \"<string>\"\n ]\n },\n \"accessBundles\": {\n \"accessBundleIds\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"teamId": "<string>",
"name": "<string>",
"description": "<string>",
"isTeamDefault": true,
"createdAt": "2025-01-15T01:30:15.000Z",
"matchingCriteria": {
"groups": {
"matchType": "ACCESS_PROFILE_GROUP_MATCH_TYPE_UNSPECIFIED",
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [
"TEAM_ROLE_UNSPECIFIED"
],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123,
"operator": "ACCESS_PROFILE_ATTRIBUTE_OPERATOR_UNSPECIFIED"
}
]
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"builtinProfileType": "<string>",
"scopedId": "<string>",
"birthright": {
"enabled": true,
"matchingCriteria": {
"groups": {
"matchType": "ACCESS_PROFILE_GROUP_MATCH_TYPE_UNSPECIFIED",
"includedGroupIds": [
"<string>"
],
"excludedGroupIds": [
"<string>"
]
},
"currentTeam": {
"teamRoles": [
"TEAM_ROLE_UNSPECIFIED"
],
"customRoles": {
"customRoleIds": [
"<string>"
]
}
},
"attributes": {
"criteria": [
{
"attributeKey": "<string>",
"matchValues": [
"<string>"
],
"isExcluded": true,
"conditionGroup": 123,
"operator": "ACCESS_PROFILE_ATTRIBUTE_OPERATOR_UNSPECIFIED"
}
]
}
},
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"unmatchAction": "ACCESS_PROFILE_UNMATCH_ACTION_UNSPECIFIED",
"accessBundleIds": [
"<string>"
]
},
"accessBundles": {
"accessBundleIds": [
"<string>"
]
}
}
}
