Skip to content

Contact routes: update, delete

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

Reference for Contact, one group of Contact routes.

Contact.update

Changes the given properties of a Contact. Verb page.

Text
PATCH /{namespace}/contacts/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Contact.
emailemailThe primary email address.
phonestringThe primary phone number.
namestringThe name the Contact goes by.

Returns

OutputTypeRequiredDescription
contactContactrequiredThe Contact.

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/contacts/contact_WsrosCQi6J \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"dana@leaseline.app"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "contact": {
    "$id": "https://api.sb/leaseline.app/contacts/contact_WsrosCQi6J",
    "$type": "Contact",
    "email": "dana@leaseline.app",
    "phone": "Example phone"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Contact.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Contact.delete

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

Text
DELETE /{namespace}/contacts/{id}

Path: id. Emits Contact.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Contact.

Returns

OutputTypeRequiredDescription
contactContactrequiredThe Contact.

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/contacts/contact_WsrosCQi6J \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "contact": {
    "$id": "https://api.sb/leaseline.app/contacts/contact_WsrosCQi6J",
    "$type": "Contact",
    "email": "marcus@riversideproperty.com",
    "phone": "Example phone"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Contact.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}