# Custom Workflow Actions: Patch method, returns 500 Internal Server Error

**URL:** <https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321>\
**Category:** APIs & Integrations\
**Tags:** professional, starter\
**Created:** [January 20, 2025, 12:06am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321 "2025-01-20T00:06:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RBaniqued](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RBaniqued](https://community.hubspot.com/u/RBaniqued)\
**Post date:** [January 20, 2025, 12:06am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/1 "2025-01-20T00:06:32Z")

</div>

When attempting to update an existing custom workflow action’s specifically changing the `actionUrl` field using the PATCH method, but the API returns a 500 Internal Server Error.

 ![RBaniqued_0-1737330658629.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/e/5ee53f6a8fac2722a21030da4ae7ee9753107475.png)

For ActionUrl, I am using ngrok pointing to my local pc, so i am sure that it works.

Here’s the sample body

```lia-code-sample
{
 "id": "30920351",
 "actionUrl": "{{actionUrl}}/api/send-sms",
 "integrationAppId": {{applicationId}},
 "published": true,
 "extensionName": "SMS Local Testing V1",
 "httpHeaders": {
 "Authorization": "Bearer {{auth_token}}"
 },
 "version": 8,
 "latestVersion": 8.1,
 "objectTypes": ["CONTACT", "DEAL"],
 "inputFields": [
 {
 "typeDefinition": {
 "name": "widgetPhone",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"],
 "isRequired": true
 },
 {
 "typeDefinition": {
 "name": "smsMessage",
 "type": "string",
 "fieldType": "textarea"
 },
 "supportedValueTypes": ["STATIC_VALUE"],
 "isRequired": true
 }
 ],
 "outputFields": [
 {
 "typeDefinition": {
 "name": "status",
 "type": "bool",
 "fieldType": "booleancheckbox"
 },
 "supportedValueTypes": [
 "STATIC_VALUE"
 ]
 }
 ],
 "labels": {
 "en": {
 "inputFieldLabels": {
 "widgetPhone": "Enter phone number",
 "smsMessage": "SMS Message"
 },
 "outputFieldLabels": {
 "status": "Success"
 },
 "actionName": "SMS Local Testing V1",
 "actionDescription": "This custom workflow is for testing only",
 "actionCardContent": "SMS Local Testing V1"
 }
 },
 "functions": [
 {
 "functionType": "PRE_ACTION_EXECUTION",
 "functionSource": "exports.main = (event, callback) => {\n\n callback({\n \"data\": {\n \"hs_object_id\": event[\"object\"][\"objectId\"],\n \"phone\": event[\"object\"][\"widgetPhone\"] ,\n \"text\": event[\"inputFields\"][\"smsText\"] \n }\n });\n}\n"
 },
 {
 "functionType": "POST_ACTION_EXECUTION",
 "functionSource": "exports.main = (event, callback) => {\n callback({\n \"outputFields\": {\n \"status\": \"true\" ,\n \"hs_execution_state\": \"SUCCESS\" \n }\n });\n}\n"
 }
 ]

}

```

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [January 20, 2025, 1:20am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/2 "2025-01-20T01:20:22Z")

</div>

Hi @RBaniqued 👋

Using your example JSON body, I’ve not been able to replicate the issue you’re experiencing.

Could you please share the failing request’s cURL code snippet (as generated by Postman)? Be sure to redact any potentially sensitive information (including API keys, private access tokens etc.).

---

<div class="post-metadata">

**Author:** ![RBaniqued](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RBaniqued](https://community.hubspot.com/u/RBaniqued)\
**Post date:** [January 20, 2025, 3:01am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/3 "2025-01-20T03:01:22Z")

</div>

Hi [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811)  
Here’s the generated curl, still the same on my side though when tested it

```lia-code-sample
curl --location --request PATCH 'https://api.hubapi.com/automation/v4/actions/{{applicationId}}/{{actionID}}?hapikey={{hapikey}}' \
--header 'Content-Type: application/json' \
--header 'Cookie: __cf_bm=fca0wPnfoMIZlImG8L5aGPUi6PCDN27inF_fQACxmbE-1737337696-1.0.1.1-ZtjFfhufpfrzBeAD_E5bcaQNGgVaK9CFf4TZ6mSd4OfGnGN0wQ3BX4WXKUI8wcBIVhzXe4EdMgMZrYSnus3rmA' \
--data '{
 "id": {{actionID}},
 "actionUrl": "https://webhook.site/dadf4961-2212-4f77-a9b9-b5f5f6ee37c0",
 "integrationAppId": {{applicationId}},
 "published": true,
 "extensionName": "SMS Local Testing V1",
 "version": 8,
 "latestVersion": 8.1,
 "objectTypes": ["CONTACT", "DEAL"],
 "inputFields": [
 {
 "typeDefinition": {
 "name": "widgetPhone",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"],
 "isRequired": true
 },
 {
 "typeDefinition": {
 "name": "smsMessage",
 "type": "string",
 "fieldType": "textarea"
 },
 "supportedValueTypes": ["STATIC_VALUE"],
 "isRequired": true
 }
 ],
 "outputFields": [
 {
 "typeDefinition": {
 "name": "status",
 "type": "bool",
 "fieldType": "booleancheckbox"
 },
 "supportedValueTypes": [
 "STATIC_VALUE"
 ]
 }
 ],
 "labels": {
 "en": {
 "inputFieldLabels": {
 "widgetPhone": "Enter phone number",
 "smsMessage": "SMS Message"
 },
 "outputFieldLabels": {
 "status": "Success"
 },
 "actionName": "SMS Local Testing V1",
 "actionDescription": "This custom workflow is for testing only",
 "actionCardContent": "SMS Local Testing V1"
 }
 },
 "functions": [
 {
 "functionType": "PRE_ACTION_EXECUTION",
 "functionSource": "exports.main = (event, callback) => {\n\n callback({\n \"data\": {\n \"hs_object_id\": event[\"object\"][\"objectId\"],\n \"phone\": event[\"object\"][\"widgetPhone\"] ,\n \"text\": event[\"inputFields\"][\"smsText\"] \n }\n });\n}\n"
 },
 {
 "functionType": "POST_ACTION_EXECUTION",
 "functionSource": "exports.main = (event, callback) => {\n callback({\n \"outputFields\": {\n \"status\": \"true\" ,\n \"hs_execution_state\": \"SUCCESS\" \n }\n });\n}\n"
 }
 ]
}'

```

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [January 20, 2025, 3:44am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/4 "2025-01-20T03:44:48Z")

</div>

Hi @RBaniqued 👋

Thanks for sharing the additional info. This is still leading to a success response for me and nothing really jumps out at me when reviewing your example request.

Do you have any comments in your request body within Postman? Sometimes I’ve seen errors like this that seem to relate to the inclusion of comments in request JSON bodies.

---

<div class="post-metadata">

**Author:** ![RBaniqued](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RBaniqued](https://community.hubspot.com/u/RBaniqued)\
**Post date:** [January 20, 2025, 4:00am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/5 "2025-01-20T04:00:58Z")

</div>

Hi [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) , regarding comments, none, actually i removed all possible that might cause any errors in updating a custom action, also tried giving an error format for json, but it gives the right error response, which is expected. Its just when everything is good, I am getting this kind of 500 Internal error, it is really weird. So far, for me to move forward, I created another custom action, tried everything there. and it works fine. For now im gonna use that.  
Thanks for such a big help.

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [January 20, 2025, 5:15am UTC](https://community.hubspot.com/t/custom-workflow-actions-patch-method-returns-500-internal-server-error/124321/6 "2025-01-20T05:15:57Z")

</div>

@RBaniqued Glad you got it sorted 👍
