Skip to content

Newsletter routes: update, delete

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

Reference for Newsletter, one group of Newsletter routes.

Newsletter.update

Changes the given properties of a Newsletter. Verb page.

Text
PATCH /{namespace}/newsletters/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Newsletter.
namestringWhat subscribers see it called.
fromMailboxThe broadcast Mailbox each issue sends from.
topicstringThe topic a Contact subscribes to, recorded with their Consent.
offerOfferThe Offer whose Subscription unlocks paid issues and the archive.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.

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/newsletters/newsletter_FLjN3aQujc \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Leaseline notes"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "newsletter": {
    "$id": "https://api.sb/leaseline.app/newsletters/newsletter_FLjN3aQujc",
    "$type": "Newsletter",
    "name": "Leaseline notes",
    "from": "mailbox_93HvOnR17L"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Newsletter.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Newsletter.delete

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

Text
DELETE /{namespace}/newsletters/{id}

Path: id. Emits Newsletter.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Newsletter.

Returns

OutputTypeRequiredDescription
newsletterNewsletterrequiredThe Newsletter.

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/newsletters/newsletter_FLjN3aQujc \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "newsletter": {
    "$id": "https://api.sb/leaseline.app/newsletters/newsletter_FLjN3aQujc",
    "$type": "Newsletter",
    "name": "Leaseline notes",
    "from": "mailbox_93HvOnR17L"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Newsletter.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}