Skip to main content
PUT
https://example.com
/
api
/
users
/
{userId}
/
role
Set user role
curl --request PUT \
  --url https://example.com/api/users/{userId}/role \
  --header 'Content-Type: application/json' \
  --cookie better-auth.session_token= \
  --data '{}'
{
  "error": {
    "code": "<string>",
    "message": "<string>",
    "requestId": "<string>",
    "statusCode": 123,
    "details": [
      {
        "message": "<string>",
        "path": "<string>"
      }
    ]
  }
}

Authorizations

better-auth.session_token
string
cookie
required

Path Parameters

userId
string
required
Minimum string length: 1

Body

application/json
role
enum<string>
required
Available options:
admin,
user

Response

Role updated