Assign a Feature to a User
Assign a feature to a user. Note that both the feature being assigned and the user the feature is being assigned to must already exist. Refer to the documentation to create a user and create a feature 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/features/:featureId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | The userId of the user you want to assign the feature to. | URL param | yes |
featureId | The featureId of the feature you want to assign to a user. | URL param | yes |
Request
- cURL
- Go
- Java
- Node.js
- Python
- Ruby
- PHP
- CLI
curl "https://api.warrant.dev/v1/users/d89sm4o9723/features/dashboard" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY"
assignedFeature, err := feature.AssignFeatureToUser("dashboard", "d89sm4o9723")
client.assignFeatureToUser("dashboard", "d89sm4o9723");
// Class method
await warrantClient.Feature.assignFeatureToUser("d89sm4o9723", "dashboard");
// Instance method
const user = await warrantClient.User.get("d89sm4o9723");
await user.assignFeature("dashboard");
# Class method
warrant.Feature.assign_to_user("d89sm4o9723", "dashboard")
# Instance method
user = warrant.User.get("d89sm4o9723")
user.assign_feature("dashboard")
# Class method
Warrant::Feature.assign_to_user("d89sm4o9723", "dashboard")
# Instance method
user = Warrant::User.get("d89sm4o9723")
user.assign_feature("dashboard")
Response
{
"objectType": "feature",
"objectId": "dashboard",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "d89sm4o9723"
}
}