Entitlement routes: update, delete
The Entitlement Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.
Reference for Entitlement, one group of Entitlement routes.
Entitlement.update
Changes the given properties of an Entitlement. Verb page.
PATCH /{namespace}/ entitlements/ {id}Path: id. Body, as JSON: the other inputs. Emits Entitlement.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Entitlement. |
verb | Verb | The Verb it grants. | |
limit | Limit | The Limit that bounds it. | |
kind | string | Computed, never set: feature, or limit when a Limit bounds it. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
entitlement | Entitlement | required | The Entitlement. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X PATCH https: //api.sb/ leaseline.app/ entitlements/ ent_7MQACmrzGj \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"verb": "verb_hlkWBvrAyZ"}'{
"api": "https: //api.sb/ leaseline.app",
"entitlement": {
"$id": "https: //api.sb/ leaseline.app/ entitlements/ ent_7MQACmrzGj",
"$type": "Entitlement",
"verb": "verb_hlkWBvrAyZ"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Entitlement.update",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Entitlement.delete
Deletes an Entitlement: a soft delete that keeps its history, undone by Thing.restore. Verb page.
DELETE /{namespace}/ entitlements/ {id}Path: id. Emits Entitlement.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Entitlement. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
entitlement | Entitlement | required | The Entitlement. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X DELETE https: //api.sb/ leaseline.app/ entitlements/ ent_7MQACmrzGj \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"entitlement": {
"$id": "https: //api.sb/ leaseline.app/ entitlements/ ent_7MQACmrzGj",
"$type": "Entitlement",
"verb": "verb_hlkWBvrAyZ"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Entitlement.delete",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}