curl --request POST \
--url https://{organization}.rescueconsole.com/api/shifts/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Dog walker",
"description": "Walks the dogs in the kennel block, two at a time at most.",
"requires_qualification": true,
"location_scoped": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Dog walker',
description: 'Walks the dogs in the kennel block, two at a time at most.',
requires_qualification: true,
location_scoped: true
})
};
fetch('https://{organization}.rescueconsole.com/api/shifts/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/shifts/roles"
payload = {
"label": "Dog walker",
"description": "Walks the dogs in the kennel block, two at a time at most.",
"requires_qualification": True,
"location_scoped": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"label": "<string>",
"requires_qualification": true,
"location_scoped": true,
"is_enabled": true,
"sort_order": 123,
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Create a volunteer role
Adds a role. Only label is required. A role is location-scoped unless you send location_scoped: false. Needs write on Shifts.
A coordinator’s: needs write on Shifts AND read on People. A key without read on People is refused (403) with “Only a coordinator can do this: it needs permission to see People.”
curl --request POST \
--url https://{organization}.rescueconsole.com/api/shifts/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Dog walker",
"description": "Walks the dogs in the kennel block, two at a time at most.",
"requires_qualification": true,
"location_scoped": true
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: 'Dog walker',
description: 'Walks the dogs in the kennel block, two at a time at most.',
requires_qualification: true,
location_scoped: true
})
};
fetch('https://{organization}.rescueconsole.com/api/shifts/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/shifts/roles"
payload = {
"label": "Dog walker",
"description": "Walks the dogs in the kennel block, two at a time at most.",
"requires_qualification": True,
"location_scoped": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"label": "<string>",
"requires_qualification": true,
"location_scoped": true,
"is_enabled": true,
"sort_order": 123,
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}{
"error": "house_trained must be 1, 0 or null (not assessed)"
}Authorizations
An API key from Settings, API keys. It starts with rc_live_.
Body
Lower-case letters, digits and underscores, starting with a letter. Made from the label when you leave it out. It cannot be changed later.
^[a-z][a-z0-9_]*$Whether a person needs an approval for this role before they can sign up for it.
Whether an approval for this role is given per location. It cannot be changed later.
Response
The role.
A short name that never changes.
The name people see.
Whether a person needs an approval for this role before they can sign up for it.
Whether an approval for this role is given per location.
false for a retired role: it cannot be put on new shifts or signed up for.