List newsletter tags
const url = 'https://api.tryletterhead.com/api/v3/letters/tags?api=true&scope=channel';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.tryletterhead.com/api/v3/letters/tags?api=true&scope=channel' \ --header 'Authorization: Bearer <token>'List the tags available for organizing newsletters โ the same tags shown on a letterโs tags
field and in the composerโs tag picker.
Pass scope to control which tags come back:
- Omit
scopeto get the tags currently applied to letters across your company (or one channel, withchannelSlug). This default mode mirrors each tag as a taxonomy term and includes some internal fields alongsideuniqueIdandname. channelโ tags scoped to a single channel (passchannelSlug).companyโ tags scoped to the whole company, not tied to any one channel.pickerโ every tag available to assign, company- and channel-scoped together โ the same list the composerโs tag picker uses.
With scope supplied, each tag comes back in the same compact shape as Create a newsletter
tag โ {uniqueId, name, channelId} โ where channelId identifies whether the tag is scoped to
a specific channel or to the company as a whole.
Authorizations
Section titled โAuthorizations โParameters
Section titled โ Parameters โQuery Parameters
Section titled โQuery Parameters โWhen true, tells the endpoint you are authenticating with a company API key (the key you generate under a companyโs administrative settings) rather than a logged-in user session. For API integrations you will almost always set this to true.
(optional) Restrict results to tags on a specific channel.
(optional) Free-text search across tag names.
(optional) One of channel, company, or picker โ see the description above. Omit for the default โtags currently appliedโ list.
Responses
Section titled โ Responses โList newsletter tags
object
A tag. Shown here are the fields common to both response shapes โ the default (no scope) response also includes a few internal taxonomy fields (id, taxonomyId, parentTermId, createdAt, updatedAt).
object
Present when scope is supplied โ see the description above.
Example
{ "items": [ { "uniqueId": "t4kq9x2mle", "name": "Product updates", "channelId": 999999999 }, { "uniqueId": "b7pz3y1ork", "name": "Community spotlight", "channelId": 54212 } ], "message": "", "total": 2}Still can’t find what you need? Contact support.