Hubspot -> Update Deal
Action summary
Hubspot -> Update Deal
HubSpot → Update Deal
Overview
This function allows you to edit an existing deal in HubSpot using specified input parameters. It involves setting environment variables, preparing the request with updated deal details, and handling the response from the HubSpot API.
Inputs
hubspot_api_key (registry|text) Required Sensitive data
- Description: The API key for your HubSpot account.
name (text)
- Description: The updated name of the deal.
deal_stage (enum)
- Description: The updated stage of the deal.
- Options
appointmentscheduled
qualifiedtobuy
presentationscheduled
decisionmakerboughtin
contractsent
closedwon
closedlost
close_date (timestamp)
- Description: The updated expected close date of the deal in unix timestamp format in milliseconds.
owner_id (integer)
- Description: The updated ID of the owner of the deal.
amount (decimal)
- Description: The updated amount associated with the deal.
deal_id (text)
- Description: The unique identifier of the deal to be edited.
additional_properties (json)
- Description: Additional properties in JSON format to be updated.
Function Stack
1. Create Properties Object
- Create Variable:
properties_obj
- Purpose: Sets properties object from
input: additional_properties
and other input fields.
- Purpose: Sets properties object from
2. HubSpot API Request
- API Request to
https://api.hubapi.com/crm/v3/objects/deals/{deal_id}
- Purpose: Sends a PATCH request to update the specified deal in HubSpot.
3. Preconditions
- Precondition:
hubspot_api.response.status == 200
- Purpose: Ensures successful update of the deal with HTTP status code 200.
Response
- The function returns the result from the HubSpot API response.
Success response
{
"name": "Xano Actions",
"deal_stage": "qualifiedtobuy",
"close_date": 1729771263000,
"owner_id": 0,
"amount": 1456.55,
"additional_properties":
{
"closed_won_reason": "Quick deployment"
},
"deal_id": "22413038713"
}
Error response
{
"message": "Uh oh! Hubspot returned with an error: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview"
}
Example
Input
{
"name": "Xano Actions",
"deal_stage": "qualifiedtobuy",
"close_date": 1729771263000,
"owner_id": 0,
"amount": 1456.55,
"additional_properties":
{
"closed_won_reason": "Quick deployment"
},
"deal_id": "22413038713"
}
Output
{
"id": "22413038713",
"properties": {
"amount": "1456.55",
.
.
.
},
"createdAt": "2024-09-26T12:02:50.213Z",
"updatedAt": "2024-09-26T12:02:50.213Z",
"archived": false
}
Version notes
2024-10-04 14:11:59
Current