Get the code template
The text SMS one-time codes are sent with: template is the one in use, custom the team's own (null while the default is used).
https://app.usenotix.dev/api/v1/sms/templateFull access and read only keys can call this. Sending access keys cannot. Key permissions lists the extra rules some calls have.
The text SMS one-time codes are sent with: template is the one in use, custom the team's own (null while the default is used). Placeholders: {code}, {appName} and {minutes}. canEdit is true once the team has an approved sender ID of its own, which a custom template needs.
Who can call it
Full access and read only keys. Send-only and live AI keys answer 403 SCOPE_DENIED; a key limited to one domain answers 403 DOMAIN_PINNED, as on every SMS and one-time code route.
The team can make 60 of these reads a minute; when Notix cannot count them the answer is 503 SERVICE_UNAVAILABLE (try again shortly), never a 429. Each read holds the database at most 10 seconds and answers 422 past that.
Headers
Bearer followed by your API key.
Errors
`SCOPE_DENIED`: a send-only or live AI key (or a read only key on the change). `DOMAIN_PINNED`: a key limited to one domain.
The read took longer than 10 seconds.
The team made 60 SMS and code reads in the last minute.
The rate counters or the database cannot be used just now; try again shortly.
Every error has the same shape. See all error codes.
curl -X GET "https://app.usenotix.dev/api/v1/sms/template" \
-H "Authorization: Bearer $NOTIX_API_KEY"
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.sms.template();
console.log(data?.template);
{
"template": "string",
"custom": "string",
"defaultTemplate": "{appName}: your code is {code}. It expires in {minutes} minutes.",
"canEdit": true,
"placeholders": [
"code",
"appName",
"minutes"
],
"maxSegments": 2
}