Delete Async (POST) api not working

Hello, There,

I couldn’t use 7.6 rest api to delete process instances asynchronously.

What I did:
POST process-instance/delete-historic-query-based
body: {
“historicProcessInstanceQuery”: {
“processDefinitionKey”:“production-process”
},
“deleteReason” : “aReason”
}

the response was:

{
“type”: “InvalidRequestException”,
“message”: “Process instance with id delete-historic-query-based does not exist”
}

@Y_Chen see the API docs: https://docs.camunda.org/manual/7.7/reference/rest/process-instance/post-delete-historic-query-based/ The field `processDefinitionKey` is not supported as a parameter.

you need to provide a list of processInstanceIds.

I am using 7.6.

https://docs.camunda.org/manual/7.6/reference/rest/process-instance/post-delete-historic-query-based/

I used “historicProcessInstanceQuery” which is described in here.

https://docs.camunda.org/manual/7.6/reference/rest/history/process-instance/post-process-instance-query/#request-body

@Y_Chen can you double check your quotes? When i copied your example it had smart quotes.

I just recreated your example and it worked as expected:

{
	"historicProcessInstanceQuery": {
		"processDefinitionKey":"PayTaxes"
	},
	"deleteReason" : "aReason"
}

Thank you very much! StephenOTT.

I found the problem.

It is related to network configuration.

Basically our server is behind nginx, the url I hit was redirected to another one and the method was also changed from POST to GET.

I got the right url now.

but i still failed and got different response.

the response was

allow →HEAD, DELETE, GET, OPTIONS
connection →keep-alive
content-length →0
date →Thu, 26 Oct 2017 21:13:29 GMT
server →nginx

to make sure nginx didn’t block POST method.

I tried POST /external-task/fetchAndLock, it worked.

Is there any configuration that prevents data from being deleted?