Skip to content

Lead routes: update, delete

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

Reference for Lead, one group of Lead routes.

Lead.update

Changes the given properties of a Lead. Verb page.

Text
PATCH /{namespace}/leads/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Lead.
emailemailThe primary email address.
phonestringThe primary phone number.
namestringThe name the Contact goes by.
interesttextWhat the Lead asked for.
ownerWorkerThe Worker who answers it.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead.

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/leads/lead_Kz1R9fhqzZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"owner":"worker_whZFpOKWIV"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "lead": {
    "$id": "https://api.sb/leaseline.app/leads/lead_Kz1R9fhqzZ",
    "$type": "Lead",
    "status": "new",
    "owner": "worker_whZFpOKWIV"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Lead.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Lead.delete

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

Text
DELETE /{namespace}/leads/{id}

Path: id. Emits Lead.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Lead.

Returns

OutputTypeRequiredDescription
leadLeadrequiredThe Lead.

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/leads/lead_Kz1R9fhqzZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "lead": {
    "$id": "https://api.sb/leaseline.app/leads/lead_Kz1R9fhqzZ",
    "$type": "Lead",
    "status": "new"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Lead.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}