Skip to content

Channel routes: update, delete

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

Reference for Channel, one group of Channel routes.

Channel.update

Changes the given properties of a Channel. Verb page.

Text
PATCH /{namespace}/channels/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Channel.
mediumstringThe platform type, such as email, sms, or chat.
organizationOrganizationThe outside Organization the Channel is shared with; its new Messages open Conversations for that Customer.
externalbooleanTrue when people from another Organization post in it, as in a channel two companies share.
areaCodestringFor an sms Channel, the phone area code its number is drawn from, such as 512.
numberstringFor an sms Channel, its phone number in international form, assigned when it is created.

Returns

OutputTypeRequiredDescription
channelChannelrequiredThe Channel.

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/channels/channel_EQ8se34AOW \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"medium":"email"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "channel": {
    "$id": "https://api.sb/leaseline.app/channels/channel_EQ8se34AOW",
    "$type": "Channel",
    "medium": "email"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Channel.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Channel.delete

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

Text
DELETE /{namespace}/channels/{id}

Path: id. Emits Channel.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Channel.

Returns

OutputTypeRequiredDescription
channelChannelrequiredThe Channel.

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/channels/channel_EQ8se34AOW \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "channel": {
    "$id": "https://api.sb/leaseline.app/channels/channel_EQ8se34AOW",
    "$type": "Channel",
    "medium": "email"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Channel.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}