Skip to content

Service routes: update, delete

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

Reference for Service, one group of Service routes.

Service.update

Changes the given properties of a Service. Verb page.

Text
PATCH /{namespace}/services/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Service.
namestringThe name of the Product.
promisetextWhat the Customer can rely on.
floorstringThe human floor: none, sign, or practice.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe Service.

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/catalogmend.com/services/service_Eq1ssq4AOW \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"floor":"none"}'
JSON
{
  "api": "https://api.sb/catalogmend.com",
  "service": {
    "$id": "https://api.sb/catalogmend.com/services/service_Eq1ssq4AOW",
    "$type": "Service",
    "name": "Catalogmend",
    "promise": "Every listing error fixed or explained within 48 hours.",
    "status": "draft",
    "floor": "none"
  },
  "action": {
    "$id": "https://api.sb/catalogmend.com/actions/act_ZY4jDpkbtc",
    "operation": "Service.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/catalogmend.com/actions/act_ZY4jDpkbtc"
  }
}

Service.delete

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

Text
DELETE /{namespace}/services/{id}

Path: id. Emits Service.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Service.

Returns

OutputTypeRequiredDescription
serviceServicerequiredThe Service.

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/catalogmend.com/services/service_Eq1ssq4AOW \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/catalogmend.com",
  "service": {
    "$id": "https://api.sb/catalogmend.com/services/service_Eq1ssq4AOW",
    "$type": "Service",
    "name": "Catalogmend",
    "promise": "Every listing error fixed or explained within 48 hours.",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/catalogmend.com/actions/act_ZY4jDpkbtc",
    "operation": "Service.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/catalogmend.com/actions/act_ZY4jDpkbtc"
  }
}