Subscriptions
hubapi · Company
Subscriptions allow contacts to control what forms of communications they receive. Contacts can decide whether they want to receive communication pertaining to a specific topic, brand, or an entire HubSpot account.
Authentication
Sample Requests
Get a list of all subscription definitions for the portal
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/definitions";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Returns a list of subscriptions and their status for a given contact.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}"import requests
response = requests.get(
"https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}';
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/status/email/{emailAddress}";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Subscribes a contact to the given subscription type. This API is not valid to use for subscribing a contact at a brand or portal level and will return an error.
Hover any highlighted part to learn what it does
curl -X POST "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe"
import requests
response = requests.post(
"https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe';
const response = await fetch(url, {
method: 'POST',
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe"
req, _ := http.NewRequest("POST", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/hubapi.com/communication-preferences/v3/communication-preferences/v3/subscribe";
$opts = ["http" => [
"method" => "POST",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with Subscriptions?
Subscriptions is a Company API. Developers commonly use company APIs for:
- enriching CRM records with company firmographics
- building lead-generation and prospecting tools
- verifying business identity and registration details
- monitoring competitors and market intelligence
- powering B2B data enrichment pipelines
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Subscriptions is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?