# Unable to update an API with patch resource

**URL:** <https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006>\
**Category:** Get Help\
**Tags:** resource-servers, management-api\
**Created:** [November 1, 2023, 6:40pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006 "2023-11-01T18:40:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![laku](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/laku/32/50261_2.png) [@laku](https://community.auth0.com/u/laku)\
**Post date:** [November 1, 2023, 6:40pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006/1 "2023-11-01T18:40:08Z")

</div>

Hi all,  
I’m trying to update the HS256 signing secret for an API. This should be possible using the Resource Server resource via the Management API like so: [Auth0 Management API v2](https://auth0.com/docs/api/management/v2/resource-servers/patch-resource-servers-by-id)

I can access correctly access the details of the API in question with the appropriate GET request. I can enumerate all the APIs, I got the management token manually via the dashboard and it appears to have the correct scopes for what I want to do: “read:resource\_servers update:resource\_servers delete:resource\_servers create:resource\_servers”

In my case call the PATCH method with a payload that contains the new signing secret.

My issue is that no matter the payload I try all I get is a 301 response that redirects to the GET request, so  
this call PATCH http://.us.auth0.com/api/v2/resource-servers/ with a payload redirects to GET http://.us.auth0.com/api/v2/resource-servers/

Is the ability to update deprecated/not supported perhaps ?

Anyone able to update an API via the Management API ? the Management API Explorer also doesnt work for me for this particular call.

thnx,  
L.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 1, 2023, 10:35pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006/3 "2023-11-01T22:35:37Z")

</div>

Hi @laku,

Welcome to the Auth0 Community!

I have ran some tests on my end and found no issues with updating my API’s signing algorithm from RS256 to HS256.

In my tests, I used Postman to make a PATCH request to the Management API’s [Update a resource server endpoint](https://auth0.com/docs/api/management/v2/resource-servers/patch-resource-servers-by-id). In the response, I received a 200 response status code and when checking the Dashboard, the changes are reflected on there.

Here is the piece of code I used to update the API’s signing algorithm:

```auto
curl -L -X PATCH 'https://login.auth0.com/api/v2/resource-servers/:id' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"signing_alg":"HS256"}'

```

Please let me know how it goes for you.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![laku](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/laku/32/50261_2.png) [@laku](https://community.auth0.com/u/laku)\
**Post date:** [November 8, 2023, 4:42pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006/4 "2023-11-08T16:42:57Z")

</div>

Hi Reuben,  
I was able to get back to this and it seems to work now. The docs specify a 201 response, but I do get a 200 now.

For what its worth after reading your reply I did use the [login.auth0.com](http://login.auth0.com) hostname with my ‘:id’ which obviously error’d out and then I switched back to my tenant hostname and all seemed to be working.

thanks,  
Laku.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 16, 2023, 10:06pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006/5 "2023-11-16T22:06:26Z")

</div>

Hi @laku,

Thanks for the update, and I’m glad it’s working now!

Please reach out to us again if you have any additional questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 30, 2023, 10:07pm UTC](https://community.auth0.com/t/unable-to-update-an-api-with-patch-resource/120006/6 "2023-11-30T22:07:05Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
