Get an access policy
curl --request GET \
--url https://api.scoutworks.app/api/v1/access-policies/{policyId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scoutworks.app/api/v1/access-policies/{policyId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scoutworks.app/api/v1/access-policies/{policyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"kind": "builtin",
"builtinKind": "person",
"name": "<string>",
"description": "<string>",
"basedOn": "<string>",
"builtinUpdated": true,
"grants": [
{
"area": "members",
"level": "view",
"scope": "group",
"note": "records",
"onlyFor": [
"group_admin"
]
}
],
"allowedPersonTypes": [
"<string>"
],
"version": 0,
"archivedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"holderCount": 0,
"holders": [
{
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"personType": "<string>"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Access policies
Get an access policy
One policy, with who holds it (parents are counted, not listed). A policy’s id is a built-in’s key (role.leader, addon.treasurer) or a custom policy’s UUID. Another group’s policy and an unknown id both answer 404.
GET
/
access-policies
/
{policyId}
Get an access policy
curl --request GET \
--url https://api.scoutworks.app/api/v1/access-policies/{policyId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.scoutworks.app/api/v1/access-policies/{policyId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.scoutworks.app/api/v1/access-policies/{policyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "<string>",
"kind": "builtin",
"builtinKind": "person",
"name": "<string>",
"description": "<string>",
"basedOn": "<string>",
"builtinUpdated": true,
"grants": [
{
"area": "members",
"level": "view",
"scope": "group",
"note": "records",
"onlyFor": [
"group_admin"
]
}
],
"allowedPersonTypes": [
"<string>"
],
"version": 0,
"archivedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"holderCount": 0,
"holders": [
{
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"personType": "<string>"
}
]
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}