curl --request POST \
--url https://{organization}.rescueconsole.com/api/people/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field_key": "tshirt_size",
"field_label": "T-shirt size",
"field_type": "select",
"options": [
"S",
"M",
"L",
"XL"
],
"required": false,
"sort_order": 10
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
field_key: 'tshirt_size',
field_label: 'T-shirt size',
field_type: 'select',
options: ['S', 'M', 'L', 'XL'],
required: false,
sort_order: 10
})
};
fetch('https://{organization}.rescueconsole.com/api/people/custom-fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/people/custom-fields"
payload = {
"field_key": "tshirt_size",
"field_label": "T-shirt size",
"field_type": "select",
"options": ["S", "M", "L", "XL"],
"required": False,
"sort_order": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"entity_type": "person",
"field_key": "<string>",
"field_label": "<string>",
"field_type": "text",
"options": [
"<string>"
],
"required": true,
"sort_order": 123,
"builtin": true,
"section": "<string>",
"default_roles": [
"adopter"
],
"note": "<string>"
}{
"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)"
}Add a custom field
Adds a field of your own to every person’s record, as Settings → Data & customization → Custom fields does. The key and the type cannot be changed later. Needs admin on People.
curl --request POST \
--url https://{organization}.rescueconsole.com/api/people/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field_key": "tshirt_size",
"field_label": "T-shirt size",
"field_type": "select",
"options": [
"S",
"M",
"L",
"XL"
],
"required": false,
"sort_order": 10
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
field_key: 'tshirt_size',
field_label: 'T-shirt size',
field_type: 'select',
options: ['S', 'M', 'L', 'XL'],
required: false,
sort_order: 10
})
};
fetch('https://{organization}.rescueconsole.com/api/people/custom-fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{organization}.rescueconsole.com/api/people/custom-fields"
payload = {
"field_key": "tshirt_size",
"field_label": "T-shirt size",
"field_type": "select",
"options": ["S", "M", "L", "XL"],
"required": False,
"sort_order": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"entity_type": "person",
"field_key": "<string>",
"field_label": "<string>",
"field_type": "text",
"options": [
"<string>"
],
"required": true,
"sort_order": 123,
"builtin": true,
"section": "<string>",
"default_roles": [
"adopter"
],
"note": "<string>"
}{
"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. Unique among your person fields.
^[a-z][a-z0-9_]*$What the record shows.
textarea is long text, select is one choice, multiselect several, country_state a country and state.
text, textarea, number, boolean, date, select, multiselect, phone, email, url, country_state The choices. Needed for select and multiselect.
A new person cannot be added without it.
Response
The field.
For a built-in field, builtin_ and its key.
person The last three belong to built-in fields only: an organization picked from the directory, a person on file, and a list of volunteer roles.
text, textarea, number, boolean, date, select, multiselect, phone, email, url, country_state, organization, person, volunteer_roles Present and true on a built-in field.
For a built-in field: the section of the record it sits in, such as Housing.
For a built-in field: the roles it is shown for unless you arrange otherwise.
adopter, donor, volunteer, foster For a built-in field: a hint shown beside it.