Use a starter library template
Copy a starter library entry into your templates, as the library screen's Use button does: the entry is put in your brand (your team name, brand colour…
https://app.usenotix.dev/api/v1/templates/from-libraryNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Copy a starter library entry into your templates, as the library screen's Use button does: the entry is put in your brand (your team name, brand colour and logo), and the copy is yours to change. Give name, subject, previewText or type to change them on the way in; left out, they are the entry's. A MARKETING template always carries an unsubscribe footer. libraryId on the new template records which entry it came from; changes to the library later never touch your copy. Nothing is sent. To start a campaign from it, pass its id to POST /v1/campaigns/from-template; to put it in a journey step, to POST /v1/journeys/{id}/steps/{stepId}/template.
Who can call it
Full access keys, and live AI keys: a copy only ever creates a new template owned by your team, and never changes, renames or deletes an existing one. Templates carry no domain, so a key limited to one domain may too. Read only and send-only keys answer 403 SCOPE_DENIED. Every copy is recorded in the key's audit log (GET /v1/audit-log) with the new template's id and where it came from.
The team can create or copy 60 templates a minute through the API (POST /v1/templates and both copies count together), and 120 template writes a minute counting the dashboard's own, so the dashboard always keeps room. Past either the answer is 429 with Retry-After. When Notix cannot count them the answer is 503 SERVICE_UNAVAILABLE (try again shortly), never a 429.
Body parameters
The library entry to copy, from GET /v1/templates/library.
At most 100 characters.
The new template's name. Defaults to the entry's.
At most 200 characters.
The subject line. Defaults to the entry's.
At most 998 characters.
The inbox preview line. Defaults to the entry's.
At most 255 characters.
TRANSACTIONAL or MARKETING. Defaults to the entry's; a MARKETING template always carries an unsubscribe footer.
One of TRANSACTIONAL, MARKETING.
Headers
Bearer followed by your API key.
Errors
A field the route does not know, or one out of bounds.
`SCOPE_DENIED`: a read only or send-only key.
No library entry with this id.
The team created or copied 60 templates through the API in the last minute, or wrote 120 templates counting the dashboard's own writes.
Notix cannot count the team's calls just now; try again shortly.
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/templates/from-library" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"libraryId": "saas-welcome-setup",
"subject": "Your receipt for order 4471"
}'
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.templates.createFromLibrary({
libraryId: "saas-welcome-setup",
name: "Welcome",
});
{
"id": "cm5t3mplat3id0000",
"name": "Order receipt",
"subject": "Your order {{orderId}}",
"type": "TRANSACTIONAL",
"html": "<p>Thanks for your order.</p>"
}