Skip to main content

Assign a Role to a User

Assign a role to a user. Note that both the role being assigned and the user the role is being assigned to must already exist. Refer to the documentation to create a user and create a role for help.

caution

This endpoint has been deprecated and will be phased out at the end of 2023. Please update any existing usages of it to use the Create Warrant endpoint instead.

Endpoint

POST /v1/users/:userId/roles/:roleId

Parameters

ParameterDescriptionTypeRequired
userIdThe userId of the user you want to assign a role to.URL paramyes
roleIdThe roleId of the role you want to assign to a user.URL paramyes

Request

curl "https://api.warrant.dev/v1/users/28da7gjs923lg/roles/admin" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY"

Response

{
"roleId": "admin"
}