# Not able to update user role in community through API

**URL:** <https://forum.social.plus/t/not-able-to-update-user-role-in-community-through-api/996>\
**Category:** General\
**Created:** [November 30, 2023, 7:46am UTC](https://forum.social.plus/t/not-able-to-update-user-role-in-community-through-api/996 "2023-11-30T07:46:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![muhammad.nasir.ext](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@muhammad.nasir.ext](https://forum.social.plus/u/muhammad.nasir.ext)\
**Post date:** [November 30, 2023, 7:46am UTC](https://forum.social.plus/t/not-able-to-update-user-role-in-community-through-api/996/1 "2023-11-30T07:46:36Z")

</div>

Hi,

I am trying to update a community role in swagger and pass my admin token in `BearerAuth` but it keeps on failing with authorization error. Right server region is selected from dropdown. See following curl

```auto
curl -X 'POST' \
  'https://api.eu.amity.co/api/v3/communities/65623a469ad025e5512235f5/users/roles' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "role": "moderator",
  "userIds": [
    "654_32"
  ]
}'

```

```auto
{
  "status": "error",
  "message": "Authorization info not found",
  "code": 400100,
  "data": {
    "detail": {
      "appErrorCode": 400100
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [November 30, 2023, 11:22am UTC](https://forum.social.plus/t/not-able-to-update-user-role-in-community-through-api/996/2 "2023-11-30T11:22:42Z")

</div>

Hello,

Do you want to update the user from a ‘Member’ to a ‘Community Moderator’? If you want to change it to a Community Moderator, we recommend you try following the example curl below :

```auto
curl --location 'https://api.sg.amity.co/api/v3/communities/65423b2980bf8c792482b48d/users/roles' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxx' \
--data '{
  "role": "community-moderator",
  "userIds": [
    "test"
  ]
}'

```

Can you please confirm if the admin token you’re using is generated from the console? If it is, we recommend using Postman, as Swagger can sometimes cause issues.

Best regards,

Support Team
