Skip to content
APIProductBuild and shipFlag

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.

Text
PATCH /{namespace}/flags/{id}

Path: id. Body, as JSON: the other inputs. Emits Flag.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Flag.
keystringThe name code reads.
rulesjsonWho gets which value, including percentage splits.

Returns

OutputTypeRequiredDescription
flagFlagrequiredThe Flag.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
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"}'
JSON
{
  "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.

Text
DELETE /{namespace}/flags/{id}

Path: id. Emits Flag.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Flag.

Returns

OutputTypeRequiredDescription
flagFlagrequiredThe Flag.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/flags/flag_1YJLhjTlfx \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "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"
  }
}