twilio-content-template-builder — скилл для Codex: шаблоны Twilio
Создаёт и отправляет шаблоны сообщений через Twilio Content API: WhatsApp, SMS, RCS и MMS с переменными и одобрением Meta.
npx skills add openai/plugins --skill twilio-content-template-builder -a codexЧто делает twilio-content-template-builder
Скилл ведёт агента по Content API: шаблон получает идентификатор ContentSid вида HX..., а отправка идёт через content_sid и content_variables. Поддерживаются типы twilio/text, twilio/media, twilio/quick-reply, twilio/call-to-action, twilio/list-picker, twilio/card и twilio/carousel — каждый со своим набором каналов.
Внутри есть готовые вызовы на Python и Node.js: создание шаблона, отправка, заявка на одобрение, проверка статуса, список и удаление. Переменные нумеруются подряд, {{1}}, {{2}}, пропускать нельзя, максимум 100 на шаблон, а соотношение постоянного текста к переменным должно быть не меньше (2x + 1) : x.
Для работы нужен аккаунт Twilio, переменные окружения TWILIO_ACCOUNT_SID и TWILIO_AUTH_TOKEN, а также SDK: pip install twilio или npm install twilio. Для шаблонов WhatsApp понадобится активный отправитель. Учтите: без одобрения Meta шаблон WhatsApp не отправить вне 24-часового окна, а отклонённый шаблон нельзя подать повторно под тем же именем — придётся брать другое.
Какие задачи решает
- создать шаблон сообщения с переменными через Content API
- отправить WhatsApp-сообщение по
ContentSid - подать шаблон на одобрение Meta и отследить статус
- выбрать тип контента под нужный канал
- добавить текстовый фолбэк для RCS-шаблона
Примеры запросов агенту
- Создай шаблон appointment-reminder с переменными {{1}}, {{2}} и {{3}} и покажи ContentSid
- Отправь этот шаблон на whatsapp:+15558675310, подставив имя Sarah
- Подай шаблон на одобрение в категории UTILITY и проверь статус
Как установить twilio-content-template-builder
1Через Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-content-template-builder -a codex2Вручную: положить файлы
.agents/skills/twilio-content-template-builder/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-content-template-builder -a claude-code2Вручную: положить файлы
~/.claude/skills/twilio-content-template-builder/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/twilio-content-template-builder/
Вручную: положить файлы
.cursor/skills/twilio-content-template-builder/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install openai/plugins twilio-content-template-builder2Вручную: положить файлы
.github/skills/twilio-content-template-builder/SKILL.mdКомандой платформы
gemini skills install https://github.com/openai/plugins --path plugins/twilio-developer-kit/skills/twilio-content-template-builderВручную: положить файлы
.devin/skills/twilio-content-template-builder/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Скиллы Codex: как установить, где лежат и как вызвать
Вопросы о twilio-content-template-builder
Как установить twilio-content-template-builder в Codex?
Выполните npx skills add openai/plugins --skill twilio-content-template-builder -a codex, затем проверьте файл .agents/skills/twilio-content-template-builder/SKILL.md.
Что делает twilio-content-template-builder?
Помогает агенту создавать, отправлять и удалять шаблоны через Twilio Content API, включая заявку на одобрение Meta для WhatsApp и проверку её статуса.
Что нужно для работы скилла?
Аккаунт Twilio, переменные окружения TWILIO_ACCOUNT_SID и TWILIO_AUTH_TOKEN и SDK: pip install twilio или npm install twilio. Для шаблонов WhatsApp нужен активный отправитель.
Исходный текст
SKILL.md · MIT
---
name: twilio-content-template-builder
description: >
Create, manage, and send message templates using Twilio's Content API.
Covers template creation for WhatsApp, SMS, RCS, and MMS; variable usage;
WhatsApp Meta approval; and sending templates via ContentSid. Use this skill
when building structured messages that require pre-approval or consistent
formatting across channels.
---
## Overview
The Content API creates channel-agnostic templates identified by a `ContentSid` (`HX...`). WhatsApp templates must be approved by Meta before use outside the 24-hour service window.
---
## Prerequisites
- Twilio account — New to Twilio? See `twilio-account-setup`
- For WhatsApp templates: active WhatsApp sender
— See `twilio-whatsapp-send-message` (sandbox) or `twilio-whatsapp-manage-senders` (production)
- Environment variables:
- `TWILIO_ACCOUNT_SID`
- `TWILIO_AUTH_TOKEN`
— See `twilio-iam-auth-setup` for credential setup and best practices
- SDK: `pip install twilio` / `npm install twilio`
---
## Quickstart
**Step 1 — Create a template via Console** (simplest)
Console > Messaging > Content Template Builder > Create new. Use `{{1}}`, `{{2}}` for variables. Save to get a `ContentSid`.
**Step 2 — Send the template**
**Python**
```python
import os
from twilio.rest import Client
client = Client(os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"])
message = client.messages.create(
from_="whatsapp:+14155238886",
to="whatsapp:+15558675310",
content_sid="HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
content_variables='{"1": "Sarah", "2": "March 28", "3": "10:00 AM"}'
)
print(message.sid)
```
**Node.js**
```node
const twilio = require("twilio");
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
const message = await client.messages.create({
from: "whatsapp:+14155238886",
to: "whatsapp:+15558675310",
contentSid: "HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
contentVariables: JSON.stringify({ "1": "Sarah", "2": "March 28", "3": "10:00 AM" }),
});
```
---
## Key Patterns
### Create a Template via API
**Python**
```python
template = client.content.v1.contents.create(
friendly_name="appointment-reminder",
language="en",
types={
"twilio/text": {
"body": "Hi {{1}}, your appointment is on {{2}} at {{3}}. Reply YES to confirm."
}
}
)
print(template.sid) # HXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```
**Node.js**
```node
const template = await client.content.v1.contents.create({
friendlyName: "appointment-reminder",
language: "en",
types: {
"twilio/text": {
body: "Hi {{1}}, your appointment is on {{2}} at {{3}}. Reply YES to confirm.",
},
},
});
console.log(template.sid);
```
### Submit for WhatsApp Approval
**Python**
```python
approval = client.content.v1 \
.contents(template.sid) \
.approval_requests \
.create(name="appointment-reminder", category="UTILITY")
print(approval.status) # PENDING
```
**Node.js**
```node
const approval = await client.content.v1
.contents(templateSid)
.approvalRequests.create({ name: "appointment-reminder", category: "UTILITY" });
console.log(approval.status);
```
Categories: `UTILITY`, `MARKETING`, `AUTHENTICATION`
### Check Approval Status
**Python**
```python
content = client.content.v1.contents(template.sid).fetch()
print(content.approval_requests.status) # APPROVED | REJECTED | PENDING
```
**Node.js**
```node
const content = await client.content.v1.contents(templateSid).fetch();
console.log(content.approvalRequests.status);
```
Approval typically takes under 1 hour.
### List and Delete Templates
**Python**
```python
for template in client.content.v1.contents.list():
print(template.sid, template.friendly_name, template.language)
client.content.v1.contents("HXxxxxxxxxxx").delete()
```
**Node.js**
```node
const templates = await client.content.v1.contents.list();
templates.forEach(t => console.log(t.sid, t.friendlyName, t.language));
await client.content.v1.contents("HXxxxxxxxxxx").remove();
```
### Supported Content Types
| Type | `types` key | Channels |
|------|------------|---------|
| Plain text | `twilio/text` | All |
| Media (image, video) | `twilio/media` | WhatsApp, MMS, RCS |
| Quick reply buttons | `twilio/quick-reply` | WhatsApp, RCS |
| Call-to-action buttons | `twilio/call-to-action` | WhatsApp, RCS |
| List picker | `twilio/list-picker` | WhatsApp |
| Card | `twilio/card` | RCS |
| Carousel | `twilio/carousel` | RCS |
### RCS Fallback Text
When sending a rich RCS template (card, carousel, quick reply) via a Messaging Service with SMS fallback configured, Twilio uses the template's `twilio/text` body as the SMS fallback copy. Any template intended for RCS should include a `twilio/text` entry so recipients on non-RCS devices still receive a readable message.
---
## Variable Rules
- Use `{{1}}`, `{{2}}` — sequential, no skipping
- Max 100 variables per template
- Provide sample values for WhatsApp submissions
- Non-variable to variable ratio must be at least `(2x + 1) : x`
---
## CANNOT
- **Cannot use WhatsApp templates without Meta approval** — Plan for up to 24 hours review time
- **Cannot resubmit a rejected template with the same name** — Use a different name for resubmission
- **Cannot include custom variables in AUTHENTICATION templates** — Fixed format required by Meta
---
## Next Steps
- **Channel overview and onboarding guide:** `twilio-messaging-overview`
- **Send WhatsApp messages:** `twilio-whatsapp-send-message`
- **Register a production WhatsApp sender:** `twilio-whatsapp-manage-senders`
© Twilio · MIT · openai/plugins