APIs & Integrations

TWallen
Contributor

500 Internal Server Error When Creating New Users

SOLVE

Workato is our integration platform to connect HubSpot with our ERP system.

 

For the last year, we've had an integration to create HubSpot users from the ERP system employees. We've created a custom action to Create the User following this documentation: https://developers.hubspot.com/docs/api/settings/user-provisioning

 

Everything has worked well until the last few weeks. Recently, we started to receive the following error: 500 Internal Server Error: {"status":"error","message":"internal error","correlationId":"a71f1330-7e98-4a15-a0e6-dacf53ba3d17"}. 

 

Please let me know what more information you need to help us identify why we get this issue. 

 

1 Accepted solution
zach_threadint
Solution
Top Contributor

500 Internal Server Error When Creating New Users

SOLVE

Hi @TWallen 👋

I've just managed to replicate the issue you've described. Seems to be related to the empty "primaryTeamId" key-value pair. When the User you're trying to create isn't being added to a Team, I'd suggest omitting the "primaryTeamId" key from your request. For example:

 

{
    "email": "example@waremalcomb.com",
    "sendWelcomeEmail": "false",
    "roleId": "311438"
}

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

0 Upvotes
4 Replies 4
TWallen
Contributor

500 Internal Server Error When Creating New Users

SOLVE
{
	"mnemonic": "Create User",
	"verb": "post",
	"response_type": "json",
	"path": "https://api.hubapi.com/settings/v3/users/",
	"input": {
		"schema": "[{\"name\":\"email\",\"type\":\"string\",\"optional\":true,\"label\":\"email\",\"control_type\":\"text\"},{\"name\":\"roleId\",\"type\":\"string\",\"optional\":true,\"label\":\"roleid\",\"control_type\":\"text\"},{\"name\":\"sendWelcomeEmail\",\"type\":\"boolean\",\"optional\":true},{\"name\":\"primaryTeamId\",\"type\":\"string\",\"optional\":false,\"hint\":\"Primary Team ID\",\"control_type\":\"text\",\"label\":\"Primary team ID\"}]",
		"data": {
			"email": "example@waremalcomb.com",
			"sendWelcomeEmail": "false",
			"primaryTeamId": "",
			"roleId": "311438"
		}
	},
	"request_type": "json",
	"output": "[{\"name\":\"id\",\"type\":\"string\",\"optional\":false,\"hint\":\"Owner ID\",\"control_type\":\"text\",\"label\":\"ID\"},{\"name\":\"userId\",\"type\":\"integer\",\"optional\":false,\"control_type\":\"integer\",\"label\":\"User ID\",\"parse_output\":\"integer_conversion\"}]"
}

 
Above is our raw JSON for the input.

0 Upvotes
zach_threadint
Solution
Top Contributor

500 Internal Server Error When Creating New Users

SOLVE

Hi @TWallen 👋

I've just managed to replicate the issue you've described. Seems to be related to the empty "primaryTeamId" key-value pair. When the User you're trying to create isn't being added to a Team, I'd suggest omitting the "primaryTeamId" key from your request. For example:

 

{
    "email": "example@waremalcomb.com",
    "sendWelcomeEmail": "false",
    "roleId": "311438"
}

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
zach_threadint
Top Contributor

500 Internal Server Error When Creating New Users

SOLVE

Hi @TWallen 👋

Some additional information relating to the API request that is resulting in this error might be helpful. For example:

  • Request method (e.g. POST, GET)
  • Request headers
  • Request URL (incl. any query string params)
  • Request body

Also, when you say "custom action", is that a HubSpot custom code workflow action?

 

I hope this proves useful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
TWallen
Contributor

500 Internal Server Error When Creating New Users

SOLVE

@zach_threadint Thank you for your response. We are using the POST method. Our path is https://api.hubapi.com/settings/v3/users/.  The custom action is an option in Workato to build our own HubSpot action with a HTTP request.

Screenshot of the request type and body parameters. Also below is a screenshot of our response body.

 

TWallen_0-1705594843057.png

TWallen_1-1705594853808.png

 

0 Upvotes