HubSpot

The simplest HubSpot API you have every seen!

TL;DR

This API proxy lets you do any operation on your HubSpot data but removes from you all the complexity of setting up and using the classic Salesforce API 🀩

No need to worry about setting up a connected app, rotating the security token, using bulk API or not, record formatting and more! Everything is managed for you πŸ’†β€β™€οΈ

Operations:

Regions 🌍

Depending on your region, you can use

πŸ‡ͺπŸ‡Ί https://eu.api-proxy.stacksync.cloud/

πŸ‡ΊπŸ‡Έ https://us.api-proxy.stacksync.cloud/

Get

Get the content of up to 100 records. The number of records returned matches the number of Ids passed in the request.

You can pass the optional fields parameter (list of field names that you want to be returned for each record). If the list of fields is not passed or is empty "fields":[], all fields are returned.

Currently the following HubSpot objects are supported:

  • Companies

  • Contacts

  • Deals

  • Feedback submissions

  • Line items

  • Products

  • Quotes

  • Discounts

  • Fees

  • Taxes

  • Tickets

  • Goals

  • Custom objects

The following objects will be added in the future:

  • Owners

  • Associations

  • Audit Logs

  • Pipelines

  • Stages

curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/get/Contact \
        -H "Authorization: Bearer your_api_proxy_service_token" \
        -H "Content-Type: application/json" \
        -d '{"data": {"ids": ["227400", "264150"], "fields": ["firstname"]}}'

Example response body:

{
	"data": [
		{
			"archived": false,
			"createdAt": "2024-01-31T13:17:43.128Z",
			"id": "227400",
			"properties": {
				"createdate": "2024-01-31T13:17:43.128Z",
				"firstname": null,
				"hs_object_id": "227400",
				"lastmodifieddate": "2024-02-02T15:05:54.183Z"
			},
			"updatedAt": "2024-02-02T15:05:54.183Z"
		},
		{
			"archived": false,
			"createdAt": "2024-01-31T13:17:43.128Z",
			"id": "227386",
			"properties": {
				"createdate": "2024-01-31T13:17:43.128Z",
				"firstname": null,
				"hs_object_id": "227386",
				"lastmodifieddate": "2024-01-31T13:28:37.746Z"
			},
			"updatedAt": "2024-01-31T13:28:37.746Z"
		}
	]
}

Add a custom field to a HubSpot object

Add a custom field to a HubSpot object. Standard and custom objects are supported.

The required request body parameters are:

  • name The internal property name, which must be used when referencing the property via the API.

  • label A human-readable property label that will be shown in HubSpot.

  • type The data type of the property.

  • fieldType Controls how the property appears in HubSpot.

  • groupName The name of the property group the property belongs to.

Each type has one or more valid fieldTypes, using incompatible type and fieldType will not work. The full list of types and fieldTypes and valid combinations can be found here.

curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/{object_name} \
        -H "Authorization: Bearer your_api_proxy_service_token" \
        -H "Content-Type: application/json" \
        -d '{"data": {"name": "field_name", "type": "field_type", "label": "field_label", "fieldType": "field_type", "groupName": "group_name"}}'

Example Response Body:

{
    "data": {
	"archived": false,
	"calculated": false,
	"createdAt": "2024-01-11T23:43:00.066Z",
	"createdUserId": "46192612",
	"description": "",
	"displayOrder": -1,
	"externalOptions": false,
	"fieldType": "text",
	"formField": false,
	"groupName": "companyinformation",
	"hasUniqueValue": false,
	"hidden": false,
	"label": "StacksyncID",
	"modificationMetadata": {
		"archivable": true,
		"readOnlyDefinition": false,
		"readOnlyValue": false
	},
	"name": "enumeration",
	"options": [],
	"type": "string",
	"updatedAt": "2024-01-11T23:43:00.066Z",
	"updatedUserId": "46192612"
   },
   "message": "Custom field added successfully"
}

Example requests for different field types for HubSpot Company object:

curl -X POST https://eu.api-proxy.stacksync.cloud/v1/object/add_custom_field/company \
        -H "Authorization: Bearer *****" \
        -H "Content-Type: application/json" \
        -d '{
                "data": {
                    "name": "custom_field",
                    "label": "Custom Field", 
                    "type": "string",  
                    "fieldType": "text",
                    "groupName": "companyinformation"
                }
            }'

Pass Through

Make a request to any HubSpot API which supports OAuth by providing the URL, Request Method and the Request Body.

HubSpot indicates whether an endpoint can be used with an OAuth token in their API documentation: https://developers.hubspot.com/docs/api/overview

A request will be sent to the URL provided using the request method and request body. The request body can be empty.

curl -X [GET | POST | PUT | PATCH | DELETE] 
https://eu.api-proxy.stacksync.cloud/v1/proxy/INSERT_REQUEST_URL_HERE \
-H "Authorization: Bearer your_api_proxy_service_token" \
-d 'Optional'

Example request:

Create a new HubSpot Contact

curl -X POST https://eu.api-proxy.stacksync.cloud/v1/proxy/https://api.hubapi.com/crm/v3/objects/contacts/batch/create \
        -H "Authorization: Bearer your_api_proxy_service_token" \
        -H "Content-Type: application/json" \
        -d '{"inputs": [{"properties":{	"email": "john@company.com"}}]}'

Example response:

{
	"completedAt": "2024-02-12T02:18:24.961Z",
	"results": [
		{
			"archived": false,
			"createdAt": "2024-02-12T02:18:24.748Z",
			"id": "441751",
			"properties": {
				"createdate": "2024-02-12T02:18:24.748Z",
				"email": "john@company.com",
				"hs_all_contact_vids": "441751",
				"hs_email_domain": "company.com",
				"hs_is_contact": "true",
				"hs_is_unworked": "true",
				"hs_lifecyclestage_lead_date": "2024-02-12T02:18:24.748Z",
				"hs_marketable_status": "false",
				"hs_marketable_until_renewal": "false",
				"hs_object_id": "441751",
				"hs_object_source": "INTEGRATION",
				"hs_object_source_id": "1749998",
				"hs_object_source_label": "INTEGRATION",
				"hs_pipeline": "contacts-lifecycle-pipeline",
				"lastmodifieddate": "2024-02-12T02:18:24.748Z",
				"lifecyclestage": "lead"
			},
			"updatedAt": "2024-02-12T02:18:24.748Z"
		}
	],
	"startedAt": "2024-02-12T02:18:24.720Z",
	"status": "COMPLETE"
}

Get the schema / columns of a standard Hubspot object

curl -X GET 
https://eu.api-proxy.stacksync.cloud/v1/proxy/https://api.hubapi.com/crm/v3/properties/<object_name> \
-H "Authorization: Bearer your_api_proxy_service_token" \

Get the schema / columns of custom Hubspot objects

curl -X GET 
https://eu.api-proxy.stacksync.cloud/v1/proxy/https://api.hubapi.com/crm/v3/schemas \
-H "Authorization: Bearer your_api_proxy_service_token"

Last updated