Skip to content

Commit d4196a7

Browse files
marko-kriskovicmatijapetanjek
authored andcommitted
1278 - added createList
1 parent 7d78cd8 commit d4196a7

6 files changed

Lines changed: 3330 additions & 676 deletions

File tree

server/libs/modules/components/hubspot/openapi.yaml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,68 @@ paths:
249249
hubspot_owner_id:
250250
type: "string"
251251
description: "ID for the HubSpot user responsible for managing the deal."
252+
/crm/lists/2026-03:
253+
post:
254+
summary: "Create List"
255+
description: "Create a new list."
256+
operationId: "createList"
257+
x-ai-agent-tool: true
258+
security:
259+
- "oauth2":
260+
- "crm.lists.write"
261+
requestBody:
262+
content:
263+
application/json:
264+
schema:
265+
title: "List"
266+
type: "object"
267+
required:
268+
- "name"
269+
- "objectTypeId"
270+
- "processingType"
271+
properties:
272+
name:
273+
type: "string"
274+
title: "Name"
275+
description: "The name of the list, which must be globally unique across all public lists in the portal."
276+
objectTypeId:
277+
type: "string"
278+
title: "Object Type ID"
279+
description: "The object type ID of the type of objects that the list will store. (e.g., 0-1 for contacts)."
280+
default: "0-1"
281+
processingType:
282+
type: "string"
283+
title: "Processing Type"
284+
description: "The processing type of the list."
285+
enum:
286+
- "MANUAL"
287+
- "DYNAMIC"
288+
- "SNAPSHOT"
289+
listFolderId:
290+
type: "integer"
291+
title: "List Folder ID"
292+
description: "The ID of the folder that the list should be created in. If left blank, then the list will be created in the root of the list folder structure."
293+
membershipSettings:
294+
type: "object"
295+
title: "Membership Settings"
296+
description: "Settings controlling list membership."
297+
properties:
298+
includeUnassigned:
299+
type: "boolean"
300+
description: "Whether to include unassigned records."
301+
membershipTeamId:
302+
type: "integer"
303+
description: "The team ID for membership filtering."
304+
responses:
305+
201:
306+
description: "successful operation"
307+
content:
308+
application/json:
309+
schema:
310+
type: "object"
311+
properties:
312+
list:
313+
$ref: "#/components/schemas/List"
252314
/crm/v3/objects/tickets/{ticketId}:
253315
get:
254316
summary: "Get Ticket"
@@ -301,6 +363,79 @@ paths:
301363
description: "The subject or title of the ticket, summarizing the issue or request."
302364
components:
303365
schemas:
366+
List:
367+
type: "object"
368+
properties:
369+
listId:
370+
type: "string"
371+
description: "ID of the list."
372+
listVersion:
373+
type: "integer"
374+
description: "Version of the list."
375+
name:
376+
type: "string"
377+
description: "Name of the list."
378+
objectTypeId:
379+
type: "string"
380+
description: "Object type ID of the list."
381+
processingStatus:
382+
type: "string"
383+
description: "Current processing status of the list."
384+
processingType:
385+
type: "string"
386+
description: "Processing type of the list."
387+
createdAt:
388+
type: "string"
389+
format: "date-time"
390+
description: "When the list was created."
391+
createdById:
392+
type: "string"
393+
description: "ID of the user who created the list."
394+
deletedAt:
395+
type: "string"
396+
format: "date-time"
397+
description: "When the list was deleted."
398+
filterBranch:
399+
type: "object"
400+
description: "Filter branch defining membership criteria."
401+
filtersUpdatedAt:
402+
type: "string"
403+
format: "date-time"
404+
description: "When the filters were last updated."
405+
listPermissions:
406+
type: "object"
407+
description: "Permissions for the list."
408+
properties:
409+
teamsWithEditAccess:
410+
type: "array"
411+
description: "Team IDs with edit access."
412+
items:
413+
type: "integer"
414+
usersWithEditAccess:
415+
type: "array"
416+
description: "User IDs with edit access."
417+
items:
418+
type: "integer"
419+
membershipSettings:
420+
type: "object"
421+
description: "Settings controlling list membership."
422+
properties:
423+
includeUnassigned:
424+
type: "boolean"
425+
description: "Whether unassigned records are included."
426+
membershipTeamId:
427+
type: "integer"
428+
description: "The team ID for membership filtering."
429+
size:
430+
type: "integer"
431+
description: "Number of members in the list."
432+
updatedAt:
433+
type: "string"
434+
format: "date-time"
435+
description: "When the list was last updated."
436+
updatedById:
437+
type: "string"
438+
description: "ID of the user who last updated the list."
304439
Contact:
305440
properties:
306441
id:

server/libs/modules/components/hubspot/src/main/java/com/bytechef/component/hubspot/AbstractHubspotComponentHandler.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.bytechef.component.definition.ComponentDefinition;
2424
import com.bytechef.component.hubspot.action.HubspotCreateContactAction;
2525
import com.bytechef.component.hubspot.action.HubspotCreateDealAction;
26+
import com.bytechef.component.hubspot.action.HubspotCreateListAction;
2627
import com.bytechef.component.hubspot.action.HubspotDeleteContactAction;
2728
import com.bytechef.component.hubspot.action.HubspotGetContactAction;
2829
import com.bytechef.component.hubspot.action.HubspotGetContactsAction;
@@ -43,14 +44,16 @@ public abstract class AbstractHubspotComponentHandler implements OpenApiComponen
4344
"HubSpot is a CRM platform with all the software, integrations, and resources you need to connect marketing, sales, content management, and customer service.")
4445
.version(1))
4546
.actions(modifyActions(HubspotCreateContactAction.ACTION_DEFINITION,
46-
HubspotCreateDealAction.ACTION_DEFINITION, HubspotDeleteContactAction.ACTION_DEFINITION,
47-
HubspotGetContactAction.ACTION_DEFINITION, HubspotGetContactsAction.ACTION_DEFINITION,
48-
HubspotGetTicketAction.ACTION_DEFINITION, HubspotUpdateContactAction.ACTION_DEFINITION))
47+
HubspotCreateDealAction.ACTION_DEFINITION, HubspotCreateListAction.ACTION_DEFINITION,
48+
HubspotDeleteContactAction.ACTION_DEFINITION, HubspotGetContactAction.ACTION_DEFINITION,
49+
HubspotGetContactsAction.ACTION_DEFINITION, HubspotGetTicketAction.ACTION_DEFINITION,
50+
HubspotUpdateContactAction.ACTION_DEFINITION))
4951
.connection(modifyConnection(HubspotConnection.CONNECTION_DEFINITION))
5052
.clusterElements(modifyClusterElements(tool(HubspotCreateContactAction.ACTION_DEFINITION),
51-
tool(HubspotCreateDealAction.ACTION_DEFINITION), tool(HubspotDeleteContactAction.ACTION_DEFINITION),
52-
tool(HubspotGetContactAction.ACTION_DEFINITION), tool(HubspotGetContactsAction.ACTION_DEFINITION),
53-
tool(HubspotGetTicketAction.ACTION_DEFINITION), tool(HubspotUpdateContactAction.ACTION_DEFINITION)))
53+
tool(HubspotCreateDealAction.ACTION_DEFINITION), tool(HubspotCreateListAction.ACTION_DEFINITION),
54+
tool(HubspotDeleteContactAction.ACTION_DEFINITION), tool(HubspotGetContactAction.ACTION_DEFINITION),
55+
tool(HubspotGetContactsAction.ACTION_DEFINITION), tool(HubspotGetTicketAction.ACTION_DEFINITION),
56+
tool(HubspotUpdateContactAction.ACTION_DEFINITION)))
5457
.triggers(getTriggers());
5558

5659
@Override
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright 2025 ByteChef
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.bytechef.component.hubspot.action;
18+
19+
import static com.bytechef.component.OpenApiComponentHandler.PropertyType;
20+
import static com.bytechef.component.definition.ComponentDsl.action;
21+
import static com.bytechef.component.definition.ComponentDsl.bool;
22+
import static com.bytechef.component.definition.ComponentDsl.integer;
23+
import static com.bytechef.component.definition.ComponentDsl.object;
24+
import static com.bytechef.component.definition.ComponentDsl.option;
25+
import static com.bytechef.component.definition.ComponentDsl.outputSchema;
26+
import static com.bytechef.component.definition.ComponentDsl.string;
27+
import static com.bytechef.component.definition.Context.Http.BodyContentType;
28+
import static com.bytechef.component.definition.Context.Http.ResponseType;
29+
30+
import com.bytechef.component.definition.ComponentDsl;
31+
import com.bytechef.component.hubspot.property.HubspotListProperties;
32+
import java.util.Map;
33+
34+
/**
35+
* Provides a list of the component actions.
36+
*
37+
* @generated
38+
*/
39+
public class HubspotCreateListAction {
40+
public static final ComponentDsl.ModifiableActionDefinition ACTION_DEFINITION = action("createList")
41+
.title("Create List")
42+
.description("Create a new list.")
43+
.metadata(
44+
Map.of(
45+
"method", "POST",
46+
"path", "/crm/lists/2026-03", "bodyContentType", BodyContentType.JSON, "mimeType", "application/json"
47+
48+
))
49+
.properties(string("name").metadata(
50+
Map.of(
51+
"type", PropertyType.BODY))
52+
.label("Name")
53+
.description("The name of the list, which must be globally unique across all public lists in the portal.")
54+
.required(true),
55+
string("objectTypeId").metadata(
56+
Map.of(
57+
"type", PropertyType.BODY))
58+
.label("Object Type ID")
59+
.description(
60+
"The object type ID of the type of objects that the list will store. (e.g., 0-1 for contacts).")
61+
.defaultValue("0-1")
62+
.required(true),
63+
string("processingType").metadata(
64+
Map.of(
65+
"type", PropertyType.BODY))
66+
.label("Processing Type")
67+
.description("The processing type of the list.")
68+
.options(option("MANUAL", "MANUAL"), option("DYNAMIC", "DYNAMIC"), option("SNAPSHOT", "SNAPSHOT"))
69+
.required(true),
70+
integer("listFolderId").metadata(
71+
Map.of(
72+
"type", PropertyType.BODY))
73+
.label("List Folder ID")
74+
.description(
75+
"The ID of the folder that the list should be created in. If left blank, then the list will be created in the root of the list folder structure.")
76+
.required(false),
77+
object("membershipSettings").properties(bool("includeUnassigned").label("Include Unassigned")
78+
.description("Whether to include unassigned records.")
79+
.required(false),
80+
integer("membershipTeamId").label("Membership Team Id")
81+
.description("The team ID for membership filtering.")
82+
.required(false))
83+
.metadata(
84+
Map.of(
85+
"type", PropertyType.BODY))
86+
.label("Membership Settings")
87+
.description("Settings controlling list membership.")
88+
.required(false))
89+
.output(outputSchema(object().properties(object("list").properties(HubspotListProperties.PROPERTIES)
90+
.required(false))
91+
.metadata(
92+
Map.of(
93+
"responseType", ResponseType.JSON))));
94+
95+
private HubspotCreateListAction() {
96+
}
97+
}

server/libs/modules/components/hubspot/src/main/java/com/bytechef/component/hubspot/connection/HubspotConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class HubspotConnection {
8686
scopeMap.put("crm.export", false);
8787
scopeMap.put("crm.import", false);
8888
scopeMap.put("crm.lists.read", false);
89-
scopeMap.put("crm.lists.write", false);
89+
scopeMap.put("crm.lists.write", true);
9090
scopeMap.put("crm.objects.appointments.read", false);
9191
scopeMap.put("crm.objects.appointments.sensitive.read", false);
9292
scopeMap.put("crm.objects.appointments.sensitive.write", false);
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Copyright 2025 ByteChef
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.bytechef.component.hubspot.property;
18+
19+
import static com.bytechef.component.definition.ComponentDsl.array;
20+
import static com.bytechef.component.definition.ComponentDsl.bool;
21+
import static com.bytechef.component.definition.ComponentDsl.dateTime;
22+
import static com.bytechef.component.definition.ComponentDsl.integer;
23+
import static com.bytechef.component.definition.ComponentDsl.object;
24+
import static com.bytechef.component.definition.ComponentDsl.string;
25+
26+
import com.bytechef.component.definition.ComponentDsl;
27+
import java.util.List;
28+
29+
/**
30+
* Provides properties definition built from OpenAPI schema.
31+
*
32+
* @generated
33+
*/
34+
public class HubspotListProperties {
35+
public static final List<ComponentDsl.ModifiableValueProperty<?, ?>> PROPERTIES = List.of(
36+
string("listId").label("List Id")
37+
.description("ID of the list.")
38+
.required(false),
39+
integer("listVersion").label("List Version")
40+
.description("Version of the list.")
41+
.required(false),
42+
string("name").label("Name")
43+
.description("Name of the list.")
44+
.required(false),
45+
string("objectTypeId").label("Object Type Id")
46+
.description("Object type ID of the list.")
47+
.required(false),
48+
string("processingStatus").label("Processing Status")
49+
.description("Current processing status of the list.")
50+
.required(false),
51+
string("processingType").label("Processing Type")
52+
.description("Processing type of the list.")
53+
.required(false),
54+
dateTime("createdAt").label("Created At")
55+
.description("When the list was created.")
56+
.required(false),
57+
string("createdById").label("Created By Id")
58+
.description("ID of the user who created the list.")
59+
.required(false),
60+
dateTime("deletedAt").label("Deleted At")
61+
.description("When the list was deleted.")
62+
.required(false),
63+
object("filterBranch").label("Filter Branch")
64+
.description("Filter branch defining membership criteria.")
65+
.required(false),
66+
dateTime("filtersUpdatedAt").label("Filters Updated At")
67+
.description("When the filters were last updated.")
68+
.required(false),
69+
object("listPermissions")
70+
.properties(array("teamsWithEditAccess").items(integer(null).description("Team IDs with edit access."))
71+
.placeholder("Add to Teams With Edit Access")
72+
.label("Teams With Edit Access")
73+
.description("Team IDs with edit access.")
74+
.required(false),
75+
array("usersWithEditAccess").items(integer(null).description("User IDs with edit access."))
76+
.placeholder("Add to Users With Edit Access")
77+
.label("Users With Edit Access")
78+
.description("User IDs with edit access.")
79+
.required(false))
80+
.label("List Permissions")
81+
.description("Permissions for the list.")
82+
.required(false),
83+
object("membershipSettings").properties(bool("includeUnassigned").label("Include Unassigned")
84+
.description("Whether unassigned records are included.")
85+
.required(false),
86+
integer("membershipTeamId").label("Membership Team Id")
87+
.description("The team ID for membership filtering.")
88+
.required(false))
89+
.label("Membership Settings")
90+
.description("Settings controlling list membership.")
91+
.required(false),
92+
integer("size").label("Size")
93+
.description("Number of members in the list.")
94+
.required(false),
95+
dateTime("updatedAt").label("Updated At")
96+
.description("When the list was last updated.")
97+
.required(false),
98+
string("updatedById").label("Updated By Id")
99+
.description("ID of the user who last updated the list.")
100+
.required(false));
101+
102+
private HubspotListProperties() {
103+
}
104+
}

0 commit comments

Comments
 (0)