Create Access Profile
Create a new access profile for a team.
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>"
]
}
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"scopedId": "<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>"] }
}
},
"grants": {
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"workflows": [{ "workflowId": "<string>" }],
"forms": [{ "formId": "<string>" }],
"skills": { "skills": [{ "skillId": "<string>" }] }
},
"scopedId": "<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>']}}
},
grants: {
appResourceRoles: [{appResourceRoleId: '<string>'}],
workflows: [{workflowId: '<string>'}],
forms: [{formId: '<string>'}],
skills: {skills: [{skillId: '<string>'}]}
},
scopedId: '<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>'
]
]
]
],
'grants' => [
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'workflows' => [
[
'workflowId' => '<string>'
]
],
'forms' => [
[
'formId' => '<string>'
]
],
'skills' => [
'skills' => [
[
'skillId' => '<string>'
]
]
]
],
'scopedId' => '<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 },\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}")
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 },\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}")
.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 },\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}"
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>"
]
}
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"builtinProfileType": "<string>",
"scopedId": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The ID of the team to create the access profile for.
The name of the access profile.
A description of the access profile.
The rules that determine which users this profile applies to.
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
Stable, team-scoped identity for the profile (apr_ + 22 base62 chars). Omit to have one minted. Must be unique within the team; reserved sentinel values (built-in profiles) are rejected.
Response
Success
An access profile defines which entitlements are available to which groups of users, and which workflows apply.
Show child attributes
Show child attributes
Was this page helpful?
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>"
]
}
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>"
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"scopedId": "<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>"] }
}
},
"grants": {
"appResourceRoles": [{ "appResourceRoleId": "<string>" }],
"workflows": [{ "workflowId": "<string>" }],
"forms": [{ "formId": "<string>" }],
"skills": { "skills": [{ "skillId": "<string>" }] }
},
"scopedId": "<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>']}}
},
grants: {
appResourceRoles: [{appResourceRoleId: '<string>'}],
workflows: [{workflowId: '<string>'}],
forms: [{formId: '<string>'}],
skills: {skills: [{skillId: '<string>'}]}
},
scopedId: '<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>'
]
]
]
],
'grants' => [
'appResourceRoles' => [
[
'appResourceRoleId' => '<string>'
]
],
'workflows' => [
[
'workflowId' => '<string>'
]
],
'forms' => [
[
'formId' => '<string>'
]
],
'skills' => [
'skills' => [
[
'skillId' => '<string>'
]
]
]
],
'scopedId' => '<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 },\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}")
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 },\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}")
.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 },\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}"
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>"
]
}
}
},
"grants": {
"appResourceRoles": [
{
"appResourceRoleId": "<string>",
"useTeamDefaultAccessProfile": true
}
],
"workflows": [
{
"workflowId": "<string>"
}
],
"forms": [
{
"formId": "<string>"
}
],
"skills": {
"skills": [
{
"skillId": "<string>"
}
]
}
},
"builtinProfileType": "<string>",
"scopedId": "<string>"
}
}
