curl --request POST \
--url https://api.scoutworks.app/api/v1/access-policies/{policyId}/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.scoutworks.app/api/v1/access-policies/{policyId}/copy"
payload = { "name": "<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({name: '<string>'})
};
fetch('https://api.scoutworks.app/api/v1/access-policies/{policyId}/copy', 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"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}Copy an access policy
Makes a policy of your group’s own from a built-in or from one of your policies, to change it. A copy of a built-in leaves out what none of its person types may hold. A policy that gives access to manage people or settings (Admin) answers 403 admin_protected. 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/{policyId}/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'import requests
url = "https://api.scoutworks.app/api/v1/access-policies/{policyId}/copy"
payload = { "name": "<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({name: '<string>'})
};
fetch('https://api.scoutworks.app/api/v1/access-policies/{policyId}/copy', 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"
]
}{
"error": {
"code": "invalid_api_key",
"message": "<string>"
},
"errorRef": "<string>",
"retryAfter": 0,
"matchingIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}