Generate a template from a URL (coming soon)
POST
/api/v3/letters/templates/actions/generate-from-url
const url = 'https://api.tryletterhead.com/api/v3/letters/templates/actions/generate-from-url';const form = new FormData();form.append('api', 'true');form.append('url', 'https://example.com/newsletter-archive');
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/letters/templates/actions/generate-from-url \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form api=true \ --form url=https://example.com/newsletter-archiveCreates a new, empty newsletter template and dispatches a background job to populate it by fetching an external newsletter archive URL and converting its content into Letterhead blocks with AI.
The response returns immediately with the identifier of the (initially empty) template; the blocks populate asynchronously once the fetch-and-convert job completes.
This endpoint is not yet generally available.
Authorizations
Section titled βAuthorizations βRequest Body required
Section titled βRequest Body required β Media type multipart/form-data
object
api
required
When set to true, this endpoint will accept authorization with your API Key.
string
Example
true url
string
Example
https://example.com/newsletter-archiveResponses
Section titled β Responses βSuccessful response
Still can’t find what you need? Contact support.