Set or clear a channel's default sender
const url = 'https://api.tryletterhead.com/api/v3/channels/example/default-sender';const form = new FormData();form.append('api', 'true');form.append('senderUniqueId', 'example');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/channels/example/default-sender \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form api=true \ --form senderUniqueId=exampleSet this channel’s default sender (the identity the composer preselects for new newsletters on
this channel), or clear it by omitting senderUniqueId or sending it empty. At most one sender
per channel can be the default.
v3 endpoints expect a company API key.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The newsletter’s channel identifier (slug).
Request Body required
Section titled “Request Body required ”object
When set to true, this endpoint will accept authorization with your API Key.
Example
trueOptional. The uniqueId of a sender already assigned to this channel (see GET /api/v3/channels/{channel}/senders). Omit or send empty to clear the channel’s default sender instead.
Responses
Section titled “ Responses ”The default sender was set (or cleared, when senderUniqueId was empty). No response body.
401 Unauthorized — missing or invalid company API key.
404 Not Found — no channel matches channel for this company.
object
object
object
Example
{ "data": [], "items": [], "message": "Channel not found", "total": 0}422 Unprocessable Entity — senderUniqueId doesn’t match a sender assigned to this channel.
object
object
object
Example
{ "data": [], "items": [], "message": "This sender is not available on this channel.", "total": 0}Still can’t find what you need? Contact support.