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