Change the code template

Set the team's own template for SMS one-time codes, or send null to go back to the default.

PUThttps://app.usenotix.dev/api/v1/sms/template

Needs a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.

Set the team's own template for SMS one-time codes, or send null to go back to the default. The rules are the SMS page's: an approved sender ID of the team's own (403 FORBIDDEN without one), {code} exactly once, only {code}, {appName} and {minutes}, and at most two SMS segments with the longest values (a 60-character app name, an 8-digit code). The API adds one: no link or web address, since a code message with a link is the common phishing shape; such a template answers 400. Every code the team sends afterwards uses it.

Who can call it

A full access key made by someone who is a team admin today (the team owner always is), as the SMS page lets only admins change it. A key made by a member, or before Notix recorded who made each key, answers 403 FORBIDDEN. Read only, send-only and live AI keys answer 403 SCOPE_DENIED; a key limited to one domain answers 403 DOMAIN_PINNED. Every change is recorded in the key's audit log (GET /v1/audit-log). The team can change it 10 times a minute; when Notix cannot count the changes the answer is 503. A change that holds the database more than 10 seconds answers 422 and changes nothing.

Body parameters

templatestringrequired

The new template, with {code} exactly once and only {code}, {appName} and {minutes}; it must fit in two SMS segments with the longest values and hold no link. null goes back to the default.

At most 640 characters. Can be null.

Headers

Authorizationstringrequired

Bearer followed by your API key.

Errors

400

The template breaks a rule: {code} exactly once, only the three placeholders, two segments at most, no link.

403

`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. `FORBIDDEN`: the key was not made by a team admin, or the team has no approved sender ID of its own.

422

The read took longer than 10 seconds.

429

The team changed the template 10 times in the last minute.

503

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 PUT "https://app.usenotix.dev/api/v1/sms/template" \
  -H "Authorization: Bearer $NOTIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "template": "Your {appName} code is {code}. It expires in {minutes} minutes."
}'
Response200
{
  "template": "string",
  "custom": "string",
  "defaultTemplate": "{appName}: your code is {code}. It expires in {minutes} minutes.",
  "canEdit": true,
  "placeholders": [
    "code",
    "appName",
    "minutes"
  ],
  "maxSegments": 2
}
Open in ClaudeOpen in ChatGPT