{
  "description": "Outbound webhook receiver contracts, not callable Smobi API endpoints.",
  "events": {
    "/webhooks/status": {
      "tags": [
        "Webhooks"
      ],
      "summary": "Status Update",
      "description": "Smobi sends this payload to the HTTPS receiver you configure. Return 2xx after accepting the event. This is not a callable endpoint on api.smobi.com.",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/OutboundStatusV1"
            },
            "examples": {
              "delivered": {
                "summary": "Message Delivered",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "clientRef": "client-ref-123",
                  "to": "15552223333",
                  "from": "15551234567",
                  "status": "DELIVERED",
                  "channel": "SMS",
                  "timestamp": "2021-01-01T00:00:00.000Z"
                }
              },
              "failed": {
                "summary": "Message Failed",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "clientRef": "client-ref-123",
                  "to": "15552223333",
                  "from": "15551234567",
                  "status": "FAILED",
                  "channel": "SMS",
                  "timestamp": "2021-01-01T00:00:00.000Z",
                  "failureDetails": {
                    "reason": "UNDELIVERABLE",
                    "description": "The message could not be delivered"
                  }
                }
              }
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Successful webhook delivery"
        }
      }
    },
    "/webhooks/inbound": {
      "tags": [
        "Webhooks"
      ],
      "summary": "Inbound Message",
      "description": "Smobi sends this payload to the HTTPS receiver you configure. Return 2xx after accepting the event. This is not a callable endpoint on api.smobi.com.",
      "requestBody": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BaseOutboundMessageV2"
            },
            "examples": {
              "sms_text": {
                "summary": "SMS Text Message",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "to": "15552223333",
                  "from": "15551234567",
                  "channel": "SMS",
                  "timestamp": "2021-01-01T00:00:00.000Z",
                  "sms": {
                    "content": "Hello, world!"
                  }
                }
              },
              "sms_with_media": {
                "summary": "SMS with Media (converted from MMS)",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "to": "15552223333",
                  "from": "15551234567",
                  "channel": "SMS",
                  "timestamp": "2021-01-01T00:00:00.000Z",
                  "sms": {
                    "content": "",
                    "downloadUrl": "https://example.com/image.jpg",
                    "fileExtension": "jpg"
                  }
                }
              },
              "rcs_text": {
                "summary": "RCS Text Message",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "to": "15552223333",
                  "from": "15551234567",
                  "channel": "RCS",
                  "timestamp": "2021-01-01T00:00:00.000Z",
                  "rcs": {
                    "type": "TEXT",
                    "content": "Hello from RCS!"
                  }
                }
              },
              "rcs_suggestion": {
                "summary": "RCS Suggestion Interaction",
                "value": {
                  "smobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                  "to": "15552223333",
                  "from": "15551234567",
                  "channel": "RCS",
                  "timestamp": "2021-01-01T00:00:00.000Z",
                  "rcs": {
                    "type": "SUGGESTION",
                    "content": {
                      "parentSmobiMessageId": "123e4567-e89b-12d3-a456-426614174000",
                      "parentClientRef": "client-ref-123",
                      "suggestionId": "suggestion-123",
                      "text": "Yes, I agree"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "responses": {
        "200": {
          "description": "Successful webhook delivery"
        }
      }
    }
  },
  "schemas": {
    "RcsContent": {
      "type": "object",
      "properties": {
        "content": {
          "description": "Rendered RCS message content",
          "oneOf": [
            {
              "$ref": "#/components/schemas/TextMessage"
            },
            {
              "$ref": "#/components/schemas/ContentMessage"
            },
            {
              "$ref": "#/components/schemas/RichCardMessage"
            },
            {
              "$ref": "#/components/schemas/CarouselMessage"
            }
          ]
        }
      },
      "required": [
        "content"
      ]
    },
    "SmsContent": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Content of the SMS message. Optional if mediaUrl is provided (content becomes caption).",
          "example": "Hello, this is your message text",
          "minLength": 1
        },
        "mediaUrl": {
          "type": "string",
          "description": "Optional media URL. When provided, content becomes the caption for the media.",
          "example": "https://example.com/image.jpg"
        }
      },
      "description": "Provide non-empty text content, a media URL, or both. When media is supplied, text is the caption.",
      "anyOf": [
        {
          "title": "SMS Text",
          "required": [
            "content"
          ]
        },
        {
          "title": "SMS Media",
          "required": [
            "mediaUrl"
          ],
          "properties": {
            "mediaUrl": {
              "minLength": 1
            }
          }
        }
      ]
    },
    "RenderedTemplateContent": {
      "type": "object",
      "properties": {
        "rcs": {
          "description": "Rendered RCS content, used if RCS is supported by the recipientPhoneNumber.",
          "allOf": [
            {
              "$ref": "#/components/schemas/RcsContent"
            }
          ]
        },
        "sms": {
          "description": "SMS text or media, also used as an RCS fallback. Provide non-empty text, a media URL, or both. Select a variant to inspect its required fields.",
          "allOf": [
            {
              "$ref": "#/components/schemas/SmsContent"
            }
          ]
        }
      },
      "required": [],
      "additionalProperties": false,
      "description": "Message content for RCS, SMS, or both. Supply content for at least one configured channel. RCS is not required for SMS-only messages."
    },
    "SendMessage": {
      "type": "object",
      "properties": {
        "clientRef": {
          "type": "string",
          "description": "Client reference ID",
          "example": "client-ref-123"
        },
        "recipientPhoneNumber": {
          "type": "string",
          "description": "Recipient phone number, string of all digits, for example, 12223334444",
          "example": "15552223333"
        },
        "content": {
          "description": "Message content",
          "example": {
            "rcs": {
              "content": {
                "type": "TEXT",
                "content": "Hello, world!",
                "globalSuggestions": [
                  {
                    "type": "REPLY",
                    "text": "Reply",
                    "id": "reply-1"
                  }
                ]
              }
            },
            "sms": {
              "content": "Check out this image!",
              "mediaUrl": "https://example.com/image.jpg"
            }
          },
          "allOf": [
            {
              "$ref": "#/components/schemas/RenderedTemplateContent"
            }
          ]
        }
      },
      "required": [
        "clientRef",
        "recipientPhoneNumber",
        "content"
      ]
    },
    "SendMessageResponse": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Status of the message processing",
          "example": "PROCESSING"
        },
        "smobiMessageId": {
          "type": "string",
          "description": "Unique identifier for the message in Smobi system",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        }
      },
      "required": [
        "status",
        "smobiMessageId"
      ]
    },
    "CheckChannelCapabilityResponse": {
      "type": "object",
      "properties": {
        "rcs": {
          "type": "boolean",
          "description": "Whether the channel supports RCS",
          "example": true
        },
        "sms": {
          "type": "boolean",
          "description": "Whether the channel supports SMS",
          "example": true
        }
      },
      "required": [
        "rcs",
        "sms"
      ]
    },
    "WorkflowExecutionSettings": {
      "type": "object",
      "properties": {
        "channelOverride": {
          "type": "string",
          "description": "Channel override for the workflow execution",
          "enum": [
            "RCS",
            "SMS"
          ],
          "example": "RCS"
        }
      }
    },
    "ExecuteSingleWorkflow": {
      "type": "object",
      "properties": {
        "variables": {
          "type": "object",
          "description": "Map of workflow variable names to string values. Keys must match the selected workflow. Omit when no variables are needed.",
          "example": {
            "customerName": "John Doe",
            "orderId": "12345",
            "discountCode": "SAVE20"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "settings": {
          "description": "Workflow execution settings including channel overrides",
          "example": {
            "channelOverride": "RCS"
          },
          "allOf": [
            {
              "$ref": "#/components/schemas/WorkflowExecutionSettings"
            }
          ]
        }
      }
    },
    "ExecuteSingleWorkflowResponse": {
      "type": "object",
      "properties": {
        "executionId": {
          "type": "string",
          "description": "Generated workflow run ID",
          "example": "run-123"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the execution was successful",
          "example": true
        },
        "channel": {
          "type": "string",
          "description": "Channel that will be used for message delivery (RCS, SMS, or MMS)",
          "example": "RCS"
        },
        "error": {
          "type": "string",
          "description": "Error message if execution failed",
          "example": "Invalid phone number"
        },
        "errorCode": {
          "type": "string",
          "description": "Error code if execution failed",
          "enum": [
            "INVALID_ARGUMENT",
            "RESOURCE_EXHAUSTED",
            "WORKFLOW_ALREADY_STARTED",
            "PAYLOAD_CONVERSION",
            "UNKNOWN",
            "WORKFLOW_NOT_FOUND",
            "SAVE_FAILED",
            "PREPARATION_FAILED",
            "USER_ENGAGED"
          ]
        },
        "details": {
          "type": "object",
          "description": "Error-specific diagnostic object. Keys and value types vary by failure; no fixed set of properties is guaranteed.",
          "additionalProperties": true,
          "example": {
            "workflowStatus": "DRAFT",
            "requiredStatus": "ACTIVE"
          }
        }
      },
      "required": [
        "success"
      ]
    },
    "ExecuteFamilyWorkflow": {
      "type": "object",
      "properties": {
        "variables": {
          "type": "object",
          "description": "Map of workflow variable names to string values. Keys must match the selected workflow. Omit when no variables are needed.",
          "example": {
            "customerName": "John Doe",
            "orderId": "12345",
            "discountCode": "SAVE20"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "settings": {
          "description": "Workflow execution settings including channel overrides",
          "example": {
            "channelOverride": "RCS"
          },
          "allOf": [
            {
              "$ref": "#/components/schemas/WorkflowExecutionSettings"
            }
          ]
        }
      }
    },
    "ExecuteFamilyWorkflowResponse": {
      "type": "object",
      "properties": {
        "executionId": {
          "type": "string",
          "description": "Generated workflow run ID",
          "example": "run-123"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the execution was successful",
          "example": true
        },
        "channel": {
          "type": "string",
          "description": "Channel that will be used for message delivery (RCS, SMS, or MMS)",
          "example": "RCS"
        },
        "error": {
          "type": "string",
          "description": "Error message if execution failed",
          "example": "Invalid phone number"
        },
        "errorCode": {
          "type": "string",
          "description": "Error code if execution failed",
          "enum": [
            "INVALID_ARGUMENT",
            "RESOURCE_EXHAUSTED",
            "WORKFLOW_ALREADY_STARTED",
            "PAYLOAD_CONVERSION",
            "UNKNOWN",
            "WORKFLOW_NOT_FOUND",
            "SAVE_FAILED",
            "PREPARATION_FAILED",
            "USER_ENGAGED"
          ]
        },
        "details": {
          "type": "object",
          "description": "Error-specific diagnostic object. Keys and value types vary by failure; no fixed set of properties is guaranteed.",
          "additionalProperties": true,
          "example": {
            "workflowStatus": "DRAFT",
            "requiredStatus": "ACTIVE"
          }
        }
      },
      "required": [
        "success"
      ]
    },
    "BatchExecutionResponseItem": {
      "type": "object",
      "properties": {
        "phoneNumber": {
          "type": "string",
          "description": "Phone number for this execution",
          "example": "15552223333"
        },
        "executionId": {
          "type": "string",
          "description": "Generated execution ID for this workflow run",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        },
        "channel": {
          "type": "string",
          "description": "Channel that will be used for message delivery (RCS, SMS, or MMS)",
          "example": "RCS"
        }
      },
      "required": [
        "phoneNumber",
        "executionId"
      ]
    },
    "ExecuteWorkflowBatchResponse": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the batch was successfully queued",
          "example": true
        },
        "executions": {
          "description": "List of executions with their generated IDs",
          "example": [
            {
              "phoneNumber": "15552223333",
              "executionId": "123e4567-e89b-12d3-a456-426614174000"
            },
            {
              "phoneNumber": "15552223334",
              "executionId": "987fcdeb-51a2-43d7-8f9e-123456789abc"
            }
          ],
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/BatchExecutionResponseItem"
          }
        }
      },
      "required": [
        "success",
        "executions"
      ]
    },
    "CreateContactDto": {
      "type": "object",
      "properties": {
        "phoneNumber": {
          "type": "string",
          "example": "+14155552222",
          "description": "E.164 (+1234567890) or digits-only (1234567890) format"
        },
        "firstName": {
          "type": "string",
          "example": "Jane",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "lastName": {
          "type": "string",
          "example": "Doe",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "email": {
          "type": "string",
          "example": "jane@example.com",
          "nullable": true,
          "format": "email",
          "maxLength": 255
        },
        "state": {
          "type": "string",
          "example": "CA",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "country": {
          "type": "string",
          "example": "US",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "dob": {
          "type": "string",
          "example": "1990-04-12",
          "description": "Date of birth in YYYY-MM-DD format. Must be a valid date in the past; null clears the value.",
          "nullable": true,
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "gender": {
          "type": "string",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "preferredLanguage": {
          "type": "string",
          "example": "en",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "tags": {
          "example": [
            "vip"
          ],
          "description": "Full replace on updates; usable in segment rules",
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "maxItems": 100
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000,
                "nullable": true
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "string",
                  "maxLength": 1000
                }
              }
            ]
          },
          "example": {
            "loyaltyTier": "gold"
          },
          "description": "Map of up to 50 fields. Values may be strings (up to 1,000 characters), numbers, booleans, arrays of up to 100 strings, or null. Nested objects are not accepted. Keys must match ^[a-zA-Z_][a-zA-Z0-9_]{0,63}$; `__proto__`, `constructor`, and `prototype` are reserved. A null value deletes that key on update.",
          "maxProperties": 50
        },
        "marketingConsent": {
          "type": "string",
          "enum": [
            "OPTED_IN",
            "OPTED_OUT"
          ],
          "description": "Setting OPTED_IN attests that you collected the contact's marketing consent. OPTED_IN is rejected (422) when the contact previously opted out (e.g. texted STOP); OPTED_OUT is always accepted. Contacts default to UNKNOWN, and campaigns only send to OPTED_IN contacts."
        }
      },
      "required": [
        "phoneNumber"
      ],
      "additionalProperties": false
    },
    "ContactMarketingConsentDto": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "enum": [
            "MOBILE"
          ],
          "example": "MOBILE"
        },
        "status": {
          "type": "string",
          "enum": [
            "UNKNOWN",
            "SENT",
            "OPTED_IN",
            "OPTED_OUT"
          ],
          "example": "OPTED_IN",
          "description": "Campaigns are only sent to OPTED_IN contacts. Contacts created via the API start as UNKNOWN until consent is set."
        },
        "updatedAt": {
          "type": "string",
          "nullable": true,
          "example": "2026-07-07T12:00:00.000Z"
        }
      },
      "required": [
        "channel",
        "status",
        "updatedAt"
      ]
    },
    "ContactDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "9b2f1c3e-8a4d-4f6b-9c2e-1d3f5a7b9c0e"
        },
        "phoneNumber": {
          "type": "string",
          "example": "+14155552222",
          "description": "Always returned in E.164 format"
        },
        "active": {
          "type": "boolean",
          "example": true,
          "description": "false when the contact has been archived (DELETE)"
        },
        "firstName": {
          "type": "string",
          "nullable": true,
          "example": "Jane"
        },
        "lastName": {
          "type": "string",
          "nullable": true,
          "example": "Doe"
        },
        "email": {
          "type": "string",
          "nullable": true,
          "example": "jane@example.com"
        },
        "state": {
          "type": "string",
          "nullable": true,
          "example": "CA"
        },
        "country": {
          "type": "string",
          "nullable": true,
          "example": "US"
        },
        "dob": {
          "type": "string",
          "nullable": true,
          "example": "1990-04-12",
          "description": "Date of birth (YYYY-MM-DD)"
        },
        "gender": {
          "type": "string",
          "nullable": true,
          "example": null
        },
        "preferredLanguage": {
          "type": "string",
          "nullable": true,
          "example": "en"
        },
        "tags": {
          "example": [
            "vip",
            "spring-sale"
          ],
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "customFields": {
          "type": "object",
          "additionalProperties": true,
          "example": {
            "loyaltyTier": "gold",
            "storeIds": [
              "s1",
              "s2"
            ]
          },
          "description": "Stored custom-field values keyed by field name. See create/update request schemas for accepted write types and limits."
        },
        "marketingConsent": {
          "$ref": "#/components/schemas/ContactMarketingConsentDto"
        },
        "createdAt": {
          "type": "string",
          "example": "2026-07-07T12:00:00.000Z"
        },
        "updatedAt": {
          "type": "string",
          "example": "2026-07-07T12:00:00.000Z"
        }
      },
      "required": [
        "id",
        "phoneNumber",
        "active",
        "firstName",
        "lastName",
        "email",
        "state",
        "country",
        "dob",
        "gender",
        "preferredLanguage",
        "tags",
        "customFields",
        "marketingConsent",
        "createdAt",
        "updatedAt"
      ]
    },
    "BulkContactsDto": {
      "type": "object",
      "properties": {
        "contacts": {
          "description": "1-100 contacts; duplicate phone numbers in one batch are rejected",
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/CreateContactDto"
          },
          "minItems": 1,
          "maxItems": 100
        }
      },
      "required": [
        "contacts"
      ],
      "additionalProperties": false
    },
    "BulkContactItemResultDto": {
      "type": "object",
      "properties": {
        "index": {
          "type": "number",
          "example": 0
        },
        "phoneNumber": {
          "type": "string",
          "example": "+14155552222"
        },
        "status": {
          "type": "string",
          "enum": [
            "created",
            "updated",
            "error"
          ]
        },
        "id": {
          "type": "string",
          "example": "9b2f1c3e-8a4d-4f6b-9c2e-1d3f5a7b9c0e"
        },
        "error": {
          "type": "string",
          "example": "Cannot opt in a contact that has opted out; the contact must opt back in themselves (e.g. by texting START)"
        }
      },
      "required": [
        "index",
        "phoneNumber",
        "status"
      ]
    },
    "BulkContactsSummaryDto": {
      "type": "object",
      "properties": {
        "total": {
          "type": "number",
          "example": 3
        },
        "created": {
          "type": "number",
          "example": 2
        },
        "updated": {
          "type": "number",
          "example": 0
        },
        "failed": {
          "type": "number",
          "example": 1
        }
      },
      "required": [
        "total",
        "created",
        "updated",
        "failed"
      ]
    },
    "BulkContactsResponseDto": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/BulkContactItemResultDto"
          }
        },
        "summary": {
          "$ref": "#/components/schemas/BulkContactsSummaryDto"
        }
      },
      "required": [
        "results",
        "summary"
      ]
    },
    "ContactListPaginationDto": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "number",
          "example": 50
        },
        "hasMore": {
          "type": "boolean",
          "example": true
        },
        "nextCursor": {
          "type": "string",
          "nullable": true,
          "example": "eyJjIjoiMjAyNi0wNy0wN1QxMjowMDowMC4wMDBaIiwiaSI6IjliMmYifQ",
          "description": "Opaque cursor for the next page; null on the last page"
        }
      },
      "required": [
        "limit",
        "hasMore",
        "nextCursor"
      ]
    },
    "ContactListResponseDto": {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/components/schemas/ContactDto"
          }
        },
        "pagination": {
          "$ref": "#/components/schemas/ContactListPaginationDto"
        }
      },
      "required": [
        "data",
        "pagination"
      ]
    },
    "UpdateContactDto": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string",
          "example": "Jane",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "lastName": {
          "type": "string",
          "example": "Doe",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "email": {
          "type": "string",
          "example": "jane@example.com",
          "nullable": true,
          "format": "email",
          "maxLength": 255
        },
        "state": {
          "type": "string",
          "example": "CA",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "country": {
          "type": "string",
          "example": "US",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "dob": {
          "type": "string",
          "example": "1990-04-12",
          "description": "Date of birth in YYYY-MM-DD format. Must be a valid date in the past; null clears the value.",
          "nullable": true,
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "gender": {
          "type": "string",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "preferredLanguage": {
          "type": "string",
          "example": "en",
          "nullable": true,
          "minLength": 1,
          "maxLength": 255
        },
        "tags": {
          "example": [
            "vip"
          ],
          "description": "Full replace on updates; usable in segment rules",
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "maxItems": 100
        },
        "customFields": {
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000,
                "nullable": true
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "type": "string",
                  "maxLength": 1000
                }
              }
            ]
          },
          "example": {
            "loyaltyTier": "gold"
          },
          "description": "Map of up to 50 fields. Values may be strings (up to 1,000 characters), numbers, booleans, arrays of up to 100 strings, or null. Nested objects are not accepted. Keys must match ^[a-zA-Z_][a-zA-Z0-9_]{0,63}$; `__proto__`, `constructor`, and `prototype` are reserved. A null value deletes that key on update.",
          "maxProperties": 50
        },
        "marketingConsent": {
          "type": "string",
          "enum": [
            "OPTED_IN",
            "OPTED_OUT"
          ],
          "description": "Setting OPTED_IN attests that you collected the contact's marketing consent. OPTED_IN is rejected (422) when the contact previously opted out (e.g. texted STOP); OPTED_OUT is always accepted. Contacts default to UNKNOWN, and campaigns only send to OPTED_IN contacts."
        },
        "active": {
          "type": "boolean",
          "example": true,
          "description": "Set true to restore an archived contact"
        }
      },
      "additionalProperties": false,
      "minProperties": 1
    },
    "BaseAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "REPLY",
            "OPEN_URL",
            "DIAL_PHONE",
            "SHOW_LOCATION",
            "REQUEST_LOCATION",
            "CALENDAR_EVENT"
          ],
          "description": "Type of action"
        }
      },
      "required": [
        "id",
        "text",
        "type"
      ]
    },
    "BaseMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TEXT",
            "CONTENT",
            "RICH_CARD",
            "CAROUSEL"
          ],
          "description": "Type of message"
        },
        "globalSuggestions": {
          "type": "array",
          "description": "Global suggestions associated with the message. Limit 11 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 11
        }
      },
      "required": [
        "type"
      ]
    },
    "TextMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TEXT"
          ],
          "description": "Type of message"
        },
        "globalSuggestions": {
          "type": "array",
          "description": "Global suggestions associated with the message. Limit 11 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 11
        },
        "content": {
          "type": "string",
          "description": "Text content of the message",
          "minLength": 1
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "ContentMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "CONTENT"
          ],
          "description": "Type of message"
        },
        "globalSuggestions": {
          "type": "array",
          "description": "Global suggestions associated with the message. Limit 11 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 11
        },
        "contentUrl": {
          "type": "string",
          "description": "The publicly accessible URL of the file, for example, https://www.example.com/content.jpg",
          "minLength": 1
        }
      },
      "required": [
        "type",
        "contentUrl"
      ]
    },
    "RichCardBaseMessage": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Title of the rich card, Maximum 200 characters",
          "minLength": 1
        },
        "description": {
          "type": "string",
          "description": "Description of the rich card, Maximum 2000 characters"
        },
        "mediaUrl": {
          "type": "string",
          "description": "The publicly accessible URL of the image attachment. Supported types are .jpg, .jpeg, and .png"
        },
        "orientation": {
          "type": "string",
          "enum": [
            "VERTICAL",
            "HORIZONTAL"
          ],
          "description": "Orientation of the rich card"
        },
        "thumbnailPosition": {
          "type": "string",
          "enum": [
            "LEFT",
            "RIGHT"
          ],
          "description": "Position of the thumbnail"
        },
        "height": {
          "type": "string",
          "enum": [
            "SHORT",
            "MEDIUM",
            "TALL"
          ],
          "description": "Height of the rich card"
        },
        "localSuggestions": {
          "type": "array",
          "description": "Local suggestions associated with the rich card. Limit 4 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 4
        }
      },
      "required": [
        "title"
      ]
    },
    "RichCardMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "RICH_CARD"
          ],
          "description": "Type of message"
        },
        "globalSuggestions": {
          "type": "array",
          "description": "Global suggestions associated with the message. Limit 11 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 11
        },
        "item": {
          "description": "Rich card content",
          "allOf": [
            {
              "$ref": "#/components/schemas/RichCardBaseMessage"
            }
          ]
        }
      },
      "required": [
        "type",
        "item"
      ]
    },
    "CarouselMessage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "CAROUSEL"
          ],
          "description": "Type of message"
        },
        "globalSuggestions": {
          "type": "array",
          "description": "Global suggestions associated with the message. Limit 11 suggestions, max 25 characters each.",
          "items": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplyAction"
              },
              {
                "$ref": "#/components/schemas/OpenUrlAction"
              },
              {
                "$ref": "#/components/schemas/DialPhoneAction"
              },
              {
                "$ref": "#/components/schemas/ShowLocationAction"
              },
              {
                "$ref": "#/components/schemas/RequestLocationAction"
              },
              {
                "$ref": "#/components/schemas/CalendarEventAction"
              }
            ],
            "discriminator": {
              "propertyName": "type",
              "mapping": {
                "REPLY": "#/components/schemas/ReplyAction",
                "OPEN_URL": "#/components/schemas/OpenUrlAction",
                "DIAL_PHONE": "#/components/schemas/DialPhoneAction",
                "SHOW_LOCATION": "#/components/schemas/ShowLocationAction",
                "REQUEST_LOCATION": "#/components/schemas/RequestLocationAction",
                "CALENDAR_EVENT": "#/components/schemas/CalendarEventAction"
              }
            }
          },
          "maxItems": 11
        },
        "width": {
          "type": "string",
          "enum": [
            "SMALL",
            "MEDIUM"
          ],
          "description": "Width of the carousel"
        },
        "items": {
          "type": "array",
          "description": "Items in the carousel",
          "items": {
            "$ref": "#/components/schemas/RichCardBaseMessage"
          },
          "minItems": 2,
          "maxItems": 10
        }
      },
      "required": [
        "type",
        "width",
        "items"
      ]
    },
    "WebhookStatusReasonV1": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "description": "The reason for the status",
          "enum": [
            "REJECTED",
            "OPTED_OUT",
            "UNDELIVERABLE"
          ],
          "example": "REJECTED"
        },
        "description": {
          "type": "string",
          "description": "The description of the status reason",
          "example": "Resource size is too large"
        }
      },
      "required": [
        "reason"
      ]
    },
    "OutboundStatusV1": {
      "type": "object",
      "properties": {
        "smobiMessageId": {
          "type": "string",
          "description": "The reference number of the message in the Smobi system",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        },
        "clientRef": {
          "type": "string",
          "description": "The reference number of the message in the client system",
          "example": "client-ref-123"
        },
        "to": {
          "type": "string",
          "description": "The phone number of the recipient",
          "example": "15552223333"
        },
        "from": {
          "type": "string",
          "description": "The phone number of the sender",
          "example": "15551234567"
        },
        "status": {
          "type": "string",
          "description": "The status of the message",
          "enum": [
            "PROCESSING",
            "SENT",
            "FAILED",
            "DELIVERED",
            "READ"
          ],
          "example": "DELIVERED"
        },
        "channel": {
          "type": "string",
          "description": "The channel of the message",
          "enum": [
            "SMS",
            "RCS"
          ],
          "example": "SMS"
        },
        "timestamp": {
          "type": "string",
          "description": "The timestamp of the status update",
          "example": "2021-01-01T00:00:00.000Z"
        },
        "failureDetails": {
          "description": "Additional details about the status (for failed messages)",
          "allOf": [
            {
              "$ref": "#/components/schemas/WebhookStatusReasonV1"
            }
          ]
        }
      },
      "required": [
        "smobiMessageId",
        "clientRef",
        "to",
        "from",
        "status",
        "channel",
        "timestamp"
      ]
    },
    "SmobiOutboundSmsMessageContentV2": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Text content of the message",
          "example": "Hello, world!"
        },
        "downloadUrl": {
          "type": "string",
          "description": "Download URL of media content",
          "example": "https://api-us.nexmo.com/v3/media/ae1467c0-1485-4fe5-b627-2a82e6eb856b"
        },
        "fileExtension": {
          "type": "string",
          "description": "File extension of the media content",
          "example": "PNG"
        }
      }
    },
    "BaseOutboundMessageV2": {
      "type": "object",
      "properties": {
        "smobiMessageId": {
          "type": "string",
          "description": "The reference number of the message in the Smobi system",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        },
        "to": {
          "type": "string",
          "description": "The phone number of the recipient",
          "example": "15552223333"
        },
        "from": {
          "type": "string",
          "description": "The phone number of the sender",
          "example": "15551234567"
        },
        "channel": {
          "type": "string",
          "description": "The channel of the message - indicates which payload field to access",
          "enum": [
            "SMS",
            "RCS"
          ],
          "example": "SMS"
        },
        "timestamp": {
          "type": "string",
          "description": "The timestamp of the message",
          "example": "2021-01-01T00:00:00.000Z"
        },
        "sms": {
          "description": "SMS message content (present when channel is SMS)",
          "allOf": [
            {
              "$ref": "#/components/schemas/SmobiOutboundSmsMessageContentV2"
            }
          ]
        },
        "rcs": {
          "description": "RCS message content (present when channel is RCS)",
          "oneOf": [
            {
              "$ref": "#/components/schemas/SmobiTextMessageContentV2",
              "title": "Text"
            },
            {
              "$ref": "#/components/schemas/SmobiContentMessageContentV2",
              "title": "Content"
            },
            {
              "$ref": "#/components/schemas/SmobiLocationMessageContentV2",
              "title": "Location"
            },
            {
              "$ref": "#/components/schemas/SmobiSuggestionMessageContentV2",
              "title": "Suggestion"
            }
          ]
        }
      },
      "required": [
        "smobiMessageId",
        "to",
        "from",
        "channel",
        "timestamp"
      ]
    },
    "SmobiTextMessageContentV2": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TEXT"
          ],
          "description": "Type of message content",
          "example": "TEXT"
        },
        "content": {
          "type": "string",
          "description": "Text content",
          "example": "Hello, world!"
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "SmobiContentDetailsV2": {
      "type": "object",
      "properties": {
        "downloadUrl": {
          "type": "string",
          "description": "Download URL of the content",
          "example": "https://api-us.nexmo.com/v3/media/ae1467c0-1485-4fe5-b627-2a82e6eb856b"
        },
        "fileExtension": {
          "type": "string",
          "description": "File extension of the content, always present when downloadUrl is present",
          "example": "PNG"
        }
      },
      "required": [
        "downloadUrl",
        "fileExtension"
      ]
    },
    "SmobiContentMessageContentV2": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "CONTENT"
          ],
          "description": "Type of message content",
          "example": "CONTENT"
        },
        "content": {
          "description": "Content details",
          "allOf": [
            {
              "$ref": "#/components/schemas/SmobiContentDetailsV2"
            }
          ]
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "SmobiLocationDetailsV2": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number",
          "description": "Latitude of the location",
          "example": 37.7749
        },
        "longitude": {
          "type": "number",
          "description": "Longitude of the location",
          "example": -122.4194
        }
      },
      "required": [
        "latitude",
        "longitude"
      ]
    },
    "SmobiLocationMessageContentV2": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LOCATION"
          ],
          "description": "Type of message content",
          "example": "LOCATION"
        },
        "content": {
          "description": "Location details",
          "allOf": [
            {
              "$ref": "#/components/schemas/SmobiLocationDetailsV2"
            }
          ]
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "SmobiSuggestionDetailsV2": {
      "type": "object",
      "properties": {
        "parentSmobiMessageId": {
          "type": "string",
          "description": "The ID of the parent message in the Smobi system",
          "example": "123e4567-e89b-12d3-a456-426614174000"
        },
        "parentClientRef": {
          "type": "string",
          "description": "The client reference of the parent message",
          "example": "client-ref-123"
        },
        "suggestionId": {
          "type": "string",
          "description": "The ID of the selected suggestion",
          "example": "suggestion-123"
        },
        "text": {
          "type": "string",
          "description": "The text of the selected suggestion",
          "example": "Yes, I agree"
        }
      },
      "required": [
        "parentSmobiMessageId",
        "parentClientRef",
        "suggestionId",
        "text"
      ]
    },
    "SmobiSuggestionMessageContentV2": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "SUGGESTION"
          ],
          "description": "Type of message content - represents user interactions (reply/button)",
          "example": "SUGGESTION"
        },
        "content": {
          "description": "Suggestion interaction details",
          "allOf": [
            {
              "$ref": "#/components/schemas/SmobiSuggestionDetailsV2"
            }
          ]
        }
      },
      "required": [
        "type",
        "content"
      ]
    },
    "ReplyAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "REPLY"
          ],
          "description": "Type of action"
        }
      },
      "required": [
        "id",
        "text",
        "type"
      ]
    },
    "OpenUrlAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "OPEN_URL"
          ],
          "description": "Type of action"
        },
        "url": {
          "type": "string",
          "description": "The publicly accessible URL to open, for example, https://www.example.com"
        }
      },
      "required": [
        "id",
        "text",
        "type",
        "url"
      ]
    },
    "DialPhoneAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "DIAL_PHONE"
          ],
          "description": "Type of action"
        },
        "phoneNumber": {
          "type": "string",
          "description": "The phone number in E.164 format, for example, +12223334444"
        }
      },
      "required": [
        "id",
        "text",
        "type",
        "phoneNumber"
      ]
    },
    "ShowLocationAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "SHOW_LOCATION"
          ],
          "description": "Type of action"
        },
        "latitude": {
          "type": "string",
          "description": "The latitude in degrees. It must be in the range [-90.0, +90.0]."
        },
        "longitude": {
          "type": "string",
          "description": "The longitude in degrees. It must be in the range [-180.0, +180.0]."
        },
        "label": {
          "type": "string",
          "description": "The label of the location, for example, \"Home\", \"Work\", \"School\", etc."
        }
      },
      "required": [
        "id",
        "text",
        "type",
        "latitude",
        "longitude"
      ]
    },
    "RequestLocationAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "REQUEST_LOCATION"
          ],
          "description": "Type of action"
        }
      },
      "required": [
        "id",
        "text",
        "type"
      ]
    },
    "CalendarEventAction": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the action",
          "minLength": 1
        },
        "text": {
          "type": "string",
          "description": "Text to display for the action, Maximum 25 characters",
          "minLength": 1,
          "maxLength": 25
        },
        "type": {
          "type": "string",
          "enum": [
            "CALENDAR_EVENT"
          ],
          "description": "Type of action"
        },
        "eventTitle": {
          "type": "string",
          "description": "Event title. Maximum 100 characters"
        },
        "eventDescription": {
          "type": "string",
          "description": "Event description. Maximum 500 characters"
        },
        "startDate": {
          "format": "date-time",
          "type": "string",
          "description": "The start date of the event, in RFC 3339 format"
        },
        "endDate": {
          "format": "date-time",
          "type": "string",
          "description": "The end date of the event, in RFC 3339 format"
        }
      },
      "required": [
        "id",
        "text",
        "type",
        "eventTitle",
        "startDate",
        "endDate"
      ]
    }
  }
}
