Skip to content

Relationship routes: update, delete

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

Reference for Relationship, one group of Relationship routes.

Relationship.update

Changes the given properties of a Relationship. Verb page.

Text
PATCH /{namespace}/relationships/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Relationship.
predicatestringThe name read from the source, such as makes.
inversestringThe name read from the target, such as madeBy.
provenancestringWho asserted it: Stated, Ratified, Inferred, or Observed.

Returns

OutputTypeRequiredDescription
relationshipRelationshiprequiredThe Relationship.

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/relationships/relationship_iUVcHztTJh \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provenance":"Stated"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "relationship": {
    "$id": "https://api.sb/leaseline.app/relationships/relationship_iUVcHztTJh",
    "$type": "Relationship",
    "predicate": "Example predicate",
    "inverse": "Example inverse",
    "provenance": "Stated"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Relationship.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Relationship.delete

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

Text
DELETE /{namespace}/relationships/{id}

Path: id. Emits Relationship.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Relationship.

Returns

OutputTypeRequiredDescription
relationshipRelationshiprequiredThe Relationship.

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/relationships/relationship_iUVcHztTJh \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "relationship": {
    "$id": "https://api.sb/leaseline.app/relationships/relationship_iUVcHztTJh",
    "$type": "Relationship",
    "predicate": "Example predicate",
    "inverse": "Example inverse"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Relationship.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}