Skip to content

V4-Credit-Twilio-Content

This workflow provides a webhook endpoint for creating Twilio Content API templates. It accepts POST requests with template data, forwards them to Twilio's Content API, and returns the response to the caller.

Purpose

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

How It Works

  1. Receive Request: The workflow listens for incoming POST requests at the /twilio-content-create endpoint
  2. Create Template: The request body is forwarded to Twilio's Content API to create a new content template
  3. Return Response: The Twilio API response 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 JSON Response]

Trigger

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

Nodes Used

Node Name Type Purpose
Webhook Webhook Trigger Receives incoming POST requests at the specified endpoint
CreateTemplate HTTP Request Makes authenticated POST request to Twilio Content API
Respond Respond to Webhook Returns the Twilio API response as JSON to the caller

External Services & Credentials Required

Twilio Content API

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

Environment Variables

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

Data Flow

Input

  • Format: JSON via POST request body
  • Content: Twilio Content API template specification
  • Example Structure: The request body should match Twilio's Content API requirements for template creation

Output

  • Format: JSON response
  • Content: Direct response from Twilio Content API
  • Includes: Template creation status, template ID, and any error messages from Twilio

Error Handling

This workflow uses basic error handling: - HTTP request failures will be returned as error responses - Twilio API errors (authentication, validation, etc.) are passed through to the caller - No custom error processing or retry logic is implemented

Known Limitations

  • No input validation is performed on the request body
  • No rate limiting or request throttling
  • Errors from Twilio are passed through without additional context
  • No logging or monitoring of template creation attempts

No related workflows identified.

Setup Instructions

  1. Import Workflow: Import the workflow JSON into your n8n instance

  2. Configure Twilio Credentials:

    • Create a new "HTTP Basic Auth" credential in n8n
    • Name it "Twilio Basic Auth"
    • Username: Your Twilio Account SID
    • Password: Your Twilio Auth Token
  3. Activate Workflow: Enable the workflow to start listening for requests

  4. Test the Endpoint:

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

  5. Verify Setup: Check that the request creates a template in your Twilio Console and returns the expected response