Schemas
The schemas used by sheepCRM describe the fields and values supported by each resource type. Each type of data in Sheep has a resource_type (e.g. person, member, payment). Each resource type has a schema which describes the fields and values that are supported.
Key terms:
| Term | Description |
|---|---|
enum | The values for this field must match an item from the list. |
loose_enum | The items in the list are suggested values; other values can be submitted. |
Get the Schema for a Resource Type
Section titled “Get the Schema for a Resource Type”GET https://api.sheepcrm.com/api/v1/{flock}/{resource_type}/schema/Authorization: Bearer $API_KEYSchema Overloading
Section titled “Schema Overloading”The self-service settings have a section for editing the JSON settings. The schema field can be used to overload the core schema data. Note only enum/loose_enum updates are currently supported. You cannot create a new field or change an existing field name.
{ "schema": { "organisation": { "fields": { "primary_service_offered": { "loose_enum": [ "Dog Grooming", "Cat Grooming", "Dog Walking", "Cat Walking", "Cattery", "Other" ] }, "services_offered": { "loose_enum": [ "Dog Grooming", "Cat Grooming", "Dog Walking", "Cat Walking", "Cattery" ] }, "industry": { "loose_enum": [ "Pets", "Not pets" ] }, "source": { "loose_enum": [ "Facebook", "Instagram" ] } } }, "booking": { "layout_requirements": { "loose_enum": [ "Layout for dogs", "Layout for cats" ] } } }}The example above shows a configuration for a pet company. They are interested in tracking a primary service (a single field) and also a list field to capture all other services offered. They only need to capture whether the contact is within the pet industry or not. The booking section is included to show how multiple schemas can be configured.
Data Schemas Reference
Section titled “Data Schemas Reference”The following sections document the fields available on each resource type in sheepCRM. Each table shows the field name, data type, whether it is a collection (e.g. list), allowed values, applicable security policies, and any additional notes.
For each resource type, use the schema endpoint above to retrieve the current live schema for your flock.
achievement
Section titled “achievement”| Field | Type | Collection | Values | Policies | Notes |
|---|---|---|---|---|---|
achievement_type_ref | reference | achievement_type | detail, summary | ||
contact_ref | reference | person, organisation | detail, summary | ||
steps | dict | detail | |||
start_datetime | date | detail, summary | |||
completed_datetime | date | detail, summary | |||
expired | boolean | detail, summary | |||
finished | boolean | detail, summary | |||
coach_ref | reference | person | detail, summary |
achievement_type
Section titled “achievement_type”| Field | Type | Collection | Values | Policies | Notes |
|---|---|---|---|---|---|
name | string | ||||
category | string | ||||
sort_order | number | ||||
active | boolean | ||||
description | string | ||||
steps | string | list | |||
image | s3image | ||||
icon | string | ||||
icon_colour | string | ||||
experience_required | string | ||||
objective | string | ||||
link | string |
action
Section titled “action”| Field | Type | Collection | Values | Policies | Notes |
|---|---|---|---|---|---|
legacy_uid | string | ||||
bulk_action | boolean | ||||
name | string | ||||
trigger | string | ||||
action | string | add_tag, change-status, debug, draft-templated-email, join-group, raise-authorised-xero-invoice, raise-draft-xero-invoice, raise-submitted-xero-invoice, remove_tag, send-email-to-fixed-address, send-json-webhook, send-templated-email, send-templated-email-request-acknowledgement, send-templated-in-app-message, send-templated-in-app-message-request-acknowledgement, send-templated-sms, send-webhook, set-single-field, set-single-field-on-last-membership | |||
template | string | ||||
url | string | ||||
tag | string | ||||
active | boolean | ||||
comment | string | ||||
conditional_template | dict | ||||
field | string | ||||
value | string | ||||
scope | string |