List SMTP API Tokens
curl --request GET \
--url https://api.hubapi.com/email/public/v1/smtpapi/tokensimport requests
url = "https://api.hubapi.com/email/public/v1/smtpapi/tokens"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hubapi.com/email/public/v1/smtpapi/tokens', 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/email/public/v1/smtpapi/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/email/public/v1/smtpapi/tokens"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/email/public/v1/smtpapi/tokens")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/email/public/v1/smtpapi/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"portalId": 123,
"userName": "<string>",
"emailCampaignId": 123,
"createdAt": 123,
"deleted": true,
"createdBy": "<string>",
"appId": 123,
"campaignName": "<string>"
}
]{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}v1
List SMTP API Tokens
List SMTP API tokens which can then be used to send email through HubSpot’s SMTP API. Note that this API will not return passwords. Passwords are only returned during token creation, and during password reset.
GET
/
email
/
public
/
v1
/
smtpapi
/
tokens
List SMTP API Tokens
curl --request GET \
--url https://api.hubapi.com/email/public/v1/smtpapi/tokensimport requests
url = "https://api.hubapi.com/email/public/v1/smtpapi/tokens"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.hubapi.com/email/public/v1/smtpapi/tokens', 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/email/public/v1/smtpapi/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hubapi.com/email/public/v1/smtpapi/tokens"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hubapi.com/email/public/v1/smtpapi/tokens")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hubapi.com/email/public/v1/smtpapi/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"portalId": 123,
"userName": "<string>",
"emailCampaignId": 123,
"createdAt": 123,
"deleted": true,
"createdBy": "<string>",
"appId": 123,
"campaignName": "<string>"
}
]{
"category": "<string>",
"correlationId": "<string>",
"message": "<string>",
"subCategory": "<string>",
"errors": [
{
"message": "<string>",
"in": "<string>",
"code": "<string>",
"subCategory": "<string>",
"context": {}
}
],
"context": {},
"links": {}
}Scope requirements
Scope requirements
Respuesta
List of SMTP API tokens
The portal ID
The SMTP username
The email campaign ID
Creation timestamp
Whether the token is deleted
Email address of the user who created the token
The application ID
Name of the campaign
Última modificación el 3 de abril de 2026