curl --request PUT \
--url https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft \
--header 'Content-Type: application/json' \
--data '
{
"allowedGroupTypes": [],
"groupConfigs": [
{
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": {
"calculation": {
"type": "CONSTANT",
"value": 123
}
},
"enabled": true,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"maxValue": 123,
"minValue": 123
}
],
"name": "<string>",
"objectTypeId": "<string>",
"maxScorePerCategory": 123
}
'import requests
url = "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft"
payload = {
"allowedGroupTypes": [],
"groupConfigs": [
{
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": { "calculation": {
"type": "CONSTANT",
"value": 123
} },
"enabled": True,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"maxValue": 123,
"minValue": 123
}
],
"name": "<string>",
"objectTypeId": "<string>",
"maxScorePerCategory": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
allowedGroupTypes: [],
groupConfigs: [
{
groupName: '<string>',
id: '<string>',
ruleConfigurations: [
{
configuration: {calculation: {type: 'CONSTANT', value: 123}},
enabled: true,
id: '<string>',
maxValue: 123,
minValue: 123
}
],
maxValue: 123,
minValue: 123
}
],
name: '<string>',
objectTypeId: '<string>',
maxScorePerCategory: 123
})
};
fetch('https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowedGroupTypes' => [
],
'groupConfigs' => [
[
'groupName' => '<string>',
'id' => '<string>',
'ruleConfigurations' => [
[
'configuration' => [
'calculation' => [
'type' => 'CONSTANT',
'value' => 123
]
],
'enabled' => true,
'id' => '<string>',
'maxValue' => 123,
'minValue' => 123
]
],
'maxValue' => 123,
'minValue' => 123
]
],
'name' => '<string>',
'objectTypeId' => '<string>',
'maxScorePerCategory' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft"
payload := strings.NewReader("{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft")
.header("Content-Type", "application/json")
.body("{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}"
response = http.request(request)
puts response.read_body{
"allowedGroupTypes": [
"FIT"
],
"groupConfigs": [
{
"groupCategory": "FIT",
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": {
"calculation": {
"type": "CONSTANT",
"value": 123
}
},
"enabled": true,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"groupDecay": {
"decayIntervalDays": 123,
"percentToDecayPerInterval": 123
},
"maxValue": 123,
"minValue": 123
}
],
"id": "<string>",
"name": "<string>",
"objectTypeId": "<string>",
"scoreStatus": "<string>",
"scoreType": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"filterConfiguration": {
"listFilterType": "EXCLUDES",
"segmentIds": [
123
]
},
"lastConfigurationChangeTimestamp": "2023-11-07T05:31:56Z",
"maxScore": 123,
"maxScorePerCategory": 123,
"outputConfiguration": {
"outputs": [
{
"categories": [
"FIT"
],
"id": "<string>",
"outputType": "SCORE",
"propertyLabel": "<string>",
"propertyName": "<string>",
"propertyDescription": "<string>",
"propertyGroup": "<string>"
}
]
},
"publishedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Update draft
Update the draft configuration for a specific lead score in your HubSpot account. This endpoint allows you to replace the current draft of a lead score configuration identified by the scoreId. Use this endpoint to make changes to the scoring criteria before publishing the final version. Rule and group IDs may differ between the live and draft configurations. Outputs are merged by ID and will remain the same.
curl --request PUT \
--url https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft \
--header 'Content-Type: application/json' \
--data '
{
"allowedGroupTypes": [],
"groupConfigs": [
{
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": {
"calculation": {
"type": "CONSTANT",
"value": 123
}
},
"enabled": true,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"maxValue": 123,
"minValue": 123
}
],
"name": "<string>",
"objectTypeId": "<string>",
"maxScorePerCategory": 123
}
'import requests
url = "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft"
payload = {
"allowedGroupTypes": [],
"groupConfigs": [
{
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": { "calculation": {
"type": "CONSTANT",
"value": 123
} },
"enabled": True,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"maxValue": 123,
"minValue": 123
}
],
"name": "<string>",
"objectTypeId": "<string>",
"maxScorePerCategory": 123
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
allowedGroupTypes: [],
groupConfigs: [
{
groupName: '<string>',
id: '<string>',
ruleConfigurations: [
{
configuration: {calculation: {type: 'CONSTANT', value: 123}},
enabled: true,
id: '<string>',
maxValue: 123,
minValue: 123
}
],
maxValue: 123,
minValue: 123
}
],
name: '<string>',
objectTypeId: '<string>',
maxScorePerCategory: 123
})
};
fetch('https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowedGroupTypes' => [
],
'groupConfigs' => [
[
'groupName' => '<string>',
'id' => '<string>',
'ruleConfigurations' => [
[
'configuration' => [
'calculation' => [
'type' => 'CONSTANT',
'value' => 123
]
],
'enabled' => true,
'id' => '<string>',
'maxValue' => 123,
'minValue' => 123
]
],
'maxValue' => 123,
'minValue' => 123
]
],
'name' => '<string>',
'objectTypeId' => '<string>',
'maxScorePerCategory' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft"
payload := strings.NewReader("{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft")
.header("Content-Type", "application/json")
.body("{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/marketing/lead-scoring/2027-03-beta/scores/{scoreId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowedGroupTypes\": [],\n \"groupConfigs\": [\n {\n \"groupName\": \"<string>\",\n \"id\": \"<string>\",\n \"ruleConfigurations\": [\n {\n \"configuration\": {\n \"calculation\": {\n \"type\": \"CONSTANT\",\n \"value\": 123\n }\n },\n \"enabled\": true,\n \"id\": \"<string>\",\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"maxValue\": 123,\n \"minValue\": 123\n }\n ],\n \"name\": \"<string>\",\n \"objectTypeId\": \"<string>\",\n \"maxScorePerCategory\": 123\n}"
response = http.request(request)
puts response.read_body{
"allowedGroupTypes": [
"FIT"
],
"groupConfigs": [
{
"groupCategory": "FIT",
"groupName": "<string>",
"id": "<string>",
"ruleConfigurations": [
{
"configuration": {
"calculation": {
"type": "CONSTANT",
"value": 123
}
},
"enabled": true,
"id": "<string>",
"maxValue": 123,
"minValue": 123
}
],
"groupDecay": {
"decayIntervalDays": 123,
"percentToDecayPerInterval": 123
},
"maxValue": 123,
"minValue": 123
}
],
"id": "<string>",
"name": "<string>",
"objectTypeId": "<string>",
"scoreStatus": "<string>",
"scoreType": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"filterConfiguration": {
"listFilterType": "EXCLUDES",
"segmentIds": [
123
]
},
"lastConfigurationChangeTimestamp": "2023-11-07T05:31:56Z",
"maxScore": 123,
"maxScorePerCategory": 123,
"outputConfiguration": {
"outputs": [
{
"categories": [
"FIT"
],
"id": "<string>",
"outputType": "SCORE",
"propertyLabel": "<string>",
"propertyName": "<string>",
"propertyDescription": "<string>",
"propertyGroup": "<string>"
}
]
},
"publishedAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Invalid input (details will vary based on the error)",
"correlationId": "aeb5f871-7f07-4993-9211-075dc63e7cbf",
"category": "VALIDATION_ERROR",
"links": {
"knowledge-base": "https://www.hubspot.com/products/service/knowledge-base"
}
}Supported products
Supported products
Required Scopes
Required Scopes
Path Parameters
The unique identifier of the lead score draft to update.
Body
An array of strings indicating the types of groups allowed in the scoring draft. Valid values include 'FIT' and 'INTENT'.
FIT, INTENT An array of PublicScoreGroupConfiguration objects that define the group configurations for the scoring draft.
Show child attributes
Show child attributes
A string representing the name of the draft configuration.
A string representing the unique identifier of the object type associated with the draft.
Show child attributes
Show child attributes
An integer representing the maximum score allowed per category in the scoring draft.
Show child attributes
Show child attributes
Response
successful operation
An array of allowed group types for the scoring configuration, with valid values being 'FIT' and 'INTENT'.
FIT, INTENT An array of configurations for scoring groups, each defined by a PublicScoreGroupConfiguration object.
Show child attributes
Show child attributes
The unique identifier for this scoring configuration.
The name of the scoring configuration.
The identifier for the type of object that this score configuration is associated with.
The current status of the score, represented as a string.
The type of scoring applied, represented as a string.
The date and time when this scoring configuration was created, in ISO 8601 format.
Show child attributes
Show child attributes
The maximum score that can be assigned overall, represented as an integer.
The maximum score that can be assigned per category, represented as an integer.
Show child attributes
Show child attributes
The date and time when this scoring configuration was published, in ISO 8601 format.
The date and time when this scoring configuration was last updated, in ISO 8601 format.
Was this page helpful?