> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio

> Twilio Scenario seeding parameters, nested fields, and examples

Use `twilio` in `twins` and put this configuration under `seed_config.twilio`.

Twilio communications with SMS/MMS, phone numbers, Messaging Services, Voice calls and TwiML, Verify, Conversations, Sync, TaskRouter, Studio, TrustHub, Content, SendGrid and Segment Public API.

## Example seed

This is the complete Scenario request body for [creating a Scenario](https://docs.argalabs.com/api-reference/post-create-a-scenario.md). You can also import it with `arga test-runner scenarios import --file scenario.json`.

```json theme={null}
{
  "name": "Twilio eval fixture",
  "twins": [
    "twilio"
  ],
  "seed_config": {
    "twilio": {
      "friendly_name": "Customer support",
      "phone_numbers": [
        {
          "name": "support-number",
          "phone_number": "+14155550100",
          "friendly_name": "Support",
          "sms_url": "",
          "voice_url": ""
        }
      ],
      "messaging_services": [
        {
          "name": "support-messaging",
          "friendly_name": "Support messaging",
          "phone_number_sids": [
            "support-number"
          ]
        }
      ],
      "verify_services": [
        {
          "name": "login-verify",
          "friendly_name": "Login verification",
          "code_length": 6
        }
      ],
      "conversations": [
        {
          "friendly_name": "Order support",
          "unique_name": "order-support",
          "participants": [
            {
              "identity": "support-agent"
            },
            {
              "messaging_binding_address": "+14155550123",
              "messaging_binding_proxy_address": "+14155550100"
            }
          ],
          "messages": [
            {
              "author": "support-agent",
              "body": "How can I help?"
            }
          ]
        }
      ],
      "messages": [],
      "calls": [],
      "applications": [],
      "dialing_permissions": [],
      "phone_number_pricing": [],
      "voice_pricing": [],
      "regulations": [],
      "bundles": [],
      "v2_configurations": [],
      "v2_conversations": [],
      "message_outcomes": {},
      "call_outcomes": {}
    }
  }
}
```

## Parameters

The following fields belong directly inside `seed_config.twilio`. Required nested fields are marked in their tables. Provider-native objects can contain service-specific fields beyond the representative record shapes below.

| Parameter | Type | Description |
| - | - | - |
| `friendly_name` | `string` | Friendly name. |
| `phone_numbers` | `object[]` | Phone numbers fixtures in provider-native format. |
| `messaging_services` | `object[]` | Messaging services fixtures in provider-native format. |
| `verify_services` | `object[]` | Verify services fixtures in provider-native format. |
| `conversations` | `object[]` | Conversations fixtures in provider-native format. |
| `messages` | `array` | Messages to create in the twin. |
| `calls` | `array` | Calls fixtures in provider-native format. |
| `applications` | `array` | Applications fixtures in provider-native format. |
| `dialing_permissions` | `object[]` | Dialing permissions fixtures in provider-native format. |
| `phone_number_pricing` | `object[]` | Phone number pricing fixtures in provider-native format. |
| `voice_pricing` | `object[]` | Voice pricing fixtures in provider-native format. |
| `regulations` | `object[]` | Regulations fixtures in provider-native format. |
| `bundles` | `object[]` | Bundles fixtures in provider-native format. |
| `v2_configurations` | `array` | V2 configurations fixtures in provider-native format. |
| `v2_conversations` | `array` | V2 conversations fixtures in provider-native format. |
| `message_outcomes` | `map<string, "delivered" / "undelivered" / "failed">` | Message outcomes keyed by identifier or resource name. |
| `call_outcomes` | `map<string, "completed" / "busy" / "failed" / "no-answer">` | Call outcomes keyed by identifier or resource name. |
| `base_time` | `string or null` | Reference clock for repeatable fixtures. Omit to use the current clock. |
| `account_sid` | `string` | Account sid. |
| `auth_token` | `string` | Auth token. Minimum length: 1. |
| `api_key` | `string` | Synthetic API key accepted by the twin. |
| `api_secret` | `string` | Api secret. Minimum length: 1. |
| `authy_access_key` | `string` | Authy access key. |
| `authy_signing_key` | `string` | Authy signing key. |
| `authy_api_key` | `string` | Authy api key. Minimum length: 1. |
| `sendgrid_api_key` | `string` | Sendgrid api key. Minimum length: 1. |
| `segment_write_key` | `string` | Segment write key. |
| `segment_access_token` | `string` | Segment access token. Minimum length: 1. |
| `oauth_redirect_uris` | `string[]` | Oauth redirect uris fixtures in provider-native format. |
| `oauth_client_id` | `string` | Oauth client id. |
| `oauth_client_secret` | `string` | Oauth client secret. |
| `account_type` | `"Full" / "Trial"` | Account type. |
| `region` | `"us1" / "ie1" / "au1"` | Region. |
| `webhook_auto_dispatch` | `boolean` | Enable automatic delivery of configured twin webhooks. |
| `webhook_timeout_seconds` | `number` | Webhook timeout seconds, in seconds. Maximum: 15. |
| `webhook_allow_loopback` | `boolean` | Enable or set webhook allow loopback behavior. |
| `webhook_allowed_hosts` | `string[]` | Webhook allowed hosts fixtures in provider-native format. |
| `requests_per_second` | `integer` | Requests per second. Minimum: 1. |
| `rate_limiting_enabled` | `boolean` | Enable request rate limiting. |
| `calls_per_second` | `number` | Calls per second. |
| `message_step_seconds` | `number` | Message step seconds, in seconds. |
| `call_step_seconds` | `number` | Call step seconds, in seconds. |
| `default_call_duration_seconds` | `number` | Default call duration seconds, in seconds. |
| `amd_outcomes` | `map<string, "human" / "machine_start" / "machine_end_beep" / "machine_end_silence" / "machine_end_other" / "fax" / "unknown">` | Amd outcomes keyed by identifier or resource name. |
| `amd_duration_ms` | `integer` | Amd duration ms. Minimum: 0. Maximum: 60000. |
| `call_price_per_minute` | `number` | Call price per minute. Minimum: 0. |
| `recording_price_per_minute` | `number` | Recording price per minute. Minimum: 0. |
| `verify_code` | `string` | Verify code. |
| `verify_ttl_seconds` | `integer` | Verify ttl seconds, in seconds. Minimum: 120. Maximum: 86400. |
| `verify_max_check_attempts` | `integer` | Verify max check attempts. Minimum: 1. |
| `verify_max_send_attempts` | `integer` | Verify max send attempts. Minimum: 1. |
| `failure_rules` | `FailureRule[]` | Deterministic failure-injection rules. |
| `resources` | `object` | Provider resource collections keyed by collection name. Preserve their native record fields and references. |
| `runtime` | `object` | Runtime. |
| `snapshot` | `object` | Snapshot. |
| `accounts` | `object[]` | Accounts fixtures in provider-native format. |
| `conversations_services` | `object[]` | Conversations services fixtures in provider-native format. |
| `catalog_requests` | `object[]` | Catalog requests fixtures in provider-native format. |

## Seeding behavior

Resource records accept natural snake\_case and provider request field names. Named resources can be referenced by later fixtures. `resources` groups resource sections, `runtime` overrides runtime settings, and `snapshot` restores a complete exported state instead of applying resource creation.

## Resource fields

These tables describe the record shapes used by the example. Keep native field names and casing. Map keys such as property names, IDs, and metadata keys are supplied by your fixture.

### `phone_numbers[]`

| Parameter | Type | Description |
| - | - | - |
| `name` | `string` | Human-readable name. |
| `phone_number` | `string` | Phone number. |
| `friendly_name` | `string` | Friendly name. |
| `sms_url` | `string` | Sms url. |
| `voice_url` | `string` | Voice url. |

### `messaging_services[]`

| Parameter | Type | Description |
| - | - | - |
| `name` | `string` | Human-readable name. |
| `friendly_name` | `string` | Friendly name. |
| `phone_number_sids` | `string[]` | Phone number sids fixtures in provider-native format. |

### `verify_services[]`

| Parameter | Type | Description |
| - | - | - |
| `name` | `string` | Human-readable name. |
| `friendly_name` | `string` | Friendly name. |
| `code_length` | `integer` | Code length. |

### `conversations[]`

| Parameter | Type | Description |
| - | - | - |
| `friendly_name` | `string` | Friendly name. |
| `unique_name` | `string` | Unique name. |
| `participants` | `object[]` | Participants fixtures in provider-native format. |
| `messages` | `object[]` | Messages to create in the twin. |

### `conversations[].participants[]`

| Parameter | Type | Description |
| - | - | - |
| `identity` | `string` | Identity. |
| `messaging_binding_address` | `string` | Messaging binding address. |
| `messaging_binding_proxy_address` | `string` | Messaging binding proxy address. |

### `conversations[].messages[]`

| Parameter | Type | Description |
| - | - | - |
| `author` | `string` | Author. |
| `body` | `string` | Text content. |

## Typed configuration objects

Named object types in the parameter table use these fields.

### FailureRule

| Parameter | Type | Description |
| - | - | - |
| `product` | `string` | Product. |
| `method` | `string` | Method. |
| `path` | `string` | Path. |
| `status_code` | `integer` | Status code. Minimum: 400. Maximum: 599. |
| `code` | `integer` | Code. |
| `message` | `string` | Message. |
| `remaining` | `integer` | Remaining. Minimum: 1. |

See [Scenario seeding](https://docs.argalabs.com/twins/seeding.md) for saving, provisioning, and resetting fixtures.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.