Skip to main content

Relations (Base Entity)

EntityRelation

In TribeCRM, every person and organization is stored as a Relation — the shared parent entity for Persons and Organisations. Think of it as the "address book" base type that holds common fields like phone numbers, bank details, and social media links.

The Relation endpoint provides a unified view across all subtypes. Querying it returns persons, organizations, and any other relation subtype in a single list. Use the subtype-specific endpoints (Relation_Person, Relation_Organization) when you need to work with a single type.

Not to be confused with "Relationships"

Relation = a person or organization record (the entity itself). Relationship = a link between two relations (e.g., "Jan works at Acme Corp"). Relationships are a separate entity accessible via the Relationships navigation property.

Base Entity

Relation is a base entity and cannot be created directly. You must create a concrete subtype. See Subtypes for the full list.

Endpoints

List Relations

Retrieve a paginated list of all relations (persons and organizations combined).

GET/v1/odata/Relation

Single Relation

Retrieve a single relation by its ID.

GET/v1/odata/Relation({id})

With expanded relations:

GET/v1/odata/Relation({id})?$expand=Language,Addresses

Create Relation

The Relation endpoint does not support direct creation. Use the subtype-specific endpoints instead:

Update Relation

Update an existing relation. Provide only the fields to update.

PUT/v1/odata/Relation({id})

Delete Relation

Delete a relation by ID.

DELETE/v1/odata/Relation({id})

Subtypes

Relation is the abstract parent type. All records in TribeCRM are one of these concrete subtypes:

SubtypeOData Entity SetDescription
OrganisationsRelation_OrganizationCompanies and organizations
PersonsRelation_PersonIndividual people

Subtypes inherit all Relation fields and add their own specific fields (e.g., firstName/lastName for persons, name/vatNumber for organizations).

Fields

Standard Fields (all entities)

These fields are present on every entity, including relations.

FieldTypeDescription
IDGuidPrimary key (UUID)
_TypeStringEntity type discriminator (e.g., Relation.Person, Relation.Organization)
_NameStringComputed display name
SortIndexDoubleSorting order
CreationDateDateTimeOffsetDate the record was created
LastMutationDateDateTimeOffsetDate of the last modification
IsActiveBooleanWhether the record is active
IsClosedBooleanWhether the record is closed

Relation Fields

These fields are specific to the Relation type and inherited by all subtypes (Person, Organization).

FieldTypeDescription
NumberDoubleRelation number (unique identifier code)
DebtorNumberStringDebtor number
CreditorNumberStringCreditor number
IBANStringIBAN bank account number
BICStringBIC/SWIFT code
BankNameStringBank name
FacebookStringFacebook URL
TwitterStringTwitter/X URL
LinkedInStringLinkedIn URL
InstagramStringInstagram URL
YouTubeStringYouTube URL
BlogStringBlog URL

Relationships

RelationshipTarget EntityCardinalityDescription
LanguageDatastore.LanguageN:1Preferred language
RelationshipsRelationship1:NLinked relations (contacts ↔ organizations)
AddressesAddress1:NAll addresses
EmailAddressesEmailAddress1:NEmail addresses
PhoneNumbersPhoneNumber1:NPhone numbers
PictureFile1:1Profile picture
LabelsLabel1:NLabels / tags
NotesNote1:NNotes
AttachmentsAttachment1:NFile attachments
EventsEvent1:NEvents (activities)
CreatorRelation.Person.ContactN:1User who created the record
TeamTeamN:1Assigned team

Expanding Relationships

GET/v1/odata/Relation({id})?$expand=Language
GET/v1/odata/Relation({id})?$expand=Addresses,Language,Labels

You can navigate directly to related entities:

GET/v1/odata/Relation({id})/Addresses
GET/v1/odata/Relation({id})/Notes
DELETE/v1/odata/Relation({id})/Language/$ref

Filtering Examples

:::warning Filtering by _Type is not supported To narrow by relation subtype, query that subtype's own entity set instead (/v1/odata/Relation_Person, /v1/odata/Relation_Organization). See Filtering by Type. :::

GET/v1/odata/Relation?$filter=contains(_Name, '{_Name}')&$top={top}
GET/v1/odata/Relation?$filter=Number eq {Number}&$top={top}
GET/v1/odata/Relation?$filter=DebtorNumber ne null&$top={top}
GET/v1/odata/Relation?$filter=IBAN ne null&$top={top}
GET/v1/odata/Relation?$filter=contains(LinkedIn, '{LinkedIn}')&$top={top}
GET/v1/odata/Relation?$filter=CreationDate gt {CreationDate}&$top={top}