Skip to main content

Assign a Permission to a User

Assign a permission to a user. Note that both the permission being assigned and the user the permission is being assigned to must already exist. Refer to the documentation to create a user and create a permission 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/permissions/:permissionId

Parameters

ParameterDescriptionTypeRequired
userIdThe userId of the user you want to assign a permission to.URL paramyes
permissionIdThe permissionId of the permission you want to assign to a role.URL paramyes

Request

curl "https://api.warrant.dev/v1/users/d89sm4o9723/permissions/create-report" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY"

Response

{
"permissionId": "create-report"
}