Assign a Pricing Tier to a User
Assign a pricing tier to a user. Note that both the pricing tier being assigned and the user the pricing tier is being assigned to must already exist. Refer to the documentation to create a user and create a pricing tier 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/pricing-tiers/:pricingTierId
Parameters
Parameter | Description | Type | Required |
---|---|---|---|
userId | The userId of the user you want to assign the pricing tier to. | URL param | yes |
pricingTierId | The pricingTierId of the pricing tier 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/pricing-tiers/enterprise-tier" \
-X POST \
-H "Authorization: ApiKey YOUR_KEY"
assignedPricingTier, err := pricingtier.AssignPricingTierToUser("enterprise-tier", "d89sm4o9723")
client.assignPricingTierToUser("enterprise-tier", "d89sm4o9723");
// Class method
await warrantClient.PricingTier.assignPricingTierToUser(
"d89sm4o9723",
"enterprise-tier"
);
// Instance method
const user = await warrantClient.User.get("d89sm4o9723");
await user.assignPricingTier("enterprise-tier");
# Class method
warrant.PricingTier.assign_to_user("d89sm4o9723", "enterprise-tier")
# Instance method
user = warrant.User.get("d89sm4o9723")
user.assign_pricing_tier("enterprise-tier")
# Class method
Warrant::PricingTier.assign_to_user("d89sm4o9723", "enterprise-tier")
# Instance method
user = Warrant::User.get("d89sm4o9723")
user.assign_pricing_tier("enterprise-tier")
Response
{
"objectType": "pricing-tier",
"objectId": "enterprise-tier",
"relation": "member",
"subject": {
"objectType": "user",
"objectId": "d89sm4o9723"
}
}