Data model
Kennra has one Kind for companies, one for people and one for deals. You don't make a second company Kind for partners or a second deal Kind for training. You give records types, and you let traits apply to some types only. Links between records are time-bound, so Kennra keeps their history.
This page builds on Concepts. To change the structure from files or an agent, see CLI.
Types on companies, people and deals
Each of the three Kinds has a set of types. A record can have several, because they describe the relationship: a company can be a customer and a partner at once. Each type keeps its own source and history.
| Kind | Field | Built-in options | Read | Change |
|---|---|---|---|---|
| Company | kennra.firmographics.organizationType | customer, prospect, partner, supplier, reseller, public_sector | Organization.organizationTypes | addOrganizationType, removeOrganizationType |
| Person | kennra.profile.personType | contact, end_user, partner, consultant, supplier | Person.personTypes | addPersonType, removePersonType |
| Deal | kennra.deal_profile.dealType | subscription, training, consulting, certification, conference_ticket, license, support | Deal.dealTypes | addDealType, removeDealType, or dealTypes on openDeal and updateDeal |
Person types are separate from the roles a person has at a company or on a deal, such as decision maker or champion. Organization types are separate from the lifecycle stage.
updateDeal takes the whole set in dealTypes. In the CLI, use kennra deals open --deal-type subscription,training and kennra deals update --add-deal-type training --remove-deal-type support. In MCP, open_deal takes dealTypes, update_deal takes addDealTypes and removeDealTypes, and update_person takes addPersonTypes and removePersonTypes.
The sales motion
A deal also has one salesMotion: how it came about. The values are new_business, expansion, renewal and framework_agreement. Deal types say what the deal sells, and the sales motion says how it was won.
The field was called dealType before 26 November 2026. The old name is refused, and the error names the new one. That covers Deal.type, OpenDealInput.dealType and the CLI's --type. Use salesMotion and --sales-motion.
A renewal deal that Kennra proposes copies the deal types of the deal it renews, as long as the workspace still offers them.
Your own type options
Each workspace sets its own list of options for the three fields. You can add options, rename any option (built-in ones too), reorder them and retire the ones you don't offer.
- Read the list with
organizationTypes,personTypesanddealTypes. Each option hasvalue,label,builtin,renamedandretired, in the workspace's order. - Add one option with
extendTraitOptions. - Set the whole list with
configureTraitOptions: the trait, the field, and every option in order, each with an optionallabelandretired. It needskennra:schema:write. Agents can never call it. - Options are never removed. Every current option must be in the list, or Kennra refuses it with
OPTION_MISSING. Retire an option instead. - A retired option stays on the records that have it, with its history. Kennra no longer offers it in pickers, and a new write with it is refused with
ENUM_VALUE_DEPRECATED.
mutation ConfigureTraitOptions($name: String!, $field: String!, $options: [ConfiguredTraitOptionInput!]!, $idempotencyKey: String!) {
configureTraitOptions(name: $name, field: $field, options: $options, idempotencyKey: $idempotencyKey) {
__typename
... on TraitOptionsConfigured { name field consistencyToken }
... on DomainError { code message }
}
}curl -s https://api.kennra.com/graphql \
-H "authorization: Bearer $KENNRA_TOKEN" \
-H 'kennra-workspace: fjellsport-demo' \
-H 'kennra-purpose: organization.management' \
-H 'content-type: application/json' \
-d '{
"operationName": "ConfigureTraitOptions",
"variables": {
"name": "kennra.deal_profile",
"field": "dealType",
"idempotencyKey": "deal-types-2026-11",
"options": [
{ "value": "subscription" },
{ "value": "training", "label": "Courses" },
{ "value": "consulting" },
{ "value": "certification", "retired": true },
{ "value": "conference_ticket" },
{ "value": "license" },
{ "value": "support" },
{ "value": "hardware", "label": "Hardware" }
]
}
}'In the admin, a schema owner manages the options under Settings → Kinds, in the settings of the type field. Kennra shows built-in labels in the interface language until you rename them. Your own labels stay as you wrote them.
Traits for some records only
A trait applies to every record of its Kind, unless its scope says otherwise. One rule per trait:
| Rule | The trait applies to |
|---|---|
organizationType | Companies with one of these organization types |
personType | People with one of these person types |
dealType | Deals with one of these deal types |
lifecycleStage | Companies in one of these lifecycle stages |
fieldValue | Records where a field of a trait has one of these values |
segment | The current members of a segment |
pipeline | Deals in one of these pipelines |
program | Enrollments in one of these programs |
{ "rule": "dealType", "values": ["training", "certification"] }Kennra checks the rule when a value is written. A write to a record outside the scope is refused with OUT_OF_SCOPE. Removing a value is always allowed. A combination of rules goes through a segment.
A trait limited to a segment applies to the segment's members now. The segment must be about the trait's Kind. An archived segment has no members, so writes to the trait are refused until someone changes the scope.
Cards follow the scope. When a record leaves the scope, for example a deal that is no longer a training deal, its stored values stay and show folded. TraitValues.inScope says whether a record is in scope.
Custom Kinds
When a thing of its own belongs to a customer, such as a machine, a site or a licence, define a custom Kind. It has traits for its fields, relations to companies, people, deals or other custom Kinds, and links with a time span. The guardrails are in Concepts: no personal data on the record, at least one relation, and at most 10 custom Kinds per workspace.
Links between records
Reference fields are links with time
A trait field of type reference points at another record: a company, a person, a deal or a record of a custom Kind (target). Its cardinality is one or many. Each value is a link with validFrom and validTo, so Kennra keeps who the partner on a deal was last year.
- A link can start in the past (
validFromonFieldValueInput), never in the future (IN_FUTURE). - With cardinality
one, a new target ends the current link where the new one starts (REPLACED). It can't start before the current one (ENDS_BEFORE_START). Setting the same target again keeps the link. retract: truewithvalidToends a link without a new one (UNLINKED).
mutation SetTraitValues($input: SetTraitValuesInput!, $idempotencyKey: String!) {
setTraitValues(input: $input, idempotencyKey: $idempotencyKey) {
__typename
... on TraitValuesSet { entityId consistencyToken }
... on DomainError { code message }
}
}{
"input": {
"entityId": "<deal id>",
"trait": "custom.deal_partner",
"values": [{ "field": "partner", "value": { "reference": "<company id>" }, "validFrom": "2026-09-01T00:00:00Z" }]
},
"idempotencyKey": "deal-partner-1"
}Read the links with referenceLinks(entityId, trait, field, includeEnded, asOf). asOf gives the links that held then, and includeEnded adds the earlier ones with validTo and endCause (UNLINKED, REPLACED or TARGET_ERASED). Links to records you may not see are left out.
Target rules
A reference field and a custom Kind relation can limit what they link to with targetScope. It uses the scope rules above: organizationType, personType, dealType, lifecycleStage, fieldValue, segment and, for deals, pipeline. A partner field can link only to companies of type partner:
{ "rule": "organizationType", "values": ["partner"] }Kennra checks the rule when a link is made or changed, and refuses a target outside it with TARGET_OUT_OF_SCOPE. A link that already exists stays when its target later falls outside the rule. RecordLink.targetInScope and targetRule mark it, and the admin shows it as outside the rule. linkTargets returns only the targets the rule allows, for pickers.
Links on the target
The record a link points at shows the links from other records. Give the field an inverseLabel, for example "Deals as partner", and the partner company lists those deals, current and earlier with from and to dates. Without an inverse label, clients make one from the source Kind and the field label.
Read them with incomingReferenceLinks(entityId, includeEnded): one group per field, with label, inverseLabel, the number of current links and the links themselves.
In MCP, get_organization_overview, get_person_context and get_record return reference_links (out) and linked_from (in). Ended links are counted, and includeHistory lists them. asOf gives the links that held on a date. get_links does the same for any company, person, deal or record. Custom Kind links take validFrom and validTo too, with link_records and unlink_record.
Segments over types and links
Segments can ask about types and links as well as fields.
- Types. The core fields
organizationTypesandpersonTypes, and thedealcondition'sdealTypes: "companies with an open training deal". - Reference links. A
referenceLinkcondition follows a reference field in either direction.outis the record's own field.inis a field on another Kind that points here.wheresets conditions on the record at the other end,wheniscurrent(default) orever, andcountcompares the number of distinct records there. - Custom Kinds. A segment can be about a custom Kind, such as machines older than five years. People and companies take
hasRecord: "companies that own a machine older than five years". A custom Kind segment is never synced to an app.
"Companies that are partner on an open deal":
{
"type": "referenceLink",
"direction": "in",
"trait": "custom.deal_partner",
"field": "partner",
"kind": "deal",
"when": "current",
"where": { "type": "deal", "status": "open" }
}"Companies that have been partner on at least three deals" adds "when": "ever" and "count": { "op": "gte", "value": 3 }. Count who a definition matches before you save it with the SegmentPreview operation. A trait scope or target rule that is limited to a segment can't read that same trait or field. Kennra refuses the loop with SCOPE_CYCLE.
Fields that point at another system
A trait field of type external points at an object in an installed app, such as a Crystallize product variant, instead of a Kennra record. Its value is a link with time, like a reference field. See External fields.