[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHYKZ2PB4S9JYP1FVN02F5":3,"skill-same:01M7CHYKZ2PB4S9JYP1FVN02F5":51},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CHYKZ2PB4S9JYP1FVN02F5","twilio-conversations-classic-api",null,"Build multi-channel messaging experiences using Twilio Conversations (classic) API. Covers creating conversations, adding participants (SMS, WhatsApp, chat), sending messages, and handling webhooks. Use this skill to manage persistent multi-party or multi-channel conversations beyond single-message SMS\u002FWhatsApp.","rossboyd\u002Fquickque","rossboyd","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3195729?v=4","01M7CG99NTNRFV0TWTZX9JY9CQ","rbyd","01M7CG99PH4WEP5P45VTBNPDB0",0,"MIT","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftwilio-developer-kit\u002Fskills\u002Ftwilio-conversations-classic-api\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: twilio-conversations-classic-api\ndescription: >\n  Build multi-channel messaging experiences using Twilio Conversations (classic) API.\n  Covers creating conversations, adding participants (SMS, WhatsApp, chat),\n  sending messages, and handling webhooks. Use this skill to manage persistent\n  multi-party or multi-channel conversations beyond single-message SMS\u002FWhatsApp.\n---\n\n## Overview\n\nConversations (classic) API provides persistent, multi-channel threads where participants on SMS, WhatsApp, and web chat can message together. Unlike single-message APIs, Conversations maintains history and supports multi-agent access.\n\n**Note:** This is the Conversations (classic) API (v1).\n\n---\n\n## Prerequisites\n\n- Twilio account with Conversations (classic) enabled\n  — New to Twilio? See `twilio-account-setup`\n  — Enable at: [Console > Conversations > Manage > Overview](https:\u002F\u002Fconsole.twilio.com\u002Fus1\u002Fdevelop\u002Fconversations\u002Fmanage\u002Foverview) > **Enable Conversations**\n- Environment variables:\n  - `TWILIO_ACCOUNT_SID`\n  - `TWILIO_AUTH_TOKEN`\n  — See `twilio-iam-auth-setup` for credential setup and best practices\n- SDK: `pip install twilio` \u002F `npm install twilio`\n- For SMS\u002FWhatsApp participants: a Twilio number assigned to a Conversations Service\n\n---\n\n## Setup: Create a Conversation Service (classic)\n\nA Conversation Service is the parent configuration container for all your conversations in the classic API. You need one before creating conversations with SMS\u002FWhatsApp participants.\n\n**Python**\n```python\nimport os\nfrom twilio.rest import Client\n\nclient = Client(os.environ[\"TWILIO_ACCOUNT_SID\"], os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n# Create a Conversation Service\nservice = client.conversations.v1.services.create(\n    friendly_name=\"Customer Support Service\"\n)\nprint(f\"Service SID: {service.sid}\")\n```\n\n**Node.js**\n```node\nconst twilio = require(\"twilio\");\nconst client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);\n\n\u002F\u002F Create a Conversation Service\nconst service = await client.conversations.v1.services.create({\n    friendlyName: \"Customer Support Service\"\n});\nconsole.log(`Service SID: ${service.sid}`);\n```\n\n**Next:** Assign your Twilio phone number to this service at [Console > Conversations > Manage > Services](https:\u002F\u002Fconsole.twilio.com\u002Fus1\u002Fdevelop\u002Fconversations\u002Fmanage\u002Fservices) > Select your service > Add phone number.\n\n---\n\n## Quickstart\n\n**Python**\n```python\nimport os\nfrom twilio.rest import Client\n\nclient = Client(os.environ[\"TWILIO_ACCOUNT_SID\"], os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n# Create a conversation (use default service or specify service_sid)\nconversation = client.conversations.v1.conversations.create(\n    friendly_name=\"Customer Support - Order #12345\"\n)\n\n# Add an SMS participant\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"+15558675310\",\n        messaging_binding_proxy_address=\"+15017122661\"\n    )\n\n# Send a message\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(body=\"Hello! How can I help you today?\", author=\"support-agent\")\n```\n\n**Node.js**\n```node\nconst twilio = require(\"twilio\");\nconst client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);\n\n\u002F\u002F Create a conversation (use default service or specify serviceSid)\nconst conversation = await client.conversations.v1.conversations.create({\n    friendlyName: \"Customer Support - Order #12345\",\n});\n\n\u002F\u002F Add an SMS participant\nawait client.conversations.v1\n    .conversations(conversation.sid)\n    .participants.create({\n        messagingBindingAddress: \"+15558675310\",\n        messagingBindingProxyAddress: \"+15017122661\",\n    });\n\n\u002F\u002F Send a message\nawait client.conversations.v1\n    .conversations(conversation.sid)\n    .messages.create({ body: \"Hello! How can I help you today?\", author: \"support-agent\" });\n```\n\n---\n\n## Key Patterns\n\n### Add Participants by Channel\n\n**WhatsApp participant — Python**\n```python\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"whatsapp:+15558675310\",\n        messaging_binding_proxy_address=\"whatsapp:+14155238886\"\n    )\n```\n\n**WhatsApp participant — Node.js**\n```node\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({\n        messagingBindingAddress: \"whatsapp:+15558675310\",\n        messagingBindingProxyAddress: \"whatsapp:+14155238886\",\n    });\n```\n\n**Chat participant (web\u002Fmobile) — Python**\n```python\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(identity=\"user-123\")\n```\n\n**Chat participant (web\u002Fmobile) — Node.js**\n```node\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({ identity: \"user-123\" });\n```\n\n### Send Media (All Channels)\n\n**Python**\n```python\n# Send a message with media\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(\n        body=\"Check out this image!\",\n        author=\"support-agent\",\n        media_url=\"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n    )\n\n# Multiple media URLs (up to 10)\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(\n        body=\"Here are the documents\",\n        author=\"support-agent\",\n        media_url=[\n            \"https:\u002F\u002Fexample.com\u002Fdoc1.pdf\",\n            \"https:\u002F\u002Fexample.com\u002Fdoc2.pdf\"\n        ]\n    )\n```\n\n**Node.js**\n```node\n\u002F\u002F Send a message with media\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .messages.create({\n        body: \"Check out this image!\",\n        author: \"support-agent\",\n        mediaUrl: \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n    });\n\n\u002F\u002F Multiple media URLs (up to 10)\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .messages.create({\n        body: \"Here are the documents\",\n        author: \"support-agent\",\n        mediaUrl: [\n            \"https:\u002F\u002Fexample.com\u002Fdoc1.pdf\",\n            \"https:\u002F\u002Fexample.com\u002Fdoc2.pdf\"\n        ]\n    });\n```\n\nMedia must be publicly accessible URLs. Supported: JPG, PNG, GIF, PDF, vCard. Max 10 URLs per message. Works across all channels: SMS (as MMS), WhatsApp, and chat participants all receive media.\n\n### Add Multiple Participants\n\n**Python**\n```python\n# Add multiple SMS participants to a conversation\nparticipant_numbers = [\n    \"+15558675310\",\n    \"+15558675311\",\n    \"+15558675312\"\n]\n\ntwilio_number = \"+15017122661\"\n\nfor phone_number in participant_numbers:\n    client.conversations.v1 \\\n        .conversations(conversation.sid) \\\n        .participants \\\n        .create(\n            messaging_binding_address=phone_number,\n            messaging_binding_proxy_address=twilio_number\n        )\n```\n\n**Node.js**\n```node\n\u002F\u002F Add multiple SMS participants to a conversation\nconst participantNumbers = [\n    \"+15558675310\",\n    \"+15558675311\",\n    \"+15558675312\"\n];\n\nconst twilioNumber = \"+15017122661\";\n\nfor (const phoneNumber of participantNumbers) {\n    await client.conversations.v1\n        .conversations(conversationSid)\n        .participants.create({\n            messagingBindingAddress: phoneNumber,\n            messagingBindingProxyAddress: twilioNumber\n        });\n}\n```\n\n### Fetch Message History\n\n**Python**\n```python\n# Get all messages from a conversation\nmessages = client.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .list(limit=50)\n\nfor message in messages:\n    print(f\"{message.author}: {message.body}\")\n```\n\n**Node.js**\n```node\n\u002F\u002F Get all messages from a conversation\nconst messages = await client.conversations.v1\n    .conversations(conversationSid)\n    .messages\n    .list({ limit: 50 });\n\nmessages.forEach(message => {\n    console.log(`${message.author}: ${message.body}`);\n});\n```\n\n### List Conversations\n\n**Python**\n```python\n# List all conversations\nconversations = client.conversations.v1.conversations.list(limit=20)\n\nfor conv in conversations:\n    print(f\"{conv.friendly_name} - {conv.sid}\")\n\n# Filter by state\nactive_conversations = client.conversations.v1.conversations.list(\n    state=\"active\",\n    limit=20\n)\n```\n\n**Node.js**\n```node\n\u002F\u002F List all conversations\nconst conversations = await client.conversations.v1.conversations.list({ limit: 20 });\n\nconversations.forEach(conv => {\n    console.log(`${conv.friendlyName} - ${conv.sid}`);\n});\n\n\u002F\u002F Filter by state\nconst activeConversations = await client.conversations.v1.conversations.list({\n    state: \"active\",\n    limit: 20\n});\n```\n\n### Remove Participants\n\n**Python**\n```python\n# Remove a participant by participant SID\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants(participant_sid) \\\n    .delete()\n\n# Find and remove by phone number\nparticipants = client.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .list()\n\nfor p in participants:\n    if p.messaging_binding and p.messaging_binding.get(\"address\") == \"+15558675310\":\n        client.conversations.v1 \\\n            .conversations(conversation.sid) \\\n            .participants(p.sid) \\\n            .delete()\n```\n\n**Node.js**\n```node\n\u002F\u002F Remove a participant by participant SID\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants(participantSid)\n    .remove();\n\n\u002F\u002F Find and remove by phone number\nconst participants = await client.conversations.v1\n    .conversations(conversationSid)\n    .participants\n    .list();\n\nfor (const p of participants) {\n    if (p.messagingBinding?.address === \"+15558675310\") {\n        await client.conversations.v1\n            .conversations(conversationSid)\n            .participants(p.sid)\n            .remove();\n    }\n}\n```\n\n### Close\u002FComplete Conversations\n\n**Python**\n```python\n# Close a conversation (marks it inactive)\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .update(state=\"closed\")\n\n# Delete a conversation completely\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .delete()\n```\n\n**Node.js**\n```node\n\u002F\u002F Close a conversation (marks it inactive)\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .update({ state: \"closed\" });\n\n\u002F\u002F Delete a conversation completely\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .remove();\n```\n\n### Handle Incoming Messages (Webhook)\n\nConfigure at Console > Conversations > Manage > Global Webhooks.\n\n> **Security:** Always validate the `X-Twilio-Signature` header in production to confirm requests originate from Twilio. See `twilio-webhook-architecture` for validation patterns.\n\n**Python (Flask)**\n```python\nfrom twilio.request_validator import RequestValidator\n\n@app.route(\"\u002Fconversations\u002Fwebhook\", methods=[\"POST\"])\ndef conversations_webhook():\n    validator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\n    if not validator.validate(request.url, request.form, request.headers.get(\"X-Twilio-Signature\", \"\")):\n        return \"\", 403\n\n    event_type = request.form.get(\"EventType\")\n    conversation_sid = request.form.get(\"ConversationSid\")\n    author = request.form.get(\"Author\")\n\n    if event_type == \"onMessageAdded\" and author != \"support-agent\":\n        client.conversations.v1.conversations(conversation_sid).messages.create(\n            body=\"Thanks — an agent will be with you shortly.\",\n            author=\"support-bot\"\n        )\n    return \"\", 204\n```\n\n**Node.js (Express)**\n```node\napp.post(\"\u002Fconversations\u002Fwebhook\", async (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n\n    const { EventType, ConversationSid, Author } = req.body;\n    if (EventType === \"onMessageAdded\" && Author !== \"support-agent\") {\n        await client.conversations.v1\n            .conversations(ConversationSid)\n            .messages.create({ body: \"Thanks — an agent will be with you shortly.\", author: \"support-bot\" });\n    }\n    res.sendStatus(204);\n});\n```\n\n---\n\n## Advanced Context\n\n### Message Delivery Status\n\nTrack message delivery through webhooks. Configure at Console > Conversations > Manage > Global Webhooks.\n\n**Available delivery events:**\n- `onMessageAdded` — Message created\n- `onMessageUpdated` — Message status changed\n- `onDeliveryUpdated` — Delivery receipt received (SMS\u002FWhatsApp only)\n\n**Python (Flask)**\n```python\n@app.route(\"\u002Fconversations\u002Fwebhook\", methods=[\"POST\"])\ndef delivery_webhook():\n    event_type = request.form.get(\"EventType\")\n    \n    if event_type == \"onDeliveryUpdated\":\n        delivery_status = request.form.get(\"DeliveryStatus\")\n        message_sid = request.form.get(\"MessageSid\")\n        print(f\"Message {message_sid}: {delivery_status}\")\n        # Status values: sent, delivered, failed, undelivered\n    \n    return \"\", 204\n```\n\n**Node.js (Express)**\n```node\napp.post(\"\u002Fconversations\u002Fwebhook\", (req, res) => {\n    const { EventType, DeliveryStatus, MessageSid } = req.body;\n    \n    if (EventType === \"onDeliveryUpdated\") {\n        console.log(`Message ${MessageSid}: ${DeliveryStatus}`);\n        \u002F\u002F Status values: sent, delivered, failed, undelivered\n    }\n    \n    res.sendStatus(204);\n});\n```\n\n### Conversation Attributes (Metadata)\n\nStore custom metadata on conversations (order IDs, customer info, tags).\n\n**Python**\n```python\n# Set attributes when creating\nconversation = client.conversations.v1.conversations.create(\n    friendly_name=\"Customer Support - Order #12345\",\n    attributes='{\"order_id\": \"12345\", \"priority\": \"high\", \"customer_tier\": \"gold\"}'\n)\n\n# Update attributes on existing conversation\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .update(attributes='{\"order_id\": \"12345\", \"status\": \"resolved\"}')\n\n# Read attributes\nconv = client.conversations.v1.conversations(conversation.sid).fetch()\nimport json\nattrs = json.loads(conv.attributes)\nprint(f\"Order ID: {attrs['order_id']}\")\n```\n\n**Node.js**\n```node\n\u002F\u002F Set attributes when creating\nconst conversation = await client.conversations.v1.conversations.create({\n    friendlyName: \"Customer Support - Order #12345\",\n    attributes: JSON.stringify({ orderId: \"12345\", priority: \"high\", customerTier: \"gold\" })\n});\n\n\u002F\u002F Update attributes on existing conversation\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .update({ attributes: JSON.stringify({ orderId: \"12345\", status: \"resolved\" }) });\n\n\u002F\u002F Read attributes\nconst conv = await client.conversations.v1.conversations(conversationSid).fetch();\nconst attrs = JSON.parse(conv.attributes);\nconsole.log(`Order ID: ${attrs.orderId}`);\n```\n\n### Participant Attributes (Metadata)\n\nStore metadata on individual participants (role, name, account info).\n\n**Python**\n```python\n# Set attributes when adding participant\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"+15558675310\",\n        messaging_binding_proxy_address=\"+15017122661\",\n        attributes='{\"name\": \"John Doe\", \"role\": \"customer\", \"account_id\": \"A123\"}'\n    )\n\n# Update participant attributes\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants(participant_sid) \\\n    .update(attributes='{\"role\": \"vip_customer\", \"satisfaction\": \"high\"}')\n```\n\n**Node.js**\n```node\n\u002F\u002F Set attributes when adding participant\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({\n        messagingBindingAddress: \"+15558675310\",\n        messagingBindingProxyAddress: \"+15017122661\",\n        attributes: JSON.stringify({ name: \"John Doe\", role: \"customer\", accountId: \"A123\" })\n    });\n\n\u002F\u002F Update participant attributes\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants(participantSid)\n    .update({ attributes: JSON.stringify({ role: \"vip_customer\", satisfaction: \"high\" }) });\n```\n\n---\n\n## Limits\n\n| Limit | Value |\n|-------|-------|\n| Participants per conversation | 1,000 |\n| Messages per conversation | Unlimited (older messages may be archived) |\n| Message retention | Configurable (default: indefinite) |\n\n---\n\n## CANNOT\n\n- **Cannot add SMS participants without a Twilio number** — Number must be assigned to a Conversations (classic) Service\n- **Cannot send WhatsApp messages outside the 24-hour window** — Subject to service window rules. See `twilio-whatsapp-send-message`\n- **Cannot use chat participants without Access Tokens** — Client-side SDK auth required. See `twilio-iam-auth-setup`\n- **Cannot use WhatsApp Groups API** — Deprecated April 2020. Use Conversations (classic) API instead.\n- **Conversations v1 (classic) is in maintenance mode** — Consider Conversations v2 API for new projects with enhanced features and scalability.\n\n---\n\n## Next Steps\n\n- **WhatsApp setup and rules:** `twilio-whatsapp-send-message`\n- **SMS setup:** `twilio-sms-send-message`\n- **Access Tokens for chat clients:** `twilio-iam-auth-setup`\n- **Webhook security:** `twilio-webhook-architecture`\n","## Overview\n\nConversations (classic) API provides persistent, multi-channel threads where participants on SMS, WhatsApp, and web chat can message together. Unlike single-message APIs, Conversations maintains history and supports multi-agent access.\n\n**Note:** This is the Conversations (classic) API (v1).\n\n---\n\n## Prerequisites\n\n- Twilio account with Conversations (classic) enabled\n  — New to Twilio? See `twilio-account-setup`\n  — Enable at: [Console > Conversations > Manage > Overview](https:\u002F\u002Fconsole.twilio.com\u002Fus1\u002Fdevelop\u002Fconversations\u002Fmanage\u002Foverview) > **Enable Conversations**\n- Environment variables:\n  - `TWILIO_ACCOUNT_SID`\n  - `TWILIO_AUTH_TOKEN`\n  — See `twilio-iam-auth-setup` for credential setup and best practices\n- SDK: `pip install twilio` \u002F `npm install twilio`\n- For SMS\u002FWhatsApp participants: a Twilio number assigned to a Conversations Service\n\n---\n\n## Setup: Create a Conversation Service (classic)\n\nA Conversation Service is the parent configuration container for all your conversations in the classic API. You need one before creating conversations with SMS\u002FWhatsApp participants.\n\n**Python**\n```python\nimport os\nfrom twilio.rest import Client\n\nclient = Client(os.environ[\"TWILIO_ACCOUNT_SID\"], os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n# Create a Conversation Service\nservice = client.conversations.v1.services.create(\n    friendly_name=\"Customer Support Service\"\n)\nprint(f\"Service SID: {service.sid}\")\n```\n\n**Node.js**\n```node\nconst twilio = require(\"twilio\");\nconst client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);\n\n\u002F\u002F Create a Conversation Service\nconst service = await client.conversations.v1.services.create({\n    friendlyName: \"Customer Support Service\"\n});\nconsole.log(`Service SID: ${service.sid}`);\n```\n\n**Next:** Assign your Twilio phone number to this service at [Console > Conversations > Manage > Services](https:\u002F\u002Fconsole.twilio.com\u002Fus1\u002Fdevelop\u002Fconversations\u002Fmanage\u002Fservices) > Select your service > Add phone number.\n\n---\n\n## Quickstart\n\n**Python**\n```python\nimport os\nfrom twilio.rest import Client\n\nclient = Client(os.environ[\"TWILIO_ACCOUNT_SID\"], os.environ[\"TWILIO_AUTH_TOKEN\"])\n\n# Create a conversation (use default service or specify service_sid)\nconversation = client.conversations.v1.conversations.create(\n    friendly_name=\"Customer Support - Order #12345\"\n)\n\n# Add an SMS participant\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"+15558675310\",\n        messaging_binding_proxy_address=\"+15017122661\"\n    )\n\n# Send a message\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(body=\"Hello! How can I help you today?\", author=\"support-agent\")\n```\n\n**Node.js**\n```node\nconst twilio = require(\"twilio\");\nconst client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);\n\n\u002F\u002F Create a conversation (use default service or specify serviceSid)\nconst conversation = await client.conversations.v1.conversations.create({\n    friendlyName: \"Customer Support - Order #12345\",\n});\n\n\u002F\u002F Add an SMS participant\nawait client.conversations.v1\n    .conversations(conversation.sid)\n    .participants.create({\n        messagingBindingAddress: \"+15558675310\",\n        messagingBindingProxyAddress: \"+15017122661\",\n    });\n\n\u002F\u002F Send a message\nawait client.conversations.v1\n    .conversations(conversation.sid)\n    .messages.create({ body: \"Hello! How can I help you today?\", author: \"support-agent\" });\n```\n\n---\n\n## Key Patterns\n\n### Add Participants by Channel\n\n**WhatsApp participant — Python**\n```python\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"whatsapp:+15558675310\",\n        messaging_binding_proxy_address=\"whatsapp:+14155238886\"\n    )\n```\n\n**WhatsApp participant — Node.js**\n```node\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({\n        messagingBindingAddress: \"whatsapp:+15558675310\",\n        messagingBindingProxyAddress: \"whatsapp:+14155238886\",\n    });\n```\n\n**Chat participant (web\u002Fmobile) — Python**\n```python\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(identity=\"user-123\")\n```\n\n**Chat participant (web\u002Fmobile) — Node.js**\n```node\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({ identity: \"user-123\" });\n```\n\n### Send Media (All Channels)\n\n**Python**\n```python\n# Send a message with media\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(\n        body=\"Check out this image!\",\n        author=\"support-agent\",\n        media_url=\"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n    )\n\n# Multiple media URLs (up to 10)\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .create(\n        body=\"Here are the documents\",\n        author=\"support-agent\",\n        media_url=[\n            \"https:\u002F\u002Fexample.com\u002Fdoc1.pdf\",\n            \"https:\u002F\u002Fexample.com\u002Fdoc2.pdf\"\n        ]\n    )\n```\n\n**Node.js**\n```node\n\u002F\u002F Send a message with media\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .messages.create({\n        body: \"Check out this image!\",\n        author: \"support-agent\",\n        mediaUrl: \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"\n    });\n\n\u002F\u002F Multiple media URLs (up to 10)\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .messages.create({\n        body: \"Here are the documents\",\n        author: \"support-agent\",\n        mediaUrl: [\n            \"https:\u002F\u002Fexample.com\u002Fdoc1.pdf\",\n            \"https:\u002F\u002Fexample.com\u002Fdoc2.pdf\"\n        ]\n    });\n```\n\nMedia must be publicly accessible URLs. Supported: JPG, PNG, GIF, PDF, vCard. Max 10 URLs per message. Works across all channels: SMS (as MMS), WhatsApp, and chat participants all receive media.\n\n### Add Multiple Participants\n\n**Python**\n```python\n# Add multiple SMS participants to a conversation\nparticipant_numbers = [\n    \"+15558675310\",\n    \"+15558675311\",\n    \"+15558675312\"\n]\n\ntwilio_number = \"+15017122661\"\n\nfor phone_number in participant_numbers:\n    client.conversations.v1 \\\n        .conversations(conversation.sid) \\\n        .participants \\\n        .create(\n            messaging_binding_address=phone_number,\n            messaging_binding_proxy_address=twilio_number\n        )\n```\n\n**Node.js**\n```node\n\u002F\u002F Add multiple SMS participants to a conversation\nconst participantNumbers = [\n    \"+15558675310\",\n    \"+15558675311\",\n    \"+15558675312\"\n];\n\nconst twilioNumber = \"+15017122661\";\n\nfor (const phoneNumber of participantNumbers) {\n    await client.conversations.v1\n        .conversations(conversationSid)\n        .participants.create({\n            messagingBindingAddress: phoneNumber,\n            messagingBindingProxyAddress: twilioNumber\n        });\n}\n```\n\n### Fetch Message History\n\n**Python**\n```python\n# Get all messages from a conversation\nmessages = client.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .messages \\\n    .list(limit=50)\n\nfor message in messages:\n    print(f\"{message.author}: {message.body}\")\n```\n\n**Node.js**\n```node\n\u002F\u002F Get all messages from a conversation\nconst messages = await client.conversations.v1\n    .conversations(conversationSid)\n    .messages\n    .list({ limit: 50 });\n\nmessages.forEach(message => {\n    console.log(`${message.author}: ${message.body}`);\n});\n```\n\n### List Conversations\n\n**Python**\n```python\n# List all conversations\nconversations = client.conversations.v1.conversations.list(limit=20)\n\nfor conv in conversations:\n    print(f\"{conv.friendly_name} - {conv.sid}\")\n\n# Filter by state\nactive_conversations = client.conversations.v1.conversations.list(\n    state=\"active\",\n    limit=20\n)\n```\n\n**Node.js**\n```node\n\u002F\u002F List all conversations\nconst conversations = await client.conversations.v1.conversations.list({ limit: 20 });\n\nconversations.forEach(conv => {\n    console.log(`${conv.friendlyName} - ${conv.sid}`);\n});\n\n\u002F\u002F Filter by state\nconst activeConversations = await client.conversations.v1.conversations.list({\n    state: \"active\",\n    limit: 20\n});\n```\n\n### Remove Participants\n\n**Python**\n```python\n# Remove a participant by participant SID\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants(participant_sid) \\\n    .delete()\n\n# Find and remove by phone number\nparticipants = client.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .list()\n\nfor p in participants:\n    if p.messaging_binding and p.messaging_binding.get(\"address\") == \"+15558675310\":\n        client.conversations.v1 \\\n            .conversations(conversation.sid) \\\n            .participants(p.sid) \\\n            .delete()\n```\n\n**Node.js**\n```node\n\u002F\u002F Remove a participant by participant SID\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants(participantSid)\n    .remove();\n\n\u002F\u002F Find and remove by phone number\nconst participants = await client.conversations.v1\n    .conversations(conversationSid)\n    .participants\n    .list();\n\nfor (const p of participants) {\n    if (p.messagingBinding?.address === \"+15558675310\") {\n        await client.conversations.v1\n            .conversations(conversationSid)\n            .participants(p.sid)\n            .remove();\n    }\n}\n```\n\n### Close\u002FComplete Conversations\n\n**Python**\n```python\n# Close a conversation (marks it inactive)\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .update(state=\"closed\")\n\n# Delete a conversation completely\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .delete()\n```\n\n**Node.js**\n```node\n\u002F\u002F Close a conversation (marks it inactive)\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .update({ state: \"closed\" });\n\n\u002F\u002F Delete a conversation completely\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .remove();\n```\n\n### Handle Incoming Messages (Webhook)\n\nConfigure at Console > Conversations > Manage > Global Webhooks.\n\n> **Security:** Always validate the `X-Twilio-Signature` header in production to confirm requests originate from Twilio. See `twilio-webhook-architecture` for validation patterns.\n\n**Python (Flask)**\n```python\nfrom twilio.request_validator import RequestValidator\n\n@app.route(\"\u002Fconversations\u002Fwebhook\", methods=[\"POST\"])\ndef conversations_webhook():\n    validator = RequestValidator(os.environ[\"TWILIO_AUTH_TOKEN\"])\n    if not validator.validate(request.url, request.form, request.headers.get(\"X-Twilio-Signature\", \"\")):\n        return \"\", 403\n\n    event_type = request.form.get(\"EventType\")\n    conversation_sid = request.form.get(\"ConversationSid\")\n    author = request.form.get(\"Author\")\n\n    if event_type == \"onMessageAdded\" and author != \"support-agent\":\n        client.conversations.v1.conversations(conversation_sid).messages.create(\n            body=\"Thanks — an agent will be with you shortly.\",\n            author=\"support-bot\"\n        )\n    return \"\", 204\n```\n\n**Node.js (Express)**\n```node\napp.post(\"\u002Fconversations\u002Fwebhook\", async (req, res) => {\n    const valid = twilio.validateRequest(\n        process.env.TWILIO_AUTH_TOKEN,\n        req.headers[\"x-twilio-signature\"],\n        `https:\u002F\u002F${req.headers.host}${req.originalUrl}`,\n        req.body\n    );\n    if (!valid) return res.status(403).send(\"Forbidden\");\n\n    const { EventType, ConversationSid, Author } = req.body;\n    if (EventType === \"onMessageAdded\" && Author !== \"support-agent\") {\n        await client.conversations.v1\n            .conversations(ConversationSid)\n            .messages.create({ body: \"Thanks — an agent will be with you shortly.\", author: \"support-bot\" });\n    }\n    res.sendStatus(204);\n});\n```\n\n---\n\n## Advanced Context\n\n### Message Delivery Status\n\nTrack message delivery through webhooks. Configure at Console > Conversations > Manage > Global Webhooks.\n\n**Available delivery events:**\n- `onMessageAdded` — Message created\n- `onMessageUpdated` — Message status changed\n- `onDeliveryUpdated` — Delivery receipt received (SMS\u002FWhatsApp only)\n\n**Python (Flask)**\n```python\n@app.route(\"\u002Fconversations\u002Fwebhook\", methods=[\"POST\"])\ndef delivery_webhook():\n    event_type = request.form.get(\"EventType\")\n    \n    if event_type == \"onDeliveryUpdated\":\n        delivery_status = request.form.get(\"DeliveryStatus\")\n        message_sid = request.form.get(\"MessageSid\")\n        print(f\"Message {message_sid}: {delivery_status}\")\n        # Status values: sent, delivered, failed, undelivered\n    \n    return \"\", 204\n```\n\n**Node.js (Express)**\n```node\napp.post(\"\u002Fconversations\u002Fwebhook\", (req, res) => {\n    const { EventType, DeliveryStatus, MessageSid } = req.body;\n    \n    if (EventType === \"onDeliveryUpdated\") {\n        console.log(`Message ${MessageSid}: ${DeliveryStatus}`);\n        \u002F\u002F Status values: sent, delivered, failed, undelivered\n    }\n    \n    res.sendStatus(204);\n});\n```\n\n### Conversation Attributes (Metadata)\n\nStore custom metadata on conversations (order IDs, customer info, tags).\n\n**Python**\n```python\n# Set attributes when creating\nconversation = client.conversations.v1.conversations.create(\n    friendly_name=\"Customer Support - Order #12345\",\n    attributes='{\"order_id\": \"12345\", \"priority\": \"high\", \"customer_tier\": \"gold\"}'\n)\n\n# Update attributes on existing conversation\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .update(attributes='{\"order_id\": \"12345\", \"status\": \"resolved\"}')\n\n# Read attributes\nconv = client.conversations.v1.conversations(conversation.sid).fetch()\nimport json\nattrs = json.loads(conv.attributes)\nprint(f\"Order ID: {attrs['order_id']}\")\n```\n\n**Node.js**\n```node\n\u002F\u002F Set attributes when creating\nconst conversation = await client.conversations.v1.conversations.create({\n    friendlyName: \"Customer Support - Order #12345\",\n    attributes: JSON.stringify({ orderId: \"12345\", priority: \"high\", customerTier: \"gold\" })\n});\n\n\u002F\u002F Update attributes on existing conversation\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .update({ attributes: JSON.stringify({ orderId: \"12345\", status: \"resolved\" }) });\n\n\u002F\u002F Read attributes\nconst conv = await client.conversations.v1.conversations(conversationSid).fetch();\nconst attrs = JSON.parse(conv.attributes);\nconsole.log(`Order ID: ${attrs.orderId}`);\n```\n\n### Participant Attributes (Metadata)\n\nStore metadata on individual participants (role, name, account info).\n\n**Python**\n```python\n# Set attributes when adding participant\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants \\\n    .create(\n        messaging_binding_address=\"+15558675310\",\n        messaging_binding_proxy_address=\"+15017122661\",\n        attributes='{\"name\": \"John Doe\", \"role\": \"customer\", \"account_id\": \"A123\"}'\n    )\n\n# Update participant attributes\nclient.conversations.v1 \\\n    .conversations(conversation.sid) \\\n    .participants(participant_sid) \\\n    .update(attributes='{\"role\": \"vip_customer\", \"satisfaction\": \"high\"}')\n```\n\n**Node.js**\n```node\n\u002F\u002F Set attributes when adding participant\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants.create({\n        messagingBindingAddress: \"+15558675310\",\n        messagingBindingProxyAddress: \"+15017122661\",\n        attributes: JSON.stringify({ name: \"John Doe\", role: \"customer\", accountId: \"A123\" })\n    });\n\n\u002F\u002F Update participant attributes\nawait client.conversations.v1\n    .conversations(conversationSid)\n    .participants(participantSid)\n    .update({ attributes: JSON.stringify({ role: \"vip_customer\", satisfaction: \"high\" }) });\n```\n\n---\n\n## Limits\n\n| Limit | Value |\n|-------|-------|\n| Participants per conversation | 1,000 |\n| Messages per conversation | Unlimited (older messages may be archived) |\n| Message retention | Configurable (default: indefinite) |\n\n---\n\n## CANNOT\n\n- **Cannot add SMS participants without a Twilio number** — Number must be assigned to a Conversations (classic) Service\n- **Cannot send WhatsApp messages outside the 24-hour window** — Subject to service window rules. See `twilio-whatsapp-send-message`\n- **Cannot use chat participants without Access Tokens** — Client-side SDK auth required. See `twilio-iam-auth-setup`\n- **Cannot use WhatsApp Groups API** — Deprecated April 2020. Use Conversations (classic) API instead.\n- **Conversations v1 (classic) is in maintenance mode** — Consider Conversations v2 API for new projects with enhanced features and scalability.\n\n---\n\n## Next Steps\n\n- **WhatsApp setup and rules:** `twilio-whatsapp-send-message`\n- **SMS setup:** `twilio-sms-send-message`\n- **Access Tokens for chat clients:** `twilio-iam-auth-setup`\n- **Webhook security:** `twilio-webhook-architecture`\n",{"name":5,"description":7},"main","907b1d897cc6743f7f133f8ea2021e1331b0b020",".codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftwilio-developer-kit\u002Fskills\u002Ftwilio-conversations-classic-api","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque","https:\u002F\u002Fgithub.com\u002Frossboyd","www.bigideasgroup.co.uk","2026-09-22 02:03:50",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add rossboyd\u002Fquickque --skill twilio-conversations-classic-api",{"tool":37,"command":38},"bunx","bunx skills add rossboyd\u002Fquickque --skill twilio-conversations-classic-api",{"tool":40,"command":41},"pnpm","pnpm dlx skills add rossboyd\u002Fquickque --skill twilio-conversations-classic-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftwilio-developer-kit\u002Fskills\u002Ftwilio-conversations-classic-api\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",245,"https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftwilio-developer-kit\u002Fskills\u002Ftwilio-conversations-classic-api\u002Fagents\u002Fopenai.yaml",[52,61,69,76,83,91],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":56,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7CJSS21K09H3ZQZMPFR4ZAG","skill-installer","Install Codex skills into $CODEX_HOME\u002Fskills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-installer\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-installer\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":56,"licenseFileUrl":65,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7CJSM1F4E7RBXCS3C18EFBY","skill-creator","Create or update a Codex skill with appropriately scoped instructions and any needed supporting resources.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-creator\u002Flicense.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7CJSGF2PJM504Q6TZCNT27C","review-agent","Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Freview-agent\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7CJSBQTPFEQYZF4VWS7QZ3N","plugin-creator","Create and scaffold plugin directories for Codex with a required `.codex-plugin\u002Fplugin.json`, optional plugin folders\u002Ffiles, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries for plugin ordering and availability metadata, or update an existing local plugin during development with the CLI-driven cachebuster and reinstall flow.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fplugin-creator\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":56,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7CJS5BHJZKA16353PVZGC50","openai-docs","Use for Codex models\u002Fpricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs\u002Fproducts and ChatGPT Work. Also use for model choice\u002Fmigration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat\u002FWork\u002FCodex comparisons. Do not use for generic app\u002Fsoftware tasks that merely mention Codex.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fopenai-docs\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fopenai-docs\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":56,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7CJRY1FC048P3RF4YQZ6J8B","imagegen","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fimagegen\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fimagegen\u002FSKILL.md",[],[]]