Flag routes: update, delete
The Flag Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.
Reference for Flag, one group of Flag routes.
Flag.update
Changes the given properties of a Flag. Verb page.
PATCH /{namespace}/ flags/ {id}Path: id. Body, as JSON: the other inputs. Emits Flag.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Flag. |
key | string | The name code reads. | |
rules | json | Who gets which value, including percentage splits. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
flag | Flag | required | The Flag. |
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/ flags/ flag_1YJLhjTlfx \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
-H "Content-Type: application/ json" \
-d '{"key": "new-checkout"}'{
"api": "https: //api.sb/ leaseline.app",
"flag": {
"$id": "https: //api.sb/ leaseline.app/ flags/ flag_1YJLhjTlfx",
"$type": "Flag",
"key": "new-checkout"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Flag.update",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}Flag.delete
Deletes a Flag: a soft delete that keeps its history, undone by Thing.restore. Verb page.
DELETE /{namespace}/ flags/ {id}Path: id. Emits Flag.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Flag. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
flag | Flag | required | The Flag. |
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/ flags/ flag_1YJLhjTlfx \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"api": "https: //api.sb/ leaseline.app",
"flag": {
"$id": "https: //api.sb/ leaseline.app/ flags/ flag_1YJLhjTlfx",
"$type": "Flag",
"key": "new-checkout"
},
"action": {
"$id": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG",
"operation": "Flag.delete",
"status": "done"
},
"links": {
"self": "https: //api.sb/ leaseline.app/ actions/ act_br07HsG8MG"
}
}