Unexpected API Limit: User blocked! No more tickets allowed for this user

Hello!

I’m working on a project related to data migration. Approximately ~16000 tickets and very many notes (from 1 to 6 per ticket) must be created in Freshservice.
The migration script uses special queueing/throttling mechanisms in order to prevent hitting the Freshservice API limits. This way, only 1 request is sent to Freshservice every 2 seconds.

I’ve launched the migration script I’ve prepared previously, but after ~13000 tickets got successfully created, every next request got the following response:

{
	"status": 400,
	"description": "Validation failed",
	"errors": [
		{
			"field": "base",
			"message": "User blocked! No more tickets allowed for this user",
			"code": "invalid_value"
		},
		{
			"field": "closure_rules",
			"message": "",
			"code": "invalid_value"
		}
	]
}

As far as I remember, this is some sort of a Freshworks DDoS prevention mechanism, or something else related to security.
However, I could not find any information about that in the Freshservice documentation. The list of mentioned error codes (Error → Error Codes) does not mention any other descriptions for the "invalid_value" error rather than:

“This code indicates that a request contained an incorrect or blank value, or was in an invalid format”.

I assume that it could be very important for us, developers, to know technical details of such limit/restriction/security mechanism.

Could you please tell us more about this error and how to avoid it in the future?
Thanks!

2 Likes

Hello Ilya, welcome back to Freshworks developer community!:slight_smile:

From what I checked, some of the possible reasons for the above error message/ blocking the requester user are if it is

  1. identified as a spam email (checked by a spam watcher)
  2. or if it belongs to free or disposable/restricted domain
  3. Agent belongs to an unpaid account
  4. Agent belongs to trial account

Does your script fall into any of the above categories?
Were you able to complete the migration and have all the ~16000 tickets created?

Hello GR,

Thank you for the response.
No, fortunately the script is not related to these categories.

I’ve tried several different API keys, including the previously used one (when 13 000 tickets got successfully created):

  1. All API keys work perfectly well when I send requests in order to create a demo/test ticket from Postman, for example.
  2. However, I am still getting the very same error as mentioned in the original post when use any of the API keys and run the script.

Also, I’m using a locally running proxy for the script to work (otherwise requests to the 3rd party service I’m migrating data from simply won’t work), so I guess that some relevant IP address got banned by Freshservice. This is just an assumption though.

I’m currently implementing a workaround by creating a VPS to send the requests to Freshservice from in order to complete the migration by importing the remaining ~3000 tickets and relevant notes.

1 Like

Update: tried setting up a VPS - didn’t help, still getting the very same error for any API key used. So, the network/IP address is not the issue.
New theory: the new tickets’ requester’s email got banned by Freshservice.

Yes, the contact got blocked (blacklisted) by Freshservice.
We’ve unblocked it and added to the whitelist.
The tickets are getting created now.

It would be still great to know how Freshservice defines whether the contact should be blocked or not.

3 Likes

That is great! I suspect that the internal spam checker blacklisted the email id after having received several requests from the same email id in a short span of time and hence the user was blocked. However, i will verify that this is the case and if we have any limits on the number of requests/ time interval and post, and sure it would be great to have this conveyed in the error message or documentation. Thanks for the feedback!

2 Likes