GraphQLRepositoriesentityScoring
entities.entityScoring
Read entity scoring records with the entityScoring repository, and change them with the entity scoring mutations. Same records as the REST EntityScorings entity.
Queries
Fields of entities { entityScoring { … } }.
| Kind | Field | Returns |
|---|---|---|
| QUERY | getById(entityId: ID!)Returns the record with the given id, or null when there is none. Deleted records are returned as well. | EntityScoringEntity |
| QUERY | getByIds(entityIds: [ID!]!)Returns the records with the given ids; ids without a record are left out. Deleted records are returned as well. | [EntityScoringEntity!]! |
| QUERY | getAll(limit: Int, offset: Int, filter: EntityScoringFilterInput, orderBy: [EntityScoringOrderByInput!], includeDeleted: Boolean)Returns the records that match the filter, paged with limit and offset. | [EntityScoringEntity!]! |
| QUERY | getByCriteria(filter: EntityScoringFilterInput, orderBy: [EntityScoringOrderByInput!], includeDeleted: Boolean, before: String, after: String, first: Int, last: Int)Returns the records that match the filter as a cursor-paginated connection. | EntityScoringEntityConnection |
| QUERY | getChangedFieldsSinceRevision(id: UUID!, revision: Int!)Returns the ids of the fields of a record that changed after the given revision. Returns an empty list for entities without change tracking. | [UUID!]! |
| QUERY | getRecalculationStatus(entityType: BaseEntityTypeEnum!)Returns the progress of the score recalculation for the given record type and when scores were last recalculated. Both values are null when no scoring is enabled for the type. | EntityScoringRecalculationStatus! |
| QUERY | getByEntityType(entityType: BaseEntityTypeEnum!)Returns the scoring definitions for the given record type, in their configured order. | [EntityScoringEntity!]! |
Mutations
| Kind | Mutation | Does | Returns |
|---|---|---|---|
| MUTATION | createEntityScoring(input: CreateEntityScoringInput!, validationLevel: [ValidationLevel!]) | Create one record | CreateEntityScoringPayload |
| MUTATION | updateEntityScoring(input: UpdateEntityScoringInput!, validationLevel: [ValidationLevel!], sessionIdToUpdate: String) | Update fields | UpdateEntityScoringPayload |
| MUTATION | bulkUpdateEntityScoring(input: [CreateOrUpdateEntityScoringInput!]!, deleteInput: [DeleteEntityScoringInput!], validationLevel: [ValidationLevel!], rollbackMethod: RollbackMethod, match: MatchingInput) | Create or update many; per-item results | BulkUpdateEntityScoringPayload |
| MUTATION | deleteEntityScoring(input: DeleteEntityScoringInput!) | Soft-delete | DeleteEntityScoringPayload |
Types
The types this repository uses, each with its fields and their descriptions. Types several repositories share, such as PageInfo and the filter fields, are in the types index.
EntityScoringEntity object 13 fields: isDeleteProtected, id, isDeleted, …
Lead scoring configuration: rules that give leads a score, so that the most promising ones stand out.
| Field | Type | Description |
|---|---|---|
isDeleteProtected | Boolean! | True when the record is protected against deletion because it must always exist in the space. Deleting a record that is not protected can still fail on other checks. Read-only. |
id | ID! | Unique identifier of entity. |
isDeleted | Boolean | Specifies if the entity is considered deleted. |
modified | DateTime | Last modification time. |
created | DateTime | Creation time. |
entityType | BaseEntityTypeEnum! | Entity whose records the scoring configuration scores; currently only Lead is supported. Set on create and cannot be changed. |
isEnabled | Boolean! | When false, the scoring configuration is defined but not evaluated for records. |
name | String! | Name of the entity and its default text representation. |
settings | EntityScoringSettings! | Entity scoring definition in json format. This payload conforms to the EntityScoringSettings JSON Schema: GET /api/v100/rest/schemas/EntityScoringSettings.json on your region's API host |
sortOrder | Int! | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | Boolean | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | Int | Revision when entity was lastly changed. |
instancePermissions | [EntityPermsEnum!]! (1 args) | Permissions the current user has on this record, out of the requested ones. |
EntityScoringEntityConnection object pageInfo: PageInfo!, edges: [EntityScoringEntityEdge]!, totalCount: Int
Paginated list of EntityScoring records.
| Field | Type | Description |
|---|---|---|
pageInfo | PageInfo! | Pagination data for this connection. |
edges | [EntityScoringEntityEdge]! | Contains the nodes in this connection. |
totalCount | Int | Total number of items in the connection. |
EntityScoringEntityEdge object node: EntityScoringEntity, cursor: String!
A Relay edge containing a EntityScoringEntity and its cursor.
| Field | Type | Description |
|---|---|---|
node | EntityScoringEntity | The item at the end of the edge |
cursor | String! | A cursor for use in pagination |
EntityScoringFilterInput input AND, OR, NOT, globalSearchQuery, one condition per field
Filter conditions for EntityScoring records. Conditions on different fields are combined with AND; use OR, AND and NOT for other combinations.
| Input field | Type | Description |
|---|---|---|
OR | [EntityScoringFilterInput!] | Matches records that meet at least one of the listed filters. |
AND | [EntityScoringFilterInput!] | Matches records that meet all of the listed filters. |
NOT | EntityScoringFilterInput | Matches records that do not meet this filter. |
globalSearchQuery | String | Search term matched against the fields that the global search covers for this entity. |
id | EntityFilterStringField | Unique identifier of entity. |
isDeleted | Boolean | Specifies if the entity is considered deleted. |
modified | EntityFilterDateTimeField | Last modification time. |
created | EntityFilterDateTimeField | Creation time. |
entityType | BaseEntityTypeEnumFilterInput | Entity whose records the scoring configuration scores; currently only Lead is supported. Set on create and cannot be changed. |
isEnabled | Boolean | When false, the scoring configuration is defined but not evaluated for records. |
name | EntityFilterStringField | Name of the entity and its default text representation. |
sortOrder | EntityFilterNumberField | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | Boolean | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | EntityFilterNumberField | Revision when entity was lastly changed. |
EntityScoringOrderByInput input Asc or Desc per field
Sorting of EntityScoring records. Set exactly one field in each item; list several items to sort by more fields, in order of priority.
| Input field | Type | Description |
|---|---|---|
id | OrderByEnum | Unique identifier of entity. |
isDeleted | OrderByEnum | Specifies if the entity is considered deleted. |
modified | OrderByEnum | Last modification time. |
created | OrderByEnum | Creation time. |
isEnabled | OrderByEnum | When false, the scoring configuration is defined but not evaluated for records. |
name | OrderByEnum | Name of the entity and its default text representation. |
sortOrder | OrderByEnum | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | OrderByEnum | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | OrderByEnum | Revision when entity was lastly changed. |
CreateEntityScoringInput input 10 fields: clientMutationId, modified, created, …
Field values of a new EntityScoring record.
| Input field | Type | Description |
|---|---|---|
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
modified | DateTime | Last modification time. |
created | DateTime | Creation time. |
entityType | BaseEntityTypeEnum! | Entity whose records the scoring configuration scores; currently only Lead is supported. Set on create and cannot be changed. |
isEnabled | Boolean! | When false, the scoring configuration is defined but not evaluated for records. |
name | String! | Name of the entity and its default text representation. |
settings | EntityScoringSettingsJSONString! | Entity scoring definition in json format. This payload conforms to the EntityScoringSettings JSON Schema: GET /api/v100/rest/schemas/EntityScoringSettings.json on your region's API host |
sortOrder | Int! | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | Boolean | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | Int | Revision when entity was lastly changed. |
CreateOrUpdateEntityScoringInput input 11 fields: clientMutationId, id, modified, …
Field values of an EntityScoring record to create, or to update when its id is set.
| Input field | Type | Description |
|---|---|---|
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
id | ID | Unique identifier of entity. |
modified | DateTime | Last modification time. |
created | DateTime | Creation time. |
entityType | BaseEntityTypeEnum | Entity whose records the scoring configuration scores; currently only Lead is supported. Set on create and cannot be changed. |
isEnabled | Boolean | When false, the scoring configuration is defined but not evaluated for records. |
name | String | Name of the entity and its default text representation. |
settings | EntityScoringSettingsJSONString | Entity scoring definition in json format. This payload conforms to the EntityScoringSettings JSON Schema: GET /api/v100/rest/schemas/EntityScoringSettings.json on your region's API host |
sortOrder | Int | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | Boolean | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | Int | Revision when entity was lastly changed. |
DeleteEntityScoringInput input clientMutationId: String, id: ID!
Id of the EntityScoring record to delete.
| Input field | Type | Description |
|---|---|---|
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
id | ID! | Unique identifier of entity. |
UpdateEntityScoringInput input 10 fields: clientMutationId, id, modified, …
Id of an EntityScoring record and the field values to change.
| Input field | Type | Description |
|---|---|---|
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
id | ID! | Unique identifier of entity. |
modified | DateTime | Last modification time. |
created | DateTime | Creation time. |
isEnabled | Boolean | When false, the scoring configuration is defined but not evaluated for records. |
name | String | Name of the entity and its default text representation. |
settings | EntityScoringSettingsJSONString | Entity scoring definition in json format. This payload conforms to the EntityScoringSettings JSON Schema: GET /api/v100/rest/schemas/EntityScoringSettings.json on your region's API host |
sortOrder | Int | Position of this scoring configuration among others for the same entity type. Configurations are evaluated in this order until one matches. |
useLang | Boolean | When true, the configuration name is treated as a translation key and localized in the UI; otherwise the literal name is shown. |
revision | Int | Revision when entity was lastly changed. |
BulkUpdateEntityScoringPayload object result: BulkUpdateResults!
Result of the bulkUpdateEntityScoring mutation.
| Field | Type | Description |
|---|---|---|
result | BulkUpdateResults! | Ids of the created, updated and deleted records, and the items that failed. |
CreateEntityScoringPayload object entityScoring: EntityScoringEntity, clientMutationId: String
Result of the createEntityScoring mutation.
| Field | Type | Description |
|---|---|---|
entityScoring | EntityScoringEntity | The created record. |
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
DeleteEntityScoringPayload object entityScoring: EntityScoringEntity, clientMutationId: String
Result of the deleteEntityScoring mutation.
| Field | Type | Description |
|---|---|---|
entityScoring | EntityScoringEntity | The deleted record. |
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
UpdateEntityScoringPayload object entityScoring: EntityScoringEntity, clientMutationId: String
Result of the updateEntityScoring mutation.
| Field | Type | Description |
|---|---|---|
entityScoring | EntityScoringEntity | The updated record. |
clientMutationId | String | Optional client-supplied identifier passed on a mutation input and echoed back unchanged on its payload, so a client can correlate the response with its request (Relay convention). |
EntityScoringActivityRule object 11 fields: id, isEnabled, name, …
Scoring rule that awards points for activities of a record with a given status.
| Field | Type | Description |
|---|---|---|
id | UUID! | Unique identifier of the scoring rule. |
isEnabled | Boolean! | When false, the rule is configured but does not contribute to the score. |
name | String! | Display name of the scoring rule. |
useLang | Boolean! | When true, the name is treated as a translation key and localized in the UI; otherwise the literal name text is shown. |
expiration | Int! | How long the points awarded by this rule remain in effect, measured in expirationUnit. Applies only when expirationEnabled is true. |
expirationUnit | EntityScoringRuleExpirationUnitEnum! | Time unit for the expiration value: hour, day, week, or month. |
expirationEnabled | Boolean! | When true, the points awarded by this rule expire after the configured expiration period; when false, they remain indefinitely. |
score | Int! | Points added to (or, when negative, subtracted from) the record score each time the rule matches. |
scoreMultiplier | Boolean! | When true, the score is multiplied by a per-record factor instead of being added as a fixed amount. |
conditions | EntityScoringRuleFilter! | Filter conditions a record must satisfy for the rule to award its score. |
activityStatus | ActivityStatusEnum! | Activity status that triggers the rule, such as a scheduled or completed activity. |
EntityScoringEmailRule object 11 fields: id, isEnabled, name, …
Scoring rule that changes the score of a record when an email event happens for it, such as an email being opened, clicked or replied to.
| Field | Type | Description |
|---|---|---|
id | UUID! | Unique identifier of the scoring rule. |
isEnabled | Boolean! | When false, the rule is configured but does not contribute to the score. |
name | String! | Display name of the scoring rule. |
useLang | Boolean! | When true, the name is treated as a translation key and localized in the UI; otherwise the literal name text is shown. |
expiration | Int! | How long the points awarded by this rule remain in effect, measured in expirationUnit. Applies only when expirationEnabled is true. |
expirationUnit | EntityScoringRuleExpirationUnitEnum! | Time unit for the expiration value: hour, day, week, or month. |
expirationEnabled | Boolean! | When true, the points awarded by this rule expire after the configured expiration period; when false, they remain indefinitely. |
score | Int! | Points added to (or, when negative, subtracted from) the record score each time the rule matches. |
scoreMultiplier | Boolean! | When true, the score is multiplied by a per-record factor instead of being added as a fixed amount. |
conditions | EntityScoringRuleFilter! | Filter conditions a record must satisfy for the rule to award its score. |
emailEventType | EntityScoringRuleEmailEventTypeEnum! | Email event that triggers the rule: sent, opened, clicked, replied, bounced, or unsubscribed. |
EntityScoringFieldRule object 11 fields: id, isEnabled, name, …
Scoring rule that awards points when the field values of a record match its conditions.
| Field | Type | Description |
|---|---|---|
id | UUID! | Unique identifier of the scoring rule. |
isEnabled | Boolean! | When false, the rule is configured but does not contribute to the score. |
name | String! | Display name of the scoring rule. |
useLang | Boolean! | When true, the name is treated as a translation key and localized in the UI; otherwise the literal name text is shown. |
expiration | Int! | How long the points awarded by this rule remain in effect, measured in expirationUnit. Applies only when expirationEnabled is true. |
expirationUnit | EntityScoringRuleExpirationUnitEnum! | Time unit for the expiration value: hour, day, week, or month. |
expirationEnabled | Boolean! | When true, the points awarded by this rule expire after the configured expiration period; when false, they remain indefinitely. |
score | Int! | Points added to (or, when negative, subtracted from) the record score each time the rule matches. |
scoreMultiplier | Boolean! | When true, the score is multiplied by a per-record factor instead of being added as a fixed amount. |
conditions | EntityScoringRuleFilter! | Filter conditions a record must satisfy for the rule to award its score. |
scoreMultiplierFieldId | UUID | Numeric field whose value is used as the multiplier when scoreMultiplier is true. |
EntityScoringRecalculationStatus object lastRecalculation: DateTime, calculationProgress: Int
Progress of the score recalculation of a record type, and when scores were last recalculated.
| Field | Type | Description |
|---|---|---|
lastRecalculation | DateTime | When the scores were last recalculated; null when no scoring is enabled for the record type. |
calculationProgress | Int | Progress of the running recalculation in percent (0-100); null when nothing is queued. |
EntityScoringRule interface 10 fields: id, isEnabled, name, …
Rule of a scoring that adds points to the score of a record, or subtracts them, when the record matches it.
| Field | Type | Description |
|---|---|---|
id | UUID! | Unique identifier of the scoring rule. |
isEnabled | Boolean! | When false, the rule is configured but does not contribute to the score. |
name | String! | Display name of the scoring rule. |
useLang | Boolean! | When true, the name is treated as a translation key and localized in the UI; otherwise the literal name text is shown. |
expiration | Int! | How long the points awarded by this rule remain in effect, measured in expirationUnit. Applies only when expirationEnabled is true. |
expirationUnit | EntityScoringRuleExpirationUnitEnum! | Time unit for the expiration value: hour, day, week, or month. |
expirationEnabled | Boolean! | When true, the points awarded by this rule expire after the configured expiration period; when false, they remain indefinitely. |
score | Int! | Points added to (or, when negative, subtracted from) the record score each time the rule matches. |
scoreMultiplier | Boolean! | When true, the score is multiplied by a per-record factor instead of being added as a fixed amount. |
conditions | EntityScoringRuleFilter! | Filter conditions a record must satisfy for the rule to award its score. |
EntityScoringRuleEmailEventTypeEnum enum Sent, Opened, Clicked, Replied, Bounced, Unsubscribed
Email event that makes a scoring rule add or subtract points.
| Value | Description |
|---|---|
Sent | An email was sent to the record. |
Opened | The recipient opened an email. |
Clicked | The recipient clicked a link in an email. |
Replied | The recipient replied to an email. |
Bounced | An email to the recipient bounced. |
Unsubscribed | The recipient unsubscribed. |
EntityScoringRuleExpirationUnitEnum enum Hour, Day, Week, Month
Time unit after which points awarded by a scoring rule expire.
| Value | Description |
|---|---|
Hour | Points expire after a number of hours. |
Day | Points expire after a number of days. |
Week | Points expire after a number of weeks. |
Month | Points expire after a number of months. |
EntityScoringRuleFilter object operator: FilterGroupOperator!, formula: String, filterMainBox: MainFilterBox!, filterSiblingBoxes: [FilterBox!]!
Conditions a record must meet for a scoring rule to award its score.
| Field | Type | Description |
|---|---|---|
operator | FilterGroupOperator! | How the filter boxes combine — And or Or. |
formula | String | Optional boolean formula combining the filter boxes by their number. |
filterMainBox | MainFilterBox! | Primary group of filter conditions. |
filterSiblingBoxes | [FilterBox!]! | Additional condition groups, combined per operator/formula. |
EntityScoringSettings object categories: [EntityScoringCategory!]!, filter: FieldFilter!, rules: [EntityScoringRule!]
Configuration of a scoring: score categories, the records it scores and the rules that add or subtract points.
| Field | Type | Description |
|---|---|---|
categories | [EntityScoringCategory!]! | Scoring categories that group records by accumulated score range (for example Hot, Warm, Cold). |
filter | FieldFilter! | Filter that limits which records are eligible for scoring; records outside it are not scored. |
rules | [EntityScoringRule!] | Scoring rules whose matching adjusts a record score. |