Skip to content

Twilio Content Template Creator

A simple webhook-based workflow that creates content templates in Twilio's Content API. This workflow accepts JSON payloads via HTTP POST and forwards them directly to Twilio for template creation, returning the API response to the caller.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow serves as a bridge between external systems and Twilio's Content API, allowing programmatic creation of message templates for SMS, WhatsApp, or other messaging channels supported by Twilio.

How It Works

  1. Webhook receives request: An external system sends a POST request to the webhook endpoint with template data in the request body
  2. Template creation: The workflow forwards the request body to Twilio's Content API to create a new content template
  3. Response returned: The Twilio API response (including template ID, status, and metadata) is sent back to the original caller

Workflow Diagram

graph TD
    A[Webhook<br/>POST /twilio-content-create] --> B[CreateTemplate<br/>HTTP Request to Twilio]
    B --> C[Respond<br/>Return API Response]

Trigger

  • Type: Webhook
  • Method: POST
  • Path: /twilio-content-create
  • Response Mode: Last node (returns the final response)

Nodes Used

Node Type Purpose
Webhook Webhook Trigger Receives incoming HTTP POST requests with template data
CreateTemplate HTTP Request Makes authenticated POST request to Twilio Content API
Respond Respond to Webhook Returns the Twilio API response to the original caller

External Services & Credentials Required

Twilio Content API

  • Service: Twilio Content API (https://content.twilio.com/v1/Content)
  • Authentication: HTTP Basic Auth
  • Credentials needed:
    • Twilio Account SID (as username)
    • Twilio Auth Token (as password)

Required Credentials in n8n

  • Credential Type: HTTP Basic Auth
  • Name: "Twilio Basic Auth" (or similar)
  • Configuration: Username = Account SID, Password = Auth Token

Environment Variables

No environment variables are used in this workflow. All configuration is handled through n8n credentials.

Data Flow

Input

The webhook expects a JSON payload in the request body containing Twilio Content API parameters. Common fields include:

1
2
3
4
5
6
7
8
9
{
  "friendly_name": "Template Name",
  "language": "en",
  "types": {
    "twilio/text": {
      "body": "Your message content here"
    }
  }
}

Output

Returns the complete Twilio API response, typically including:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
  "sid": "HX...",
  "account_sid": "AC...",
  "friendly_name": "Template Name",
  "language": "en",
  "variables": {},
  "types": {...},
  "url": "https://content.twilio.com/v1/Content/HX...",
  "date_created": "2026-05-13T05:09:31Z",
  "date_updated": "2026-05-13T05:09:31Z"
}

Error Handling

This workflow uses basic error handling through n8n's default mechanisms:

  • HTTP errors: If Twilio returns an error (400, 401, 403, etc.), the workflow will fail and return the error response
  • Network errors: Connection timeouts or network issues will cause workflow failure
  • Authentication errors: Invalid credentials will result in 401 Unauthorized responses

No custom error handling or retry logic is implemented in this workflow.

Known Limitations

  • No input validation is performed on the webhook payload
  • No rate limiting or throttling mechanisms
  • Errors are passed through without transformation or user-friendly messaging
  • No logging or audit trail of template creation requests
  • Single-threaded processing (no batch operations)

No related workflows identified in the current context.

Setup Instructions

1. Import the Workflow

  1. Copy the workflow JSON
  2. In n8n, go to Workflows → Import from JSON
  3. Paste the JSON and save

2. Configure Twilio Credentials

  1. Go to Credentials in n8n
  2. Create new credential of type "HTTP Basic Auth"
  3. Set name as "Twilio Basic Auth"
  4. Username: Your Twilio Account SID (starts with AC...)
  5. Password: Your Twilio Auth Token
  6. Save the credential

3. Activate the Workflow

  1. Open the imported workflow
  2. Click "Active" toggle to enable it
  3. Note the webhook URL from the Webhook node

4. Test the Setup

Send a POST request to the webhook URL:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl -X POST https://your-n8n-instance.com/webhook/twilio-content-create \
  -H "Content-Type: application/json" \
  -d '{
    "friendly_name": "Test Template",
    "language": "en",
    "types": {
      "twilio/text": {
        "body": "Hello, this is a test message!"
      }
    }
  }'

5. Verify in Twilio Console

Check your Twilio Console under Messaging → Content Templates to confirm the template was created successfully.