Skip to content

Person routes: update, delete

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

Reference for Person, one group of Person routes.

Person.update

Changes the given properties of a Person. Verb page.

Text
PATCH /{namespace}/people/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Person.
namestringThe legal or personal name.
verifiedbooleanTrue once the identity is verified.

Returns

OutputTypeRequiredDescription
personPersonrequiredThe Person.

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/people/person_sLqbXbW683 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"verified":true}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "person": {
    "$id": "https://api.sb/leaseline.app/people/person_sLqbXbW683",
    "$type": "Person",
    "name": "Dana Okafor",
    "verified": true
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Person.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Person.delete

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

Text
DELETE /{namespace}/people/{id}

Path: id. Emits Person.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Person.

Returns

OutputTypeRequiredDescription
personPersonrequiredThe Person.

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/people/person_sLqbXbW683 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "person": {
    "$id": "https://api.sb/leaseline.app/people/person_sLqbXbW683",
    "$type": "Person",
    "name": "Dana Okafor"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Person.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}