curl --request POST \
--url https://api.scoutworks.app/api/v1/access-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"grants": [
{
"onlyFor": []
}
],
"allowedPersonTypes": []
}
'import requests
url = "https://api.scoutworks.app/api/v1/access-policies"
payload = {
"name": "<string>",
"grants": [{ "onlyFor": [] }],
"allowedPersonTypes": []
}
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({name: '<string>', grants: [{onlyFor: []}], allowedPersonTypes: []})
};
fetch('https://api.scoutworks.app/api/v1/access-policies', 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>"
}
]
}
}{
"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"
]
}{
"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"
]
}Make an access policy
A new policy of your group’s own, as Settings → Access policies makes one. A name your group already uses answers 409. A key never changes a group admin’s access, and never gives access to manage people or settings (settings at any level, or team at manage): both answer 403 admin_protected. An admin does those in Scoutworks. The access history records the change as made by the admin who created the key, via the key. Writes count towards the key’s usual limit and its write limit. A group whose subscription has lapsed answers 402.
You may send an Idempotency-Key header (unique per access policy) so a retry after a timeout cannot make it twice. For 24 hours, the same key with the same body answers 200 with the first access policy and an Idempotent-Replayed: true header; with a different body it answers 400; while the first request is still running it answers 409 conflict.
curl --request POST \
--url https://api.scoutworks.app/api/v1/access-policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"grants": [
{
"onlyFor": []
}
],
"allowedPersonTypes": []
}
'import requests
url = "https://api.scoutworks.app/api/v1/access-policies"
payload = {
"name": "<string>",
"grants": [{ "onlyFor": [] }],
"allowedPersonTypes": []
}
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({name: '<string>', grants: [{onlyFor: []}], allowedPersonTypes: []})
};
fetch('https://api.scoutworks.app/api/v1/access-policies', 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>"
}
]
}
}{
"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"
]
}{
"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"
]
}Authorizations
Headers
Body
A field not listed here is refused with a 400.