Skip to content

Play routes: update, delete

The Play Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Play, one group of Play routes.

Play.update

Changes the given properties of a Play. Verb page.

Text
PATCH /{namespace}/plays/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Play.
familystringThe job it does, such as demand, retention, or pricing.
costmoneyWhat one run costs.
cohortjsonThe Portfolio query a Studio rolls it out to.
fromstringLineage: the slot it compiles from, as Hypothesis#<slot>@v<version>.

Returns

OutputTypeRequiredDescription
playPlayrequiredThe Play.

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/plays/play_hr4WTcrAyZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"family":"demand"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "play": {
    "$id": "https://api.sb/leaseline.app/plays/play_hr4WTcrAyZ",
    "$type": "Play",
    "family": "demand"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Play.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Play.delete

Deletes a Play: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/plays/{id}

Path: id. Emits Play.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Play.

Returns

OutputTypeRequiredDescription
playPlayrequiredThe Play.

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/plays/play_hr4WTcrAyZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "play": {
    "$id": "https://api.sb/leaseline.app/plays/play_hr4WTcrAyZ",
    "$type": "Play",
    "family": "demand"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Play.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}