Skip to content

Save lead scoring rules

PUT
/api/v1/scoring-rules
curl --request PUT \
--url https://digize.com/api/v1/scoring-rules \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "rules": [ { "id": "example", "name": "example", "kind": "field", "config": { "key": "example", "value": "example", "tag": "example", "path": "example", "days": 1 }, "points": 1, "maxPoints": 1, "enabled": true } ] }'

Saves every lead scoring rule in order. Rules without an id are added; ones left out are deleted with the points they gave. Every contact is rescored.

Needs the crm:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
rules
required
Array<object>
<= 50 items
object
id
string
>= 1 characters <= 64 characters
name
required
string
>= 1 characters <= 80 characters
kind
required
string
Allowed values: field tag opened clicked booked paid page_visited inactive
config
required
object
key
string
<= 40 characters
value
string
<= 200 characters
tag
string
<= 40 characters
path
string
<= 200 characters
days
integer
>= 1 <= 730
points
required
integer
>= -1000 <= 1000
maxPoints
Any of:
integer
>= 1 <= 100000
enabled
boolean

Done

Media typeapplication/json
Array<object>
object
id
required
string
name
required
string
kind
required

Field and tag give points while they hold; inactive once nothing has happened for days; opened, clicked, booked, paid and page_visited give points each time.

string
Allowed values: field tag opened clicked booked paid page_visited inactive
config
required
object
key

Field: the contact field’s key.

string
value

Field: the value it equals.

string
tag

Tag: the tag.

string
path

Page_visited: the path the page starts with, such as /pricing.

string
days

Inactive: days without activity.

number
points
required

Points it adds, or takes when negative.

number
maxPoints
required

For a rule that counts each time: the most it gives one contact.

number | null
enabled
required
boolean

Example

[
{
"kind": "field"
}
]

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}