Bulk delete portal customers - Automation Query
Asked by Natalie Waters:

Hello!

Currently trying to follow this article - [Automation: Bulk delete portal customers](https://confluence.atlassian.com/jirakb/automation-bulk-delete-portal-customers-1129690625.html)

Can anyone elaborate on why I'm receiving the following error:

```
Error publishing web request. Response HTTP status:

```

403  

```
Error response HTTP body:
{"errorMessages":["error.no-permission"],"errors":{}}
```

<br />

I have a feeling it's to do with the "Authorization" field but due to the lack of information on the guide I'm stuck.

Does anyone know how and where I can attain this info --\> ![Screenshot 2023-12-12 at 16.20.02.png](/t5/image/serverpage/image-id/296428i5269F646CC095E9C/image-size/large?v=v2&px=999 "Screenshot 2023-12-12 at 16.20.02.png")

I've built out the below:

![Screenshot 2023-12-12 at 16.21.36.png](/t5/image/serverpage/image-id/296431i7DF38610B55925E3/image-size/large?v=v2&px=999 "Screenshot 2023-12-12 at 16.21.36.png")![Screenshot 2023-12-12 at 16.22.57.png](/t5/image/serverpage/image-id/296432iA139160272865052/image-size/large?v=v2&px=999 "Screenshot 2023-12-12 at 16.22.57.png")

Any help will be greatly appreciated.


Answers:
author: Marc - Devoteam
body: Hi [@Natalie Waters](/t5/user/viewprofilepage/user-id/4895699)

I think you need to create an API key on your account.

This will provide you with the information to fill in the Authorisation field

Basic and the API key.

Here is the article to create your [API key](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/)

comments: author: Natalie Waters
body: Hiya,

Thank you for that.

I've created an API key on my account and input those details but it's now just running an unending task without actions.

I've most likely input the incorrect information but I'm not sure what I needed to put in the Authorisation field.

Could you clarify what info is needed for the Value field?


author: Marc - Devoteam
body: Hi [@Natalie Waters](/t5/user/viewprofilepage/user-id/4895699)

When you created you API key, you got a string (key)

for the web requests the input for the value field is "Basic \<api_key\>" (without the quotes)


author: Natalie Waters
body: Ah I see, thank you for clarifying.

Is there a way to ensure users that are being deleted are only those that are not linked to any active tickets? Not sure if an "if" JQL query would support this.


author: David Friedrich
body: Hi [@Natalie Waters](/t5/user/viewprofilepage/user-id/4895699) , just to make sure: Did you confirm that the API user has the permission to delete all the users that will result from that request?

Another hunch: Are users provisioned through an IDP into your site (= managed users)? You can not delete managed users in your Atlassian site.

comments: author: Natalie Waters
body: Hiya,

Thanks for your input.

The actor in the automation is set to me and as I'm a site admin, technically I should have those permissions.

We're not looking to remove managed users that are being pushed through SCIM.

![Screenshot 2023-12-13 at 09.33.41.png](https://community.atlassian.com/t5/image/serverpage/image-id/296577i47E25BACBACB9520/image-size/large?v=v2&px=999 "Screenshot 2023-12-13 at 09.33.41.png")

I've attached a screenshot of the where the users in question are that I'm trying to remove. At this moment, we can only remove users individually but considering the amount of tickets received on a day to day basis, we would like to automate removing using in bulk.

I had previously reached out to the Atlassian support team and was sent the support article so it technically can be done, just not sure why it's not working.


author: David Friedrich
body: It is not about the actor of your automation rule. It is about the API key you created and granted basic authentication to. If you can confirm that it is an API key for your user, it should definitely work, if you could go to a user and delete them directly via GUI.

Sometimes it helps to create a new key.


Tags: cloud

jira-service-management

jira-service-management-cloud