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.
PATCH /{namespace}/ contacts/ {id}Path: id. Body, as JSON: the other inputs. Emits Contact.updated.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Contact. |
email | email | The primary email address. | |
phone | string | The primary phone number. | |
name | string | The name the Contact goes by. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
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"}'{
"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.
DELETE /{namespace}/ contacts/ {id}Path: id. Emits Contact.deleted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Contact. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
contact | Contact | required | The Contact. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
curl -X DELETE https: //api.sb/ leaseline.app/ contacts/ contact_WsrosCQi6J \
-H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"{
"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"
}
}