This Postman Collection provides pre-built requests for interacting with the HubSpot CRM API. It covers key operations for Contacts, Deals, Products, Line Items, and Users, including dynamic test data generation and automatic associations.
- Platform: HubSpot CRM API v3
- Format: Postman Collection v2.1
- Authentication: Bearer Token (set
access_tokenin environment)
| Key | Description |
|---|---|
access_token |
Your HubSpot private app token |
contact_id |
Generated after creating a contact |
deal_id |
Generated after creating a deal |
productId |
ID of the created product |
lineItemId |
ID of the created line item |
| Request | Method | Description |
|---|---|---|
| Create Contact | POST | Creates a new CRM contact |
| Get Contact | GET | Fetches a contact by ID |
Automatically generates random:
- First & last names
- Company
- Phone number
| Request | Method | Description |
|---|---|---|
| Create Deal | POST | Creates a new deal associated with a contact |
| Get Deal | GET | Fetches a deal by ID |
Randomly selects a deal stage from HubSpot defaults.
| Request | Method | Description |
|---|---|---|
| Create Product | POST | Creates a product with name, price, and SKU |
| Search Products | POST | Searches for products by name |
Random values generated:
- Product name (e.g., Premium Laptop)
- Description
- Price
- SKU
| Request | Method | Description |
|---|---|---|
| Create Line Item | POST | Creates a new line item |
| Associate Line Item to Product | POST | Batches line item with product |
| Associate Line Item to Deal | PUT | Links line item with deal |
Uses stored product and deal data for dynamic associations.
| Request | Method | Description |
|---|---|---|
| Search Users with Associated Deals | POST | Filters users who have deals associated |
Every request includes:
- Pre-request scripts to generate dynamic variables
- Tests to assert success responses and store IDs
- Global scripts to check for token and validate response time
- Import Collection into Postman.
- Create an Environment with the variable
access_token. - Run Requests sequentially or via a Collection Runner.
- Make sure to replace
{{access_token}}with a valid token. - IDs generated from one request are reused in others using environment variables.
- Some requests (like Line Item association) are conditional on existing values.
This collection is designed to simplify testing HubSpot integrations. Feel free to fork or extend it for your use cases.
-
Access Private Apps:
- Log in to your HubSpot account
- Navigate to Settings (βοΈ) > Integrations > Private Apps
- Click "Create private app"
-
Configure the App:
-
Basic Info:
- Name your app (e.g., "API Testing App")
- Add a description
- Upload an optional logo
-
Required Scopes:
crm.objects.contacts- for Contacts APIcrm.objects.deals- for Deals APIcrm.objects.products- for Products APIcrm.objects.line_items- for Line Items APIcrm.objects.owners- for Users API
-
Webhook Configuration (Optional):
- In the "Webhooks" tab of your private app:
- Enable "Select specific subscription types"
- Choose the events you want to monitor:
contact.creation- When contacts are createdcontact.propertyChange- When contact properties changedeal.creation- When deals are createddeal.propertyChange- When deal properties changeproduct.creation- When products are createdproduct.propertyChange- When product properties change
- Set your Target URL where webhooks will be sent
- Configure webhook settings:
- Select authentication method (Basic Auth/Bearer Token)
- Set rate limiting preferences
- Choose retry settings for failed webhooks
- Test your webhook endpoint using HubSpot's test feature
Webhook Security Best Practices:
- Use HTTPS for your webhook endpoint
- Implement webhook signature validation
- Set up proper authentication for your endpoint
- Monitor webhook delivery status in HubSpot
- Configure retry attempts for failed deliveries
- In the "Webhooks" tab of your private app:
-
-
Get Your Token:
- Click "Create app"
- Copy the generated access token immediately
- Format:
pat-na1-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- Never share or commit your access token
- Store it securely in environment variables
- Create separate apps for different environments
- Regularly audit and remove unused apps
- Token can be revoked and regenerated if compromised
MIT License