{
  "openapi": "3.1.0",
  "info": {
    "title": "Signal House API",
    "version": "2",
    "description": "REST API for SMS, MMS, RCS, voice, 10DLC registration and phone numbers. Paths, path parameters and request bodies are generated from the API code; a request body marked x-source: docs comes from the docs instead. The Voice endpoints under /voice are served by the Voice service on the same host."
  },
  "servers": [
    {
      "url": "https://v2.signalhouse.io"
    }
  ],
  "externalDocs": {
    "url": "https://docs.signalhouse.io"
  },
  "tags": [
    {
      "name": "AI Agents",
      "description": "Create and manage AI agents with the Signal House API: profiles, prompts, voice, and model settings."
    },
    {
      "name": "Authentication",
      "description": "Authenticate with the Signal House API: API keys, login, sign-in with Google, Microsoft or Apple, token refresh, and password reset."
    },
    {
      "name": "Billing",
      "description": "Read your Signal House wallet balance, transactions and payment methods through the API."
    },
    {
      "name": "Brands",
      "description": "Register 10DLC brands with the Signal House API and track their registration status."
    },
    {
      "name": "Campaigns",
      "description": "Create, update and manage 10DLC campaigns through their lifecycle with the Signal House API."
    },
    {
      "name": "Compliance",
      "description": "Read the compliance cases on your campaigns, brands, numbers and RCS agents, answer their requirements, and upload files with the Signal House API."
    },
    {
      "name": "Groups",
      "description": "Manage top-level Signal House accounts, called groups, through the API."
    },
    {
      "name": "Landing",
      "description": "Create and manage Signal House landing pages through the API."
    },
    {
      "name": "Messages",
      "description": "Send SMS, MMS, group MMS and P2P messages with the Signal House API, and query message logs."
    },
    {
      "name": "Templates (RCS)",
      "description": "Store authored RCS messages as raw channel templates in your group with the Signal House API."
    },
    {
      "name": "RCS Agents",
      "description": "Build, test and launch RCS agents, the branded senders your RCS messages come from, with the Signal House API."
    },
    {
      "name": "Notifications",
      "description": "Manage in-app notification preferences and history through the Signal House API."
    },
    {
      "name": "Numbers",
      "description": "Search, purchase, configure, port and release phone numbers with the Signal House API."
    },
    {
      "name": "OAuth",
      "description": "Connect a third-party application to a Signal House account with OAuth, without handling the user's password or API key."
    },
    {
      "name": "Registrations",
      "description": "Discover what a country requires before a sender may message, get a quote, and file the registration with the Signal House API."
    },
    {
      "name": "Shortlinks",
      "description": "Create short URLs for your messages with the Signal House API."
    },
    {
      "name": "Subgroups",
      "description": "Create and manage subgroups within a Signal House group through the API."
    },
    {
      "name": "Subscriptions",
      "description": "Manage Signal House plans and subscriptions through the API."
    },
    {
      "name": "Users",
      "description": "Create, update and remove users, and manage their roles and profiles, with the Signal House API."
    },
    {
      "name": "Verify",
      "description": "Check a phone number with its mobile network through the Signal House API: SIM Swap and Number Verify."
    },
    {
      "name": "Voice",
      "description": "Signal House Voice: programmable calling, WebRTC softphones, SIP trunks and call analytics, served by the dedicated Voice service."
    },
    {
      "name": "Webhooks",
      "description": "Register webhook endpoints and choose the Signal House events they receive."
    }
  ],
  "paths": {
    "/.well-known/oauth-authorization-server": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Authorization server metadata (RFC 8414).",
        "description": "Authorization server metadata (RFC 8414). Point your OAuth client at this URL and it can configure itself.",
        "operationId": "oauth.readAuthorizationServerMetadata",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Protected resource metadata.",
        "description": "Protected resource metadata. Tells a client which authorization server guards this API.",
        "operationId": "oauth.readProtectedResourceMetadata",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/agent/conversations": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Start a conversation without sending a message.",
        "description": "Start a conversation without sending a message. The counterpart to POST /agent/messages for callers that run the model themselves — a voice runtime, or your own LLM. Those record what was said; /agent/messages decides it. Both write the same conversation records, so a transcript reads identically either way.",
        "operationId": "agent.startConversation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartConversationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "conversationSessionId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "webchat",
                        "sms"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "completed",
                        "escalated",
                        "abandoned"
                      ]
                    },
                    "contactIdentifier": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "callId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "messageCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "conversationId": "CNV0000002",
                  "conversationSessionId": "CVS0000004",
                  "agentProfileId": "AGP0000001",
                  "channel": "voice",
                  "status": "active",
                  "contactIdentifier": "+15555550123",
                  "callId": "CALL_12345",
                  "messageCount": 0
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/conversations/{conversationId}": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Read one conversation with a page of its messages, in sequence order.",
        "description": "Read one conversation with a page of its messages, in sequence order. Paged rather than whole — a transcript has no natural ceiling, so omitting limit returns the first 100 messages, not all of them.",
        "operationId": "agent.readConversation",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The conversation to read."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number; defaults to 1.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Messages per page; defaults to 100, capped at 500.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "conversationId": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "webchat",
                          "sms"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "completed",
                          "escalated",
                          "abandoned"
                        ]
                      },
                      "messageCount": {
                        "type": "integer"
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "conversationMessageId": {
                              "type": "string"
                            },
                            "sequence": {
                              "type": "integer"
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "user",
                                "assistant",
                                "system",
                                "tool"
                              ]
                            },
                            "content": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": [
                  {
                    "conversationId": "CNV0000002",
                    "agentProfileId": "AGP0000001",
                    "channel": "voice",
                    "status": "completed",
                    "messageCount": 2,
                    "messages": [
                      {
                        "conversationMessageId": "CVM0000001",
                        "sequence": 0,
                        "role": "assistant",
                        "content": "Thanks for calling — how can I help?"
                      },
                      {
                        "conversationMessageId": "CVM0000002",
                        "sequence": 1,
                        "role": "user",
                        "content": "I'd like to check my order."
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "End a conversation, closing its open session.",
        "description": "End a conversation, closing its open session. status records HOW it ended and cannot be recovered afterwards, so send the one that actually happened. The transition is conditional on the conversation still being active, so an already-ended conversation is returned unchanged and concurrent retries cannot overwrite the status that landed first. The call that ends it fires AI_AGENT_CONVERSATION_ENDED to every Global webhook subscribed to it, once; a retried end fires nothing. SMS conversations nobody has texted in for 24 hours are ended for you, with endReason idle_timeout. Voice conversations can't be ended here: the voice service ends each one when its call ends, and their length is what the call's AI Voice Agent charge is based on, so ending one returns 403.",
        "operationId": "agent.endConversation",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The conversation to end. Not a voice conversation (403)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndConversationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "webchat",
                        "sms"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "completed",
                        "escalated",
                        "abandoned"
                      ]
                    },
                    "endedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "messageCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "conversationId": "CNV0000002",
                  "agentProfileId": "AGP0000001",
                  "channel": "webchat",
                  "status": "escalated",
                  "endedAt": "2026-09-17T18:42:11.000Z",
                  "messageCount": 2
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/conversations/{conversationId}/messages": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Append one message to a conversation.",
        "description": "Append one message to a conversation. Records a turn rather than generating one, so role is explicit — an assistant turn your own runtime produced is the normal case here. content is optional, so a tool-only turn needs no prose. Appending to a conversation that has already ended is rejected.",
        "operationId": "agent.appendConversationMessage",
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The conversation to append to."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppendConversationMessageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversationMessageId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": "string"
                    },
                    "conversationSessionId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sequence": {
                      "type": "integer"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "user",
                        "assistant",
                        "system",
                        "tool"
                      ]
                    },
                    "content": {
                      "type": "string"
                    },
                    "ttfbMs": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "conversationMessageId": "CVM0000001",
                  "conversationId": "CNV0000002",
                  "conversationSessionId": "CVS0000004",
                  "sequence": 0,
                  "role": "assistant",
                  "content": "Thanks for calling — how can I help?",
                  "ttfbMs": 420
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List held agent replies (the Pending Replies queue) in a group, newest first.",
        "description": "List held agent replies (the Pending Replies queue) in a group, newest first. An SMS agent holds a reply instead of sending it when its send authority is \"review\", and also on auto-pilot when it is unsure (the turn fell back, it asked for a human, or a guardrail flagged the reply) or when it is quiet hours for the contact (reason \"quiet_hours\": 8:45 pm to 9 am in the contact's time zone, judged from the area code). Every reply an SMS agent writes to an inbound text is recorded here: a confident auto-pilot reply has reason \"autopilot\" and is meant to be delivered without waiting for a person, by claiming it and reporting the outcome. An empty array is returned when nothing matches.",
        "operationId": "agent.readAgentReplyDrafts",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group whose drafts to list. Must start with \"G\" and be at least 8 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to the drafts of numbers in this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentProfileId",
            "in": "query",
            "required": false,
            "description": "Narrow to the drafts this agent wrote.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Narrow to one status: \"pending\", \"sending\", \"sent\", \"rejected\" or \"failed\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (default: 25, max 500).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "agentReplyDraftId": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "conversationId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "sms"
                        ]
                      },
                      "endpointValue": {
                        "type": "string"
                      },
                      "contactPhoneNumber": {
                        "type": "string"
                      },
                      "inboundText": {
                        "type": "string"
                      },
                      "draftText": {
                        "type": "string"
                      },
                      "sentText": {},
                      "reason": {
                        "type": "string",
                        "enum": [
                          "review_mode",
                          "escalation",
                          "fallback",
                          "guardrail",
                          "quiet_hours",
                          "autopilot"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "sending",
                          "sent",
                          "rejected",
                          "failed"
                        ]
                      },
                      "decidedBy": {},
                      "decidedAt": {},
                      "sentMessageId": {},
                      "deliveredBy": {},
                      "failureReason": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "66f8c3b2d0e88d001b3c4e31",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "agentReplyDraftId": "ARD0000001",
                    "agentProfileId": "AGP0000001",
                    "conversationId": "CNV0000001",
                    "channel": "sms",
                    "endpointValue": "15551234567",
                    "contactPhoneNumber": "15557654321",
                    "inboundText": "Do you have any openings tomorrow?",
                    "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                    "sentText": null,
                    "reason": "review_mode",
                    "status": "pending",
                    "decidedBy": null,
                    "decidedAt": null,
                    "sentMessageId": null,
                    "deliveredBy": null,
                    "failureReason": null,
                    "createdAt": "2026-10-06T15:00:00.000Z",
                    "updatedAt": "2026-10-06T15:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts/{agentReplyDraftId}/approve": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Approve a held agent reply and send it from the agent's number to the contact, optionally with edited text.",
        "description": "Approve a held agent reply and send it from the agent's number to the contact, optionally with edited text. The reply goes through the normal SMS send path, so opt-out, moderation and billing apply. The draft comes back with status \"sent\" and sentMessageId set, or with status \"failed\" when the send path accepted nothing (for example, the contact opted out). sentText is the text actually sent. Only a pending draft can be approved. If the send path returns an error, that error is returned and the draft goes back to pending.",
        "operationId": "agent.approveAgentReplyDraft",
        "parameters": [
          {
            "name": "agentReplyDraftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The draft to approve (\"ARD...\")."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveAgentReplyDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentReplyDraftId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactPhoneNumber": {
                      "type": "string"
                    },
                    "inboundText": {
                      "type": "string"
                    },
                    "draftText": {
                      "type": "string"
                    },
                    "sentText": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "review_mode",
                        "escalation",
                        "fallback",
                        "guardrail",
                        "quiet_hours",
                        "autopilot"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "sending",
                        "sent",
                        "rejected",
                        "failed"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentMessageId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deliveredBy": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "signalhouse",
                        "external",
                        null
                      ]
                    },
                    "claimId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f8c3b2d0e88d001b3c4e31",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentReplyDraftId": "ARD0000001",
                  "agentProfileId": "AGP0000001",
                  "conversationId": "CNV0000001",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactPhoneNumber": "15557654321",
                  "inboundText": "Do you have any openings tomorrow?",
                  "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                  "sentText": "We have openings at 10am and 2pm tomorrow. Reply 1 or 2 to book.",
                  "reason": "review_mode",
                  "status": "sent",
                  "decidedBy": "60f7b2a1c9e77c001a2b3c4d",
                  "decidedAt": "2026-10-06T15:05:00.000Z",
                  "sentMessageId": "66f8c4a0d0e88d001b3c4e40",
                  "deliveredBy": "signalhouse",
                  "claimId": "0c9d8e7f-6a5b-4c3d-8e2f-1a0b9c8d7e6f",
                  "failureReason": null,
                  "createdAt": "2026-10-06T15:00:00.000Z",
                  "updatedAt": "2026-10-06T15:05:01.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts/{agentReplyDraftId}/claim": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Claim a held agent reply for delivery through your own channel instead of Signal House's send path.",
        "description": "Claim a held agent reply for delivery through your own channel instead of Signal House's send path. Nothing is sent. The draft becomes \"sending\" with deliveredBy \"external\", sentText set to the text you will deliver, and a new claimId, and you then report the outcome with /complete or /release, sending that claimId. The claim means two approvals can never both deliver. Only a pending draft can be claimed. If the agent's number has left the draft's subgroup, the draft is closed as \"failed\" and a 400 is returned. A claim left unfinished for 30 minutes is closed as \"failed\" with failureReason \"delivery_unconfirmed\", so it is never offered again.",
        "operationId": "agent.claimAgentReplyDraft",
        "parameters": [
          {
            "name": "agentReplyDraftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The draft to claim (\"ARD...\")."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveAgentReplyDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentReplyDraftId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactPhoneNumber": {
                      "type": "string"
                    },
                    "inboundText": {
                      "type": "string"
                    },
                    "draftText": {
                      "type": "string"
                    },
                    "sentText": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "review_mode",
                        "escalation",
                        "fallback",
                        "guardrail",
                        "quiet_hours",
                        "autopilot"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "sending",
                        "sent",
                        "rejected",
                        "failed"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentMessageId": {},
                    "deliveredBy": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "signalhouse",
                        "external",
                        null
                      ]
                    },
                    "claimId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f8c3b2d0e88d001b3c4e31",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentReplyDraftId": "ARD0000001",
                  "agentProfileId": "AGP0000001",
                  "conversationId": "CNV0000001",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactPhoneNumber": "15557654321",
                  "inboundText": "Do you have any openings tomorrow?",
                  "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                  "sentText": "We have openings at 10am and 2pm tomorrow. Reply 1 or 2 to book.",
                  "reason": "review_mode",
                  "status": "sending",
                  "decidedBy": "60f7b2a1c9e77c001a2b3c4d",
                  "decidedAt": "2026-10-06T15:05:00.000Z",
                  "sentMessageId": null,
                  "deliveredBy": "external",
                  "claimId": "7b6f1d2e-3c4a-4f5b-9e8d-1a2b3c4d5e6f",
                  "failureReason": null,
                  "createdAt": "2026-10-06T15:00:00.000Z",
                  "updatedAt": "2026-10-06T15:05:01.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts/{agentReplyDraftId}/complete": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Mark a claimed agent reply as sent once your channel accepted it.",
        "description": "Mark a claimed agent reply as sent once your channel accepted it. The draft becomes \"sent\". Only the claim named by claimId can be completed, so a late call can never settle a newer claim. A completion is also accepted after an unfinished claim was closed as \"failed\" with failureReason \"delivery_unconfirmed\", and turns it into \"sent\".",
        "operationId": "agent.completeAgentReplyDraft",
        "parameters": [
          {
            "name": "agentReplyDraftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The claimed draft (\"ARD...\")."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteExternalAgentReplyDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentReplyDraftId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactPhoneNumber": {
                      "type": "string"
                    },
                    "inboundText": {
                      "type": "string"
                    },
                    "draftText": {
                      "type": "string"
                    },
                    "sentText": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reason": {
                      "type": "string",
                      "enum": [
                        "review_mode",
                        "escalation",
                        "fallback",
                        "guardrail",
                        "quiet_hours",
                        "autopilot"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "sending",
                        "sent",
                        "rejected",
                        "failed"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentMessageId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deliveredBy": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "signalhouse",
                        "external",
                        null
                      ]
                    },
                    "claimId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f8c3b2d0e88d001b3c4e31",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentReplyDraftId": "ARD0000001",
                  "agentProfileId": "AGP0000001",
                  "conversationId": "CNV0000001",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactPhoneNumber": "15557654321",
                  "inboundText": "Do you have any openings tomorrow?",
                  "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                  "sentText": "We have openings at 10am and 2pm tomorrow. Reply 1 or 2 to book.",
                  "reason": "review_mode",
                  "status": "sent",
                  "decidedBy": "60f7b2a1c9e77c001a2b3c4d",
                  "decidedAt": "2026-10-06T15:05:00.000Z",
                  "sentMessageId": "ext-msg-12345",
                  "deliveredBy": "external",
                  "claimId": "7b6f1d2e-3c4a-4f5b-9e8d-1a2b3c4d5e6f",
                  "failureReason": null,
                  "createdAt": "2026-10-06T15:00:00.000Z",
                  "updatedAt": "2026-10-06T15:05:01.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts/{agentReplyDraftId}/reject": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Reject a held agent reply so it is never sent.",
        "description": "Reject a held agent reply so it is never sent. The rejected draft is returned with status \"rejected\". Only a pending draft can be rejected. No request body.",
        "operationId": "agent.rejectAgentReplyDraft",
        "parameters": [
          {
            "name": "agentReplyDraftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The draft to reject (\"ARD...\")."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentReplyDraftId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactPhoneNumber": {
                      "type": "string"
                    },
                    "inboundText": {
                      "type": "string"
                    },
                    "draftText": {
                      "type": "string"
                    },
                    "sentText": {},
                    "reason": {
                      "type": "string",
                      "enum": [
                        "review_mode",
                        "escalation",
                        "fallback",
                        "guardrail",
                        "quiet_hours",
                        "autopilot"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "sending",
                        "sent",
                        "rejected",
                        "failed"
                      ]
                    },
                    "decidedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "decidedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentMessageId": {},
                    "deliveredBy": {},
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f8c3b2d0e88d001b3c4e31",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentReplyDraftId": "ARD0000001",
                  "agentProfileId": "AGP0000001",
                  "conversationId": "CNV0000001",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactPhoneNumber": "15557654321",
                  "inboundText": "Do you have any openings tomorrow?",
                  "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                  "sentText": null,
                  "reason": "review_mode",
                  "status": "rejected",
                  "decidedBy": "60f7b2a1c9e77c001a2b3c4d",
                  "decidedAt": "2026-10-06T15:05:00.000Z",
                  "sentMessageId": null,
                  "deliveredBy": null,
                  "failureReason": null,
                  "createdAt": "2026-10-06T15:00:00.000Z",
                  "updatedAt": "2026-10-06T15:05:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/drafts/{agentReplyDraftId}/release": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Give back a claim whose reply certainly did not go out.",
        "description": "Give back a claim whose reply certainly did not go out. The draft returns to \"pending\" so it can be approved again, or with permanent set to true it is closed as \"failed\". If you cannot tell whether the reply went out, do not release it: an unfinished claim is closed after 30 minutes as \"failed\" with failureReason \"delivery_unconfirmed\", so it is never sent twice. Only the claim named by claimId can be released.",
        "operationId": "agent.releaseAgentReplyDraft",
        "parameters": [
          {
            "name": "agentReplyDraftId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The claimed draft (\"ARD...\")."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReleaseExternalAgentReplyDraftRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentReplyDraftId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "conversationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "sms"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactPhoneNumber": {
                      "type": "string"
                    },
                    "inboundText": {
                      "type": "string"
                    },
                    "draftText": {
                      "type": "string"
                    },
                    "sentText": {},
                    "reason": {
                      "type": "string",
                      "enum": [
                        "review_mode",
                        "escalation",
                        "fallback",
                        "guardrail",
                        "quiet_hours",
                        "autopilot"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "sending",
                        "sent",
                        "rejected",
                        "failed"
                      ]
                    },
                    "decidedBy": {},
                    "decidedAt": {},
                    "sentMessageId": {},
                    "deliveredBy": {},
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f8c3b2d0e88d001b3c4e31",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentReplyDraftId": "ARD0000001",
                  "agentProfileId": "AGP0000001",
                  "conversationId": "CNV0000001",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactPhoneNumber": "15557654321",
                  "inboundText": "Do you have any openings tomorrow?",
                  "draftText": "We have openings at 10am and 2pm tomorrow. Want me to book one?",
                  "sentText": null,
                  "reason": "review_mode",
                  "status": "pending",
                  "decidedBy": null,
                  "decidedAt": null,
                  "sentMessageId": null,
                  "deliveredBy": null,
                  "failureReason": null,
                  "createdAt": "2026-10-06T15:00:00.000Z",
                  "updatedAt": "2026-10-06T15:05:01.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/endpoints": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the endpoint bindings in a group: which agent answers which number.",
        "description": "List the endpoint bindings in a group: which agent answers which number. Each number has at most one agent per channel. Results are ordered by endpointValue, and an empty array is returned when nothing is bound.",
        "operationId": "agent.readAgentEndpoints",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group whose bindings to list. Must start with \"G\" and be at least 8 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to the bindings of numbers in this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentProfileId",
            "in": "query",
            "required": false,
            "description": "Narrow to the numbers this agent answers.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Narrow to one channel — \"sms\", \"webchat\", or \"voice\". Only \"sms\" bindings can be created today.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "agentEndpointId": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "webchat",
                          "sms"
                        ]
                      },
                      "endpointType": {
                        "type": "string",
                        "enum": [
                          "did",
                          "webchat_widget",
                          "sms_number"
                        ]
                      },
                      "endpointValue": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "answerMode": {
                        "type": "string",
                        "enum": [
                          "all_inbound"
                        ]
                      },
                      "overrides": {},
                      "enabled": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "66f7b2a1c9e77c001a2b3d20",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "agentEndpointId": "AEP0000001",
                    "channel": "sms",
                    "endpointType": "sms_number",
                    "endpointValue": "15551234567",
                    "agentProfileId": "AGP0000001",
                    "answerMode": "all_inbound",
                    "overrides": null,
                    "enabled": true,
                    "createdAt": "2026-10-06T14:00:00.000Z",
                    "updatedAt": "2026-10-06T14:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/endpoints/{channel}/{endpointValue}": {
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Assign an agent to answer a number (upsert keyed by the channel and number in the path).",
        "description": "Assign an agent to answer a number (upsert keyed by the channel and number in the path). Assigning again replaces the previous agent, so a number has one agent per channel. Only SMS numbers can be bound today. The number must be in the agent's group and belong to a subgroup, and the agent must be active and usable by that subgroup: either the subgroup's own agent, or a group-level agent with an enabled deployment to the subgroup. The binding is saved whatever the number's campaign state.",
        "operationId": "agent.upsertAgentEndpoint",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The channel to bind. Must be \"sms\"."
          },
          {
            "name": "endpointValue",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number: 10 to 15 digits, country code included, no \"+\" (e.g. 15551234567)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertAgentEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentEndpointId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "webchat",
                        "sms"
                      ]
                    },
                    "endpointType": {
                      "type": "string",
                      "enum": [
                        "did",
                        "webchat_widget",
                        "sms_number"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "answerMode": {
                      "type": "string",
                      "enum": [
                        "all_inbound"
                      ]
                    },
                    "overrides": {},
                    "enabled": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d20",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentEndpointId": "AEP0000001",
                  "channel": "sms",
                  "endpointType": "sms_number",
                  "endpointValue": "15551234567",
                  "agentProfileId": "AGP0000001",
                  "answerMode": "all_inbound",
                  "overrides": null,
                  "enabled": true,
                  "createdAt": "2026-10-06T14:00:00.000Z",
                  "updatedAt": "2026-10-06T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Remove the agent assigned to a number.",
        "description": "Remove the agent assigned to a number. The removed binding is returned. The agent and its deployments are not changed.",
        "operationId": "agent.deleteAgentEndpoint",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The bound channel. Must be \"sms\"."
          },
          {
            "name": "endpointValue",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number: 10 to 15 digits, country code included, no \"+\"."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentEndpointId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "webchat",
                        "sms"
                      ]
                    },
                    "endpointType": {
                      "type": "string",
                      "enum": [
                        "did",
                        "webchat_widget",
                        "sms_number"
                      ]
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "answerMode": {
                      "type": "string",
                      "enum": [
                        "all_inbound"
                      ]
                    },
                    "overrides": {},
                    "enabled": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d20",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentEndpointId": "AEP0000001",
                  "channel": "sms",
                  "endpointType": "sms_number",
                  "endpointValue": "15551234567",
                  "agentProfileId": "AGP0000001",
                  "answerMode": "all_inbound",
                  "overrides": null,
                  "enabled": true,
                  "createdAt": "2026-10-06T14:00:00.000Z",
                  "updatedAt": "2026-10-06T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/knowledge": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the knowledge-base items an agent can answer from (RAG).",
        "description": "List the knowledge-base items an agent can answer from (RAG). Scoped to a group; optionally narrowed to a subgroup and/or a single agent. The raw text is stored and Atlas Vector Search owns the embedding.",
        "operationId": "agent.readKnowledgeItems",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group whose knowledge to list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to a subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentProfileId",
            "in": "query",
            "required": false,
            "description": "Narrow to one agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based) for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page (max 100; default 25).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "knowledgeItemId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {},
                      "title": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "manual",
                          "url",
                          "document",
                          "import"
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "knowledgeItemId": "KNW0000001",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": null,
                    "title": "Business hours",
                    "text": "We are open Monday to Friday, 9am to 5pm.",
                    "source": "manual",
                    "enabled": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Create a knowledge item.",
        "description": "Create a knowledge item. Store the raw text only — Atlas Vector Search generates and owns the embedding, so there is no vector to supply.",
        "operationId": "agent.createKnowledgeItem",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeItemRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "knowledgeItemId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {},
                    "title": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "manual",
                        "url",
                        "document",
                        "import"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "knowledgeItemId": "KNW0000001",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": null,
                  "title": "Business hours",
                  "text": "We are open Monday to Friday, 9am to 5pm.",
                  "source": "manual",
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/knowledge/{id}": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Get a single knowledge item by ID.",
        "description": "Get a single knowledge item by ID.",
        "operationId": "agent.readKnowledgeItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Knowledge item ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "knowledgeItemId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {},
                      "title": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "source": {
                        "type": "string",
                        "enum": [
                          "manual",
                          "url",
                          "document",
                          "import"
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "knowledgeItemId": "KNW0000001",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": null,
                    "title": "Business hours",
                    "text": "We are open Monday to Friday, 9am to 5pm.",
                    "source": "manual",
                    "enabled": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Update a knowledge item.",
        "description": "Update a knowledge item. The item’s scope (group/subgroup/agent) is immutable and cannot be changed.",
        "operationId": "agent.updateKnowledgeItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Knowledge item ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateKnowledgeItemRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "knowledgeItemId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "manual",
                        "url",
                        "document",
                        "import"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "knowledgeItemId": "KNW0000001",
                  "groupId": "G1234567",
                  "title": "Business hours",
                  "text": "We are open Monday to Saturday, 8am to 6pm.",
                  "source": "manual",
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Delete a knowledge item by its ID.",
        "description": "Delete a knowledge item by its ID.",
        "operationId": "agent.deleteKnowledgeItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Knowledge item ID to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Knowledge item KNW0000001 deleted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/messages": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Send a message to an agent and get its reply — the app-native conversation endpoint for webchat and SMS.",
        "description": "Send a message to an agent and get its reply — the app-native conversation endpoint for webchat and SMS. Omit conversationId to start a new conversation, or pass one to continue an existing one. The agent's LLM tool loop runs server-side: the reply and any tools it invoked are returned, and the conversation turns are persisted. When the channel has knowledge_search enabled, the server searches the agent's knowledge with the message before the model runs, so toolInvocations starts with that knowledge_search entry even if the model made no tool call of its own. check_business_hours results carry hoursConfigured, plus isOpen, timezone and hours (the weekly schedule) when hours are set, or a note, the agent's knowledge about hours, and no isOpen when none are.",
        "operationId": "agent.sendAgentMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentProfileId": {
                    "type": "string",
                    "description": "The agent to talk to."
                  },
                  "channel": {
                    "type": "string",
                    "description": "Conversation channel — \"webchat\", \"sms\", or \"voice\"."
                  },
                  "message": {
                    "type": "string",
                    "description": "The user's message."
                  },
                  "conversationId": {
                    "type": "string",
                    "description": "Continue this conversation; omit to start a new one."
                  },
                  "contactIdentifier": {
                    "type": "string",
                    "description": "The far-end identifier (webchat visitor ID or sender number)."
                  }
                },
                "required": [
                  "agentProfileId",
                  "channel",
                  "message"
                ]
              },
              "example": {
                "agentProfileId": "AGP0000001",
                "channel": "webchat",
                "message": "Are you open right now?"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversationId": {
                      "type": "string"
                    },
                    "conversationSessionId": {
                      "type": "string"
                    },
                    "reply": {
                      "type": "string"
                    },
                    "toolInvocations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "input": {
                            "type": "object",
                            "properties": {}
                          },
                          "result": {
                            "type": "object",
                            "properties": {
                              "ok": {
                                "type": "boolean"
                              },
                              "hoursConfigured": {
                                "type": "boolean"
                              },
                              "isOpen": {
                                "type": "boolean"
                              },
                              "timezone": {
                                "type": "string"
                              },
                              "hours": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "day": {
                                      "type": "string"
                                    },
                                    "closed": {
                                      "type": "boolean"
                                    },
                                    "open": {
                                      "type": "string"
                                    },
                                    "close": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "afterHoursMessage": {}
                            }
                          }
                        }
                      }
                    },
                    "ok": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "conversationId": "CNV0000002",
                  "conversationSessionId": "CVS0000004",
                  "reply": "Yes, we're open right now! How can we help you today?",
                  "toolInvocations": [
                    {
                      "name": "check_business_hours",
                      "input": {},
                      "result": {
                        "ok": true,
                        "hoursConfigured": true,
                        "isOpen": true,
                        "timezone": "America/New_York",
                        "hours": [
                          {
                            "day": "monday",
                            "closed": false,
                            "open": "09:00",
                            "close": "17:00"
                          }
                        ],
                        "afterHoursMessage": null
                      }
                    }
                  ],
                  "ok": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/pauses": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the paused agent conversations in a group, newest first.",
        "description": "List the paused agent conversations in a group, newest first. A conversation is paused when a person takes it over (reason human_reply or manual) or when the agent asks for a person (reason escalation): the agent does not answer that contact on that number until the conversation is resumed. An empty array is returned when nothing is paused.",
        "operationId": "agent.readAgentContactPauses",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group whose paused conversations to list. Must start with \"G\" and be at least 8 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to conversations on this subgroup's numbers.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Narrow to one channel. Must be \"sms\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpointValue",
            "in": "query",
            "required": false,
            "description": "Narrow to one agent number: 10 to 15 digits, country code included, no \"+\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contactIdentifier",
            "in": "query",
            "required": false,
            "description": "Narrow to one contact number: 10 to 15 digits, country code included, no \"+\".",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string"
                      },
                      "endpointValue": {
                        "type": "string"
                      },
                      "contactIdentifier": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "pausedBy": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "66f7b2a1c9e77c001a2b3d30",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "channel": "sms",
                    "endpointValue": "15551234567",
                    "contactIdentifier": "15557654321",
                    "reason": "human_reply",
                    "pausedBy": "507f1f77bcf86cd799439011",
                    "createdAt": "2026-10-27T15:00:00.000Z",
                    "updatedAt": "2026-10-27T15:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/pauses/{channel}/{endpointValue}/{contactIdentifier}": {
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Pause the agent on one conversation: the number it answers and one contact.",
        "description": "Pause the agent on one conversation: the number it answers and one contact. The agent stops answering that contact on that number until the conversation is resumed; there is no timer. Use it when a person replies to the contact by hand. The conversation's pending replies (see GET /agent/drafts) are rejected, so none is sent after the person's. Pausing a paused conversation keeps the original pause and returns it. An agent must be assigned to the number.",
        "operationId": "agent.pauseAgentConversation",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The channel. Must be \"sms\"."
          },
          {
            "name": "endpointValue",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent's number: 10 to 15 digits, country code included, no \"+\"."
          },
          {
            "name": "contactIdentifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The contact's number: 10 to 15 digits, country code included, no \"+\"."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PauseAgentConversationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactIdentifier": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "pausedBy": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d30",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactIdentifier": "15557654321",
                  "reason": "human_reply",
                  "pausedBy": "507f1f77bcf86cd799439011",
                  "createdAt": "2026-10-27T15:00:00.000Z",
                  "updatedAt": "2026-10-27T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Resume the agent on a paused conversation, so it answers the contact's next text again.",
        "description": "Resume the agent on a paused conversation, so it answers the contact's next text again. This also ends the hold an escalation put on the conversation. Replies rejected by the pause stay rejected. The removed pause is returned.",
        "operationId": "agent.resumeAgentConversation",
        "parameters": [
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The channel. Must be \"sms\"."
          },
          {
            "name": "endpointValue",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent's number: 10 to 15 digits, country code included, no \"+\"."
          },
          {
            "name": "contactIdentifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The contact's number: 10 to 15 digits, country code included, no \"+\"."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "endpointValue": {
                      "type": "string"
                    },
                    "contactIdentifier": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "pausedBy": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d30",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "channel": "sms",
                  "endpointValue": "15551234567",
                  "contactIdentifier": "15557654321",
                  "reason": "human_reply",
                  "pausedBy": "507f1f77bcf86cd799439011",
                  "createdAt": "2026-10-27T15:00:00.000Z",
                  "updatedAt": "2026-10-27T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/profiles": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the AI agent profiles under a group.",
        "description": "List the AI agent profiles under a group. Results are scoped to groups the authenticated caller can access.",
        "operationId": "agent.readAgentProfiles",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group whose agent profiles to list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to the agents this subgroup can use — its own, plus the group-level agents shared with every subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (1–1000).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "inactive"
                        ]
                      },
                      "systemPrompt": {
                        "type": "string"
                      },
                      "greeting": {
                        "type": "string"
                      },
                      "guardrails": {
                        "type": "string"
                      },
                      "sendAuthority": {
                        "type": "string",
                        "enum": [
                          "review",
                          "autopilot"
                        ]
                      },
                      "publishStatus": {
                        "type": "string",
                        "enum": [
                          "draft",
                          "published"
                        ]
                      },
                      "publishedAt": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c9a",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": "AGP0000001",
                    "name": "Support Bot",
                    "status": "active",
                    "systemPrompt": "You are a helpful support agent for Acme.",
                    "greeting": "Hi! How can I help you today?",
                    "guardrails": "",
                    "sendAuthority": "review",
                    "publishStatus": "draft",
                    "publishedAt": null,
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Create a new AI agent profile.",
        "description": "Create a new AI agent profile.",
        "operationId": "agent.createAgentProfile",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentProfileRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "inactive"
                      ]
                    },
                    "systemPrompt": {
                      "type": "string"
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "guardrails": {
                      "type": "string"
                    },
                    "sendAuthority": {
                      "type": "string",
                      "enum": [
                        "review",
                        "autopilot"
                      ]
                    },
                    "publishStatus": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "published"
                      ]
                    },
                    "publishedAt": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c9a",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": "AGP0000001",
                  "name": "Support Bot",
                  "status": "active",
                  "systemPrompt": "You are a helpful support agent for Acme.",
                  "greeting": "Hi! How can I help you today?",
                  "guardrails": "",
                  "sendAuthority": "review",
                  "publishStatus": "draft",
                  "publishedAt": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/channels": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List an agent's per-channel settings — the tools enabled on each channel, whether the channel is on, and any channel-specific prompt/greeting.",
        "description": "List an agent's per-channel settings — the tools enabled on each channel, whether the channel is on, and any channel-specific prompt/greeting.",
        "operationId": "agent.readAgentChannelSettings",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent whose channel settings to list."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "agentChannelSettingId": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "webchat",
                          "sms"
                        ]
                      },
                      "allowedTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "channelPrompt": {
                        "type": "string"
                      },
                      "greeting": {},
                      "llmProvider": {
                        "type": "string",
                        "enum": [
                          "bedrock",
                          "openai",
                          "anthropic",
                          "groq"
                        ]
                      },
                      "llmModel": {},
                      "temperature": {
                        "type": "number"
                      },
                      "voiceId": {},
                      "speed": {},
                      "stability": {},
                      "similarityBoost": {},
                      "speechModel": {},
                      "turnEagerness": {},
                      "turnTimeoutSeconds": {},
                      "initialWaitSeconds": {},
                      "silenceEndCallSeconds": {},
                      "maxCallDurationSeconds": {},
                      "allowGreetingInterruption": {
                        "type": "boolean"
                      },
                      "keyterms": {
                        "type": "array",
                        "items": {}
                      },
                      "allowedCommitments": {
                        "type": "array",
                        "items": {}
                      },
                      "backgroundSound": {},
                      "workflow": {}
                    }
                  }
                },
                "example": [
                  {
                    "agentChannelSettingId": "ACS0000001",
                    "agentProfileId": "AGP0000001",
                    "channel": "webchat",
                    "allowedTools": [
                      "check_business_hours",
                      "knowledge_search"
                    ],
                    "enabled": true,
                    "channelPrompt": "",
                    "greeting": null,
                    "llmProvider": "bedrock",
                    "llmModel": null,
                    "temperature": 0.7,
                    "voiceId": null,
                    "speed": null,
                    "stability": null,
                    "similarityBoost": null,
                    "speechModel": null,
                    "turnEagerness": null,
                    "turnTimeoutSeconds": null,
                    "initialWaitSeconds": null,
                    "silenceEndCallSeconds": null,
                    "maxCallDurationSeconds": null,
                    "allowGreetingInterruption": true,
                    "keyterms": [],
                    "allowedCommitments": [],
                    "backgroundSound": null,
                    "workflow": null
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/channels/{channel}": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Get a single per-channel setting for an agent.",
        "description": "Get a single per-channel setting for an agent.",
        "operationId": "agent.readAgentChannelSetting",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent the setting belongs to."
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Channel — \"webchat\", \"sms\", or \"voice\"."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "agentChannelSettingId": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "channel": {
                        "type": "string",
                        "enum": [
                          "voice",
                          "webchat",
                          "sms"
                        ]
                      },
                      "allowedTools": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "agentChannelSettingId": "ACS0000001",
                    "agentProfileId": "AGP0000001",
                    "channel": "webchat",
                    "allowedTools": [
                      "check_business_hours"
                    ],
                    "enabled": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Create or update (upsert) an agent's per-channel setting.",
        "description": "Create or update (upsert) an agent's per-channel setting. One row per (agent, channel) — the channel comes from the path, the fields from the body. All body fields are optional; an empty body creates a default-enabled channel with no tools.",
        "operationId": "agent.upsertAgentChannelSetting",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent the setting belongs to."
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Channel — \"webchat\", \"sms\", or \"voice\"."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertAgentChannelSettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentChannelSettingId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "voice",
                        "webchat",
                        "sms"
                      ]
                    },
                    "allowedTools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "channelPrompt": {
                      "type": "string"
                    },
                    "greeting": {},
                    "llmProvider": {
                      "type": "string",
                      "enum": [
                        "bedrock",
                        "openai",
                        "anthropic",
                        "groq"
                      ]
                    },
                    "llmModel": {},
                    "temperature": {
                      "type": "number"
                    },
                    "voiceId": {},
                    "speed": {},
                    "stability": {},
                    "similarityBoost": {},
                    "speechModel": {},
                    "turnEagerness": {},
                    "turnTimeoutSeconds": {},
                    "initialWaitSeconds": {},
                    "silenceEndCallSeconds": {},
                    "maxCallDurationSeconds": {},
                    "allowGreetingInterruption": {
                      "type": "boolean"
                    },
                    "keyterms": {
                      "type": "array",
                      "items": {}
                    },
                    "allowedCommitments": {
                      "type": "array",
                      "items": {}
                    },
                    "backgroundSound": {},
                    "workflow": {}
                  }
                },
                "example": {
                  "agentChannelSettingId": "ACS0000001",
                  "agentProfileId": "AGP0000001",
                  "channel": "webchat",
                  "allowedTools": [
                    "check_business_hours",
                    "knowledge_search"
                  ],
                  "enabled": true,
                  "channelPrompt": "",
                  "greeting": null,
                  "llmProvider": "bedrock",
                  "llmModel": null,
                  "temperature": 0.7,
                  "voiceId": null,
                  "speed": null,
                  "stability": null,
                  "similarityBoost": null,
                  "speechModel": null,
                  "turnEagerness": null,
                  "turnTimeoutSeconds": null,
                  "initialWaitSeconds": null,
                  "silenceEndCallSeconds": null,
                  "maxCallDurationSeconds": null,
                  "allowGreetingInterruption": true,
                  "keyterms": [],
                  "allowedCommitments": [],
                  "backgroundSound": null,
                  "workflow": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Delete an agent's per-channel setting.",
        "description": "Delete an agent's per-channel setting.",
        "operationId": "agent.deleteAgentChannelSetting",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent the setting belongs to."
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Channel — \"webchat\", \"sms\", or \"voice\"."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Channel setting webchat for agent AGP0000001 deleted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/deployments": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the subgroups a group-level agent is deployed to, ordered by subgroupId.",
        "description": "List the subgroups a group-level agent is deployed to, ordered by subgroupId. Each deployment can override the agent's default send authority for its subgroup; a null sendAuthorityOverride means the deployment inherits the profile's sendAuthority. Returns an empty array when the agent is not deployed anywhere.",
        "operationId": "agent.readAgentDeployments",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent whose deployments to list."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "agentDeploymentId": {
                        "type": "string"
                      },
                      "agentProfileId": {
                        "type": "string"
                      },
                      "sendAuthorityOverride": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "review",
                          "autopilot",
                          null
                        ]
                      },
                      "sendAuthorityChangedBy": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "sendAuthorityChangedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "66f7b2a1c9e77c001a2b3d10",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "agentDeploymentId": "ADP0000001",
                    "agentProfileId": "AGP0000001",
                    "sendAuthorityOverride": "autopilot",
                    "sendAuthorityChangedBy": "507f1f77bcf86cd799439011",
                    "sendAuthorityChangedAt": "2026-09-20T15:04:00.000Z",
                    "enabled": true,
                    "createdAt": "2026-09-18T12:00:00.000Z",
                    "updatedAt": "2026-09-20T15:04:00.000Z"
                  },
                  {
                    "_id": "66f7b2a1c9e77c001a2b3d11",
                    "groupId": "G1234567",
                    "subgroupId": "S7654321",
                    "agentDeploymentId": "ADP0000002",
                    "agentProfileId": "AGP0000001",
                    "sendAuthorityOverride": null,
                    "sendAuthorityChangedBy": null,
                    "sendAuthorityChangedAt": null,
                    "enabled": true,
                    "createdAt": "2026-09-18T12:05:00.000Z",
                    "updatedAt": "2026-09-18T12:05:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/deployments/{subgroupId}": {
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Deploy an agent to a subgroup, or change that deployment (upsert keyed by the subgroup in the path).",
        "description": "Deploy an agent to a subgroup, or change that deployment (upsert keyed by the subgroup in the path). Only an active, group-level agent (subgroupId null) can be deployed, and the subgroup must belong to the agent's group. Both body fields are optional: an empty body on a new deployment creates an enabled deployment that inherits the agent's default send authority, and on an existing deployment leaves it unchanged. Changing sendAuthorityOverride records who changed it and when (sendAuthorityChangedBy, sendAuthorityChangedAt).",
        "operationId": "agent.upsertAgentDeployment",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The group-level agent to deploy."
          },
          {
            "name": "subgroupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The subgroup to deploy it to. Must start with \"S\" and be at least 8 characters."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertAgentDeploymentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "agentDeploymentId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "sendAuthorityOverride": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "review",
                        "autopilot",
                        null
                      ]
                    },
                    "sendAuthorityChangedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sendAuthorityChangedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d10",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentDeploymentId": "ADP0000001",
                  "agentProfileId": "AGP0000001",
                  "sendAuthorityOverride": "autopilot",
                  "sendAuthorityChangedBy": "507f1f77bcf86cd799439011",
                  "sendAuthorityChangedAt": "2026-09-20T15:04:00.000Z",
                  "enabled": true,
                  "createdAt": "2026-09-18T12:00:00.000Z",
                  "updatedAt": "2026-09-20T15:04:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Remove an agent's deployment from a subgroup.",
        "description": "Remove an agent's deployment from a subgroup. The removed deployment is returned. The agent's publishStatus is not changed.",
        "operationId": "agent.deleteAgentDeployment",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The deployed agent."
          },
          {
            "name": "subgroupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The subgroup to remove it from."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "agentDeploymentId": {
                      "type": "string"
                    },
                    "agentProfileId": {
                      "type": "string"
                    },
                    "sendAuthorityOverride": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "review",
                        "autopilot",
                        null
                      ]
                    },
                    "sendAuthorityChangedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sendAuthorityChangedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "66f7b2a1c9e77c001a2b3d10",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "agentDeploymentId": "ADP0000001",
                  "agentProfileId": "AGP0000001",
                  "sendAuthorityOverride": "autopilot",
                  "sendAuthorityChangedBy": "507f1f77bcf86cd799439011",
                  "sendAuthorityChangedAt": "2026-09-20T15:04:00.000Z",
                  "enabled": true,
                  "createdAt": "2026-09-18T12:00:00.000Z",
                  "updatedAt": "2026-09-20T15:04:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/publish": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Publish an agent profile: sets publishStatus to \"published\" and publishedAt to now.",
        "description": "Publish an agent profile: sets publishStatus to \"published\" and publishedAt to now. The agent must be active and have at least one enabled deployment. Publish state is a flag, not a snapshot: later edits apply to the same profile, and an updatedAt later than publishedAt means the profile has unpublished changes. The profile's updatedAt also moves when one of its own channel settings, knowledge items or tools is created, updated or deleted. Group-level knowledge items and tools (no agentProfileId) don't move any profile's updatedAt. Publishing again refreshes publishedAt. No request body.",
        "operationId": "agent.publishAgentProfile",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent to publish."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "inactive"
                      ]
                    },
                    "systemPrompt": {
                      "type": "string"
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "guardrails": {
                      "type": "string"
                    },
                    "sendAuthority": {
                      "type": "string",
                      "enum": [
                        "review",
                        "autopilot"
                      ]
                    },
                    "publishStatus": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "published"
                      ]
                    },
                    "publishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c9a",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": "AGP0000001",
                  "name": "Support Bot",
                  "status": "active",
                  "systemPrompt": "You are a helpful support agent for Acme.",
                  "greeting": "Hi! How can I help you today?",
                  "guardrails": "",
                  "sendAuthority": "review",
                  "publishStatus": "published",
                  "publishedAt": "2026-09-21T10:00:00.000Z",
                  "createdAt": "2026-09-18T12:00:00.000Z",
                  "updatedAt": "2026-09-21T10:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/profiles/{agentProfileId}/unpublish": {
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Return an agent profile to draft: sets publishStatus to \"draft\".",
        "description": "Return an agent profile to draft: sets publishStatus to \"draft\". publishedAt keeps the time of the last publish, and deployments are kept, so publishing again restores them. No request body.",
        "operationId": "agent.unpublishAgentProfile",
        "parameters": [
          {
            "name": "agentProfileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent to unpublish."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "inactive"
                      ]
                    },
                    "systemPrompt": {
                      "type": "string"
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "guardrails": {
                      "type": "string"
                    },
                    "sendAuthority": {
                      "type": "string",
                      "enum": [
                        "review",
                        "autopilot"
                      ]
                    },
                    "publishStatus": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "published"
                      ]
                    },
                    "publishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c9a",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": "AGP0000001",
                  "name": "Support Bot",
                  "status": "active",
                  "systemPrompt": "You are a helpful support agent for Acme.",
                  "greeting": "Hi! How can I help you today?",
                  "guardrails": "",
                  "sendAuthority": "review",
                  "publishStatus": "draft",
                  "publishedAt": "2026-09-21T10:00:00.000Z",
                  "createdAt": "2026-09-18T12:00:00.000Z",
                  "updatedAt": "2026-09-22T09:30:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/profiles/{id}": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Retrieve a single agent profile by ID.",
        "description": "Retrieve a single agent profile by ID.",
        "operationId": "agent.readAgentProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent profile ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "inactive"
                        ]
                      },
                      "systemPrompt": {
                        "type": "string"
                      },
                      "greeting": {
                        "type": "string"
                      },
                      "guardrails": {
                        "type": "string"
                      },
                      "sendAuthority": {
                        "type": "string",
                        "enum": [
                          "review",
                          "autopilot"
                        ]
                      },
                      "publishStatus": {
                        "type": "string",
                        "enum": [
                          "draft",
                          "published"
                        ]
                      },
                      "publishedAt": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c9a",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": "AGP0000001",
                    "name": "Support Bot",
                    "status": "active",
                    "systemPrompt": "You are a helpful support agent for Acme.",
                    "greeting": "Hi! How can I help you today?",
                    "guardrails": "",
                    "sendAuthority": "review",
                    "publishStatus": "draft",
                    "publishedAt": null,
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Update an existing agent profile.",
        "description": "Update an existing agent profile. The agent's group/subgroup scope is immutable and cannot be changed.",
        "operationId": "agent.updateAgentProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent profile ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "inactive"
                      ]
                    },
                    "greeting": {
                      "type": "string"
                    },
                    "sendAuthority": {
                      "type": "string",
                      "enum": [
                        "review",
                        "autopilot"
                      ]
                    },
                    "publishStatus": {
                      "type": "string",
                      "enum": [
                        "draft",
                        "published"
                      ]
                    },
                    "publishedAt": {},
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c9a",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": "AGP0000001",
                  "name": "Support Bot (v2)",
                  "status": "active",
                  "greeting": "Thanks for reaching out — how can I help?",
                  "sendAuthority": "review",
                  "publishStatus": "draft",
                  "publishedAt": null,
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Permanently delete an agent profile.",
        "description": "Permanently delete an agent profile. Also removes its deployments, its number bindings, its channel settings, and any tools and knowledge scoped to that agent, along with their provider-side counterparts — tools and knowledge shared across the account are untouched. Conversation records are kept: a transcript outlives the agent that produced it. Fails without deleting anything if a provider-side record cannot be removed, so nothing is left stranded.",
        "operationId": "agent.deleteAgentProfile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent profile ID to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Agent profile AGP0000001 deleted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/tenant-settings": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Read the tenant AI settings for a scope — brand, tone, timezone, business hours, and after-hours message.",
        "description": "Read the tenant AI settings for a scope — brand, tone, timezone, business hours, and after-hours message. Returns the scope's own row only (no group-level fallback), or an empty array when the scope has no settings.",
        "operationId": "agent.readTenantAiSettings",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "The subgroup; omit for the group-level settings.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "tenantAiSettingsId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "brandName": {
                        "type": "string"
                      },
                      "tone": {
                        "type": "string"
                      },
                      "timezone": {
                        "type": "string"
                      },
                      "businessHours": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "day": {
                              "type": "string",
                              "enum": [
                                "monday",
                                "tuesday",
                                "wednesday",
                                "thursday",
                                "friday",
                                "saturday",
                                "sunday"
                              ]
                            },
                            "closed": {
                              "type": "boolean"
                            },
                            "open": {
                              "type": "string"
                            },
                            "close": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "afterHoursMessage": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "tenantAiSettingsId": "TAS0000001",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "brandName": "Acme Plumbing",
                    "tone": "friendly",
                    "timezone": "America/New_York",
                    "businessHours": [
                      {
                        "day": "monday",
                        "closed": false,
                        "open": "09:00",
                        "close": "17:00"
                      }
                    ],
                    "afterHoursMessage": "We're closed — leave a message."
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Create or update (upsert) the tenant AI settings for a scope.",
        "description": "Create or update (upsert) the tenant AI settings for a scope. The scope is identified by the query params; the body carries the fields. One row per (group, subgroup). All body fields are optional.",
        "operationId": "agent.upsertTenantAiSettings",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "The subgroup; omit for the group-level settings.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandName": {
                    "type": "string",
                    "description": "Brand/business name the agent represents."
                  },
                  "tone": {
                    "type": "string",
                    "description": "Freeform tone descriptor (e.g. \"professional\", \"friendly\")."
                  },
                  "timezone": {
                    "type": "string",
                    "description": "IANA timezone the business hours are evaluated in."
                  },
                  "businessHours": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Per-day windows: { day, closed, open (HH:MM), close (HH:MM) }."
                  },
                  "afterHoursMessage": {
                    "type": "string",
                    "description": "Message the agent uses outside business hours."
                  }
                }
              },
              "example": {
                "brandName": "Acme Plumbing",
                "timezone": "America/New_York",
                "businessHours": [
                  {
                    "day": "monday",
                    "closed": false,
                    "open": "09:00",
                    "close": "17:00"
                  }
                ],
                "afterHoursMessage": "We're closed — leave a message."
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tenantAiSettingsId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "brandName": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "businessHours": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string",
                            "enum": [
                              "monday",
                              "tuesday",
                              "wednesday",
                              "thursday",
                              "friday",
                              "saturday",
                              "sunday"
                            ]
                          },
                          "closed": {
                            "type": "boolean"
                          },
                          "open": {
                            "type": "string"
                          },
                          "close": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "afterHoursMessage": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "tenantAiSettingsId": "TAS0000001",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "brandName": "Acme Plumbing",
                  "timezone": "America/New_York",
                  "businessHours": [
                    {
                      "day": "monday",
                      "closed": false,
                      "open": "09:00",
                      "close": "17:00"
                    }
                  ],
                  "afterHoursMessage": "We're closed — leave a message."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Delete the tenant AI settings for a scope.",
        "description": "Delete the tenant AI settings for a scope.",
        "operationId": "agent.deleteTenantAiSettings",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "The subgroup; omit for the group-level settings.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Tenant AI settings for G1234567 deleted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/tools": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the tools defined under a group — custom webhook tools, configured built-ins, and (future) MCP.",
        "description": "List the tools defined under a group — custom webhook tools, configured built-ins, and (future) MCP. webhookAuth secrets are redacted in the response (shown as { configured: true }).",
        "operationId": "agent.readAgentTools",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group whose tools to list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Narrow to a subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentProfileId",
            "in": "query",
            "required": false,
            "description": "Narrow to one agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Narrow to a tool type — \"builtin\", \"webhook\", or \"mcp\".",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (1-based) for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page (max 100; default 25).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "agentToolId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {},
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "builtin",
                          "webhook",
                          "mcp"
                        ]
                      },
                      "webhookUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "webhookAuth": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "configured": {
                            "type": "boolean"
                          }
                        }
                      },
                      "channels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "agentToolId": "ATL0000001",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": null,
                    "name": "order_status",
                    "description": "Look up the status of a customer order.",
                    "type": "webhook",
                    "webhookUrl": "https://hooks.acme.io/order-status",
                    "webhookAuth": {
                      "configured": true
                    },
                    "channels": [
                      "webchat",
                      "sms"
                    ],
                    "enabled": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Create an agent tool.",
        "description": "Create an agent tool. For a webhook tool, webhookUrl must be an https URL that does not target a private/internal address (rejected otherwise). webhookAuth is stored and never returned. Type-specific requirements: webhook → webhookUrl, builtin → builtinKey, mcp → mcpServerUrl. A built-in's config is checked too, and a tool failing a check is a 400 ValidationError: an escalate_to_human tool whose channels include \"voice\" needs config.target, the US or Canada number calls are transferred to (+1 and ten digits; other +1 countries such as Jamaica, and premium-rate numbers, are refused); a handoff_to_agent tool needs config.targetAgentProfileId; and send_sms and handoff_to_agent must set channels to [\"voice\"].",
        "operationId": "agent.createAgentTool",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentToolRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentToolId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {},
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "builtin",
                        "webhook",
                        "mcp"
                      ]
                    },
                    "webhookUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "webhookAuth": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "configured": {
                          "type": "boolean"
                        }
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "agentToolId": "ATL0000001",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": null,
                  "name": "order_status",
                  "description": "Look up the status of a customer order.",
                  "type": "webhook",
                  "webhookUrl": "https://hooks.acme.io/order-status",
                  "webhookAuth": {
                    "configured": true
                  },
                  "channels": [
                    "webchat",
                    "sms"
                  ],
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/tools/{id}": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Get a single agent tool by ID (webhookAuth redacted).",
        "description": "Get a single agent tool by ID (webhookAuth redacted).",
        "operationId": "agent.readAgentTool",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent tool ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "agentToolId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {},
                      "agentProfileId": {},
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "builtin",
                          "webhook",
                          "mcp"
                        ]
                      },
                      "webhookUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "webhookAuth": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "configured": {
                            "type": "boolean"
                          }
                        }
                      },
                      "channels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "enabled": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "agentToolId": "ATL0000001",
                    "groupId": "G1234567",
                    "subgroupId": null,
                    "agentProfileId": null,
                    "name": "order_status",
                    "description": "Look up the status of a customer order.",
                    "type": "webhook",
                    "webhookUrl": "https://hooks.acme.io/order-status",
                    "webhookAuth": {
                      "configured": true
                    },
                    "channels": [
                      "webchat",
                      "sms"
                    ],
                    "enabled": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Update an agent tool.",
        "description": "Update an agent tool. The tool’s scope (group/subgroup/agent) is immutable. A supplied webhookUrl is SSRF-checked.",
        "operationId": "agent.updateAgentTool",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent tool ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentToolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentToolId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {},
                    "agentProfileId": {},
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "builtin",
                        "webhook",
                        "mcp"
                      ]
                    },
                    "webhookUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "webhookAuth": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "configured": {
                          "type": "boolean"
                        }
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "agentToolId": "ATL0000001",
                  "groupId": "G1234567",
                  "subgroupId": null,
                  "agentProfileId": null,
                  "name": "order_status",
                  "description": "Look up the status of a customer order.",
                  "type": "webhook",
                  "webhookUrl": "https://hooks.acme.io/order-status",
                  "webhookAuth": {
                    "configured": true
                  },
                  "channels": [
                    "webchat",
                    "sms"
                  ],
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "AI Agents"
        ],
        "summary": "Delete an agent tool by its ID.",
        "description": "Delete an agent tool by its ID.",
        "operationId": "agent.deleteAgentTool",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent tool ID to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Agent tool ATL0000001 deleted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/agent/voices": {
      "get": {
        "tags": [
          "AI Agents"
        ],
        "summary": "List the voices an agent can be configured to speak with.",
        "description": "List the voices an agent can be configured to speak with. The catalog is platform-wide rather than per-account, so this endpoint takes no scope. Use a returned voiceId as the voiceId on a spoken channel's setting.",
        "operationId": "agent.readAgentVoices",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "voiceId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "previewUrl": {
                        "type": "string"
                      },
                      "gender": {
                        "type": "string"
                      },
                      "accent": {
                        "type": "string"
                      },
                      "age": {
                        "type": "string"
                      },
                      "useCase": {
                        "type": "string"
                      },
                      "language": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "voiceId": "Xb7hH8MSUJpSbSDYk0k2",
                    "name": "Alice - Clear, Engaging Educator",
                    "description": "Clear and engaging, friendly woman with a British accent suitable for e-learning.",
                    "previewUrl": "https://storage.googleapis.com/…/d10f7534.mp3",
                    "gender": "female",
                    "accent": "british",
                    "age": "middle_aged",
                    "useCase": "informative_educational",
                    "language": "en"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/auth": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Authenticate a user and receive a JWT Bearer token for subsequent API requests.",
        "description": "Authenticate a user and receive a JWT Bearer token for subsequent API requests. A response that carries a token also carries role, the signed-in user's role (for example admin, developer, billing or user), so a client can show or hide features without decoding the JWT; authorization is still enforced by the API on every request. If the account has two-factor authentication on, the response is a challenge instead of a token: { mfaRequired: true, challengeId, methods, primaryMethod, hasBackupCodes }. Complete it with POST /auth/2fa/challenge/:challengeId/verify (see Two-factor authentication below). If a group the user belongs to requires two-factor authentication (PUT /group/:id with requireTwoFactor) and the user hasn't turned it on, the response is { token, role, twoFactorSetupRequired: true }: a setup-only session that can only use the /auth/2fa endpoints, GET /auth/oauth/links, POST /auth/oauth/:provider/reauth, POST /auth/oauth/reauth/confirm and GET /user for the user's own id. Every other request with it is refused with a 403. Once a method is on, sign in again for a full session.",
        "operationId": "auth.authenticateUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The registered email address."
                  },
                  "password": {
                    "type": "string",
                    "description": "Account password (min 8 characters)."
                  },
                  "deviceToken": {
                    "type": "string",
                    "description": "A trusted-device token returned by an earlier 2FA verification with rememberDevice. While it's valid (30 days), the second factor is skipped."
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              },
              "example": {
                "email": "developer@example.com",
                "password": "securepassword123"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MGY3YjJhMWM5ZTc3YzAwMWEyYjNjNGQiLCJncm91cElkIjoiRzEyMzQ1NjciLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE2OTAwMDAwMDAsImV4cCI6MTY5MDA0MzIwMH0.placeholder_signature",
                  "role": "admin"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/2fa": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get your two-factor settings: enrolled methods (targets masked), the default method, the methods this API offers, backup-code counts and trusted devices.",
        "description": "Get your two-factor settings: enrolled methods (targets masked), the default method, the methods this API offers, backup-code counts and trusted devices. Secrets, codes and device tokens are never returned.",
        "operationId": "auth.readTwoFactorSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "primaryMethod": {
                      "type": "string"
                    },
                    "methods": {
                      "type": "object",
                      "properties": {
                        "app": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "target": {
                              "type": "string"
                            },
                            "addedAt": {
                              "type": "string"
                            },
                            "lastUsedAt": {}
                          }
                        },
                        "email": {
                          "type": "object",
                          "properties": {
                            "label": {
                              "type": "string"
                            },
                            "target": {
                              "type": "string"
                            },
                            "addedAt": {
                              "type": "string"
                            },
                            "lastUsedAt": {}
                          }
                        }
                      }
                    },
                    "availableMethods": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "backupCodes": {
                      "type": "object",
                      "properties": {
                        "remaining": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "generatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "trustedDevices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "deviceId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "ipAddress": {
                            "type": "string"
                          },
                          "trustedAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "enabled": true,
                  "primaryMethod": "app",
                  "methods": {
                    "app": {
                      "label": "Authenticator app",
                      "target": "Code from your authenticator app",
                      "addedAt": "2026-10-01T12:00:00.000Z",
                      "lastUsedAt": null
                    },
                    "email": {
                      "label": "Email",
                      "target": "j•••@reyesretail.com",
                      "addedAt": "2026-10-01T12:05:00.000Z",
                      "lastUsedAt": null
                    }
                  },
                  "availableMethods": [
                    {
                      "id": "app",
                      "label": "Authenticator app"
                    },
                    {
                      "id": "sms",
                      "label": "Text message (SMS)",
                      "sender": "+18335550142"
                    },
                    {
                      "id": "email",
                      "label": "Email"
                    }
                  ],
                  "backupCodes": {
                    "remaining": 9,
                    "total": 10,
                    "generatedAt": "2026-10-01T12:00:00.000Z"
                  },
                  "trustedDevices": [
                    {
                      "deviceId": "dev_Q2hyb21l",
                      "name": "Chrome on Windows",
                      "ipAddress": "203.0.113.7",
                      "trustedAt": "2026-10-01T12:10:00.000Z",
                      "expiresAt": "2026-10-31T12:10:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Turn two-factor authentication off: removes every method, backup code and trusted device.",
        "description": "Turn two-factor authentication off: removes every method, backup code and trusted device. Requires a fresh POST /auth/2fa/confirm-identity from the same session; without one the request is refused with a 403. An account that never chose a password and has a linked Microsoft, Apple or Enterprise SSO sign-in that is currently offered (GET /auth/oauth/providers) must also have just signed in again with that provider (POST /auth/oauth/:provider/reauth) from the same session; without it the request is refused with a 403 and the code's confirmation is kept. A member of a group that requires two-factor authentication can't turn it off: the request is refused with a 403 before the confirmation is spent. If it is already off, this is a no-op and needs no confirmation.",
        "operationId": "auth.disableTwoFactor",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "primaryMethod": {},
                    "methods": {
                      "type": "object",
                      "properties": {}
                    },
                    "backupCodes": {},
                    "trustedDevices": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "enabled": false,
                  "primaryMethod": null,
                  "methods": {},
                  "backupCodes": null,
                  "trustedDevices": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/backup-codes": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Replace all backup codes with a new set of 10.",
        "description": "Replace all backup codes with a new set of 10. The previous codes stop working immediately. The new codes are returned only in this response; they're stored as hashes and can't be shown again. Requires a fresh POST /auth/2fa/confirm-identity from the same session; without one the request is refused with a 403.",
        "operationId": "auth.regenerateBackupCodes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "codes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "settings": {
                      "type": "object",
                      "properties": {
                        "backupCodes": {
                          "type": "object",
                          "properties": {
                            "remaining": {
                              "type": "integer"
                            },
                            "total": {
                              "type": "integer"
                            },
                            "generatedAt": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "codes": [
                    "k7mp-3xqa",
                    "w9de-tr2c",
                    "..."
                  ],
                  "settings": {
                    "backupCodes": {
                      "remaining": 10,
                      "total": 10,
                      "generatedAt": "2026-10-01T12:00:00.000Z"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/challenge/{challengeId}": {
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Cancel a pending sign-in challenge.",
        "description": "Cancel a pending sign-in challenge.",
        "operationId": "auth.cancelTwoFactorChallenge",
        "parameters": [
          {
            "name": "challengeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From the mfaRequired sign-in response."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cancelled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "cancelled": true
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/2fa/challenge/{challengeId}/send": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Send a sign-in code by text or email for a pending challenge.",
        "description": "Send a sign-in code by text or email for a pending challenge. Codes last 5 minutes. Not needed for an authenticator app (returns sent: false). Limits (each returns a 400): one send per method every 30 seconds, 5 per challenge, 10 codes per user per hour, 20 code requests per IP address per hour, and 5 texts per phone number per hour. Text messages go only to US, Canadian and US-territory numbers, and may be temporarily unavailable platform-wide; use another method or a backup code when they are.",
        "operationId": "auth.sendTwoFactorChallengeCode",
        "parameters": [
          {
            "name": "challengeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From the mfaRequired sign-in response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTwoFactorChallengeCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean"
                    },
                    "target": {
                      "type": "string"
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "sent": true,
                  "target": "j•••@reyesretail.com",
                  "expiresInSeconds": 300
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/2fa/challenge/{challengeId}/verify": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Verify a sign-in code (or a backup code) and receive the session JWT.",
        "description": "Verify a sign-in code (or a backup code) and receive the session JWT. Consumes the challenge. With rememberDevice, the response also carries a deviceToken: pass it as deviceToken on later sign-ins to skip the second factor on that device for 30 days. A backup code works once. After 5 wrong codes for the account, across all challenges, verification is refused for 15 minutes and the sign-in has to start over.",
        "operationId": "auth.verifyTwoFactorChallenge",
        "parameters": [
          {
            "name": "challengeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From the mfaRequired sign-in response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The 6-digit code, or a backup code (xxxx-xxxx; case and dashes are ignored)."
                  },
                  "method": {
                    "type": "string",
                    "description": "The method the code came from. Defaults to the primary method."
                  },
                  "usingBackupCode": {
                    "type": "boolean",
                    "description": "True when code is a backup code."
                  },
                  "rememberDevice": {
                    "type": "boolean",
                    "description": "Trust this device for 30 days."
                  },
                  "deviceName": {
                    "type": "string",
                    "description": "Label for the trusted device, e.g. 'Chrome on Windows'."
                  }
                },
                "required": [
                  "code"
                ]
              },
              "example": {
                "code": "418502",
                "method": "app",
                "rememberDevice": true,
                "deviceName": "Chrome on Windows"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "deviceToken": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "deviceToken": "dev_Q2hyb21l.x9Vb2..."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/2fa/confirm-identity": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Confirm it's really you before a sensitive change: POST /auth/2fa/enroll, DELETE /auth/2fa/methods/:method, POST /auth/2fa/backup-codes, DELETE /auth/2fa, POST or DELETE /auth/oauth/:provider/link, PUT /group/sso or DELETE /group/sso.",
        "description": "Confirm it's really you before a sensitive change: POST /auth/2fa/enroll, DELETE /auth/2fa/methods/:method, POST /auth/2fa/backup-codes, DELETE /auth/2fa, POST or DELETE /auth/oauth/:provider/link, PUT /group/sso or DELETE /group/sso. While two-factor authentication is on, send a current code from an enrolled method (or a backup code, which is spent); the password is not accepted. While it's off, send the account password; an account that never chose a password (GET /auth/oauth/links returns passwordKnown: false) instead sends a code emailed by POST /auth/2fa/confirm-identity/send with method 'email'. A confirmation lasts 5 minutes, only counts for the session (token) that made it, and is used up by the next one of those changes. An account that never chose a password can instead sign in again with its linked provider (POST /auth/oauth/:provider/reauth) while two-factor authentication is off. Wrong codes and passwords count toward the same limit as sign-in codes: 5 wrong, then a 15-minute lockout.",
        "operationId": "auth.confirmTwoFactorIdentity",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmTwoFactorIdentityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "confirmed": {
                      "type": "boolean"
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "confirmed": true,
                  "expiresInSeconds": 300
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/confirm-identity/send": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Send a 6-digit code through an enrolled text or email method, to use with POST /auth/2fa/confirm-identity.",
        "description": "Send a 6-digit code through an enrolled text or email method, to use with POST /auth/2fa/confirm-identity. An authenticator app needs no send. An account with two-factor authentication off that never chose a password can send method 'email' to get the code at the address its sign-in provider verified when it was linked (not the profile email, which a session can change); if no linked provider verified an address it is refused with a 400. Codes can be re-sent after 30 seconds, and sending counts toward the limits listed under POST /auth/2fa/challenge/:challengeId/send.",
        "operationId": "auth.sendTwoFactorIdentityCode",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTwoFactorChallengeCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean"
                    },
                    "target": {
                      "type": "string"
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "sent": true,
                  "target": "j•••@reyesretail.com",
                  "expiresInSeconds": 300
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/enroll": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start enrolling a method.",
        "description": "Start enrolling a method. For 'app' the response carries the setup secret and an otpauth:// URI to show as a QR code. For 'sms' and 'email' a 6-digit code is sent to the phone or address. Confirm with POST /auth/2fa/enroll/:enrollmentId/verify within 10 minutes. Enrolling a method that's already set up replaces it. Sending a code counts toward the limits listed under POST /auth/2fa/challenge/:challengeId/send. Requires a fresh POST /auth/2fa/confirm-identity from the same session; without one the request is refused with a 403. A start that is rejected for its own input (for example a refused phone number) does not use up the confirmation.",
        "operationId": "auth.startTwoFactorEnrollment",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartTwoFactorEnrollmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enrollmentId": {
                      "type": "string"
                    },
                    "method": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "otpauthUri": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "enrollmentId": "kq3Lr8Zt0wYc1dVb6nXf2pHs",
                  "method": "app",
                  "secret": "JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP",
                  "otpauthUri": "otpauth://totp/Signal%20House:jordan%40reyesretail.com?secret=JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP&issuer=Signal%20House&algorithm=SHA1&digits=6&period=30"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/enroll/{enrollmentId}/verify": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Confirm an enrollment with the code from the app, text or email.",
        "description": "Confirm an enrollment with the code from the app, text or email. The first method turns two-factor authentication on and returns 10 backup codes, shown only in this response. Later methods return backupCodes: null. Five wrong codes close the enrollment.",
        "operationId": "auth.confirmTwoFactorEnrollment",
        "parameters": [
          {
            "name": "enrollmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From POST /auth/2fa/enroll."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmTwoFactorEnrollmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "settings": {
                      "type": "object",
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "primaryMethod": {
                          "type": "string"
                        },
                        "methods": {
                          "type": "object",
                          "properties": {
                            "app": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "target": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        },
                        "backupCodes": {
                          "type": "object",
                          "properties": {
                            "remaining": {
                              "type": "integer"
                            },
                            "total": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "backupCodes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "settings": {
                    "enabled": true,
                    "primaryMethod": "app",
                    "methods": {
                      "app": {
                        "label": "Authenticator app",
                        "target": "Code from your authenticator app"
                      }
                    },
                    "backupCodes": {
                      "remaining": 10,
                      "total": 10
                    }
                  },
                  "backupCodes": [
                    "k7mp-3xqa",
                    "w9de-tr2c",
                    "h4ns-8bvz",
                    "p2qx-7kfm",
                    "c6rt-y3wn",
                    "z8ga-5mhe",
                    "n3vb-q9ds",
                    "e5jk-2tpu",
                    "r7wy-6ncx",
                    "t4hm-d8qa"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/methods/{method}": {
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Remove an enrolled method.",
        "description": "Remove an enrolled method. If it was the default, the next remaining method becomes the default. Removing the last method turns two-factor authentication off and clears backup codes and trusted devices, so a member of a group that requires two-factor authentication can't remove it (403); they add another method first. Requires a fresh POST /auth/2fa/confirm-identity from the same session; without one the request is refused with a 403. Removing the last method takes the same proofs as DELETE /auth/2fa, including its provider re-sign-in where that applies.",
        "operationId": "auth.removeTwoFactorMethod",
        "parameters": [
          {
            "name": "method",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "'app', 'sms' or 'email'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "primaryMethod": {
                      "type": "string"
                    },
                    "methods": {
                      "type": "object",
                      "properties": {
                        "...": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "enabled": true,
                  "primaryMethod": "app",
                  "methods": {
                    "...": "..."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/primary": {
      "put": {
        "tags": [
          "Authentication"
        ],
        "summary": "Choose which enrolled method is offered first at sign-in.",
        "description": "Choose which enrolled method is offered first at sign-in.",
        "operationId": "auth.setTwoFactorPrimaryMethod",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendTwoFactorChallengeCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "primaryMethod": {
                      "type": "string"
                    },
                    "methods": {
                      "type": "object",
                      "properties": {
                        "...": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "enabled": true,
                  "primaryMethod": "email",
                  "methods": {
                    "...": "..."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/prompt": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Whether to show the 'secure your account' prompt: due from the second sign-in while two-factor authentication is off, once per sign-in, and never again after it has been dismissed three times.",
        "description": "Whether to show the 'secure your account' prompt: due from the second sign-in while two-factor authentication is off, once per sign-in, and never again after it has been dismissed three times.",
        "operationId": "auth.readTwoFactorPrompt",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "due": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "due": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/prompt/dismiss": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Dismiss the prompt ('Set up later') until the next sign-in.",
        "description": "Dismiss the prompt ('Set up later') until the next sign-in.",
        "operationId": "auth.dismissTwoFactorPrompt",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "due": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "due": false
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/2fa/trusted-devices/{deviceId}": {
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Stop trusting a device.",
        "description": "Stop trusting a device. Its next sign-in asks for the second factor again. Changing or resetting the password also forgets every trusted device.",
        "operationId": "auth.revokeTrustedDevice",
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "From trustedDevices in GET /auth/2fa."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "trustedDevices": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "enabled": true,
                  "trustedDevices": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/external-link-token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Mint a single-use, short-lived (15 minute) external-link token bound to the caller's active group.",
        "description": "Mint a single-use, short-lived (15 minute) external-link token bound to the caller's active group. The token is handed to an external integration (Go High Level or Shopify) so its backend can link the caller's existing account to its tenant. The caller must have an active group.",
        "operationId": "auth.createExternalLinkToken",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExternalLinkTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user",
          "api"
        ]
      }
    },
    "/auth/forgot-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Request a password-reset link be emailed to the given address.",
        "description": "Request a password-reset link be emailed to the given address. Always responds with { success: true } regardless of whether an account exists for the email, so the endpoint cannot be used to enumerate registered emails. Public — no authentication required.",
        "operationId": "auth.forgotPassword",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestPasswordResetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/group-id": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Return the Group ID associated with the caller's JWT (the caller's active group).",
        "description": "Return the Group ID associated with the caller's JWT (the caller's active group). Lets API users discover their own groupId — required on most other requests — without any additional lookup. Takes no parameters.",
        "operationId": "auth.readGroupId",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user",
          "api"
        ]
      }
    },
    "/auth/history": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Retrieve token login history for a group or user.",
        "description": "Retrieve token login history for a group or user. signInMethod is how the user signed in: password, google, microsoft or apple.",
        "operationId": "auth.readTokenHistory",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID. At least one of groupId or userId must be supplied.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "description": "Filter by User ObjectId. At least one of groupId or userId must be supplied.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (default: 20, max 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "deviceName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ipAddress": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tokenExpiration": {
                        "type": "string"
                      },
                      "signInMethod": {
                        "type": "string",
                        "enum": [
                          "password",
                          "google",
                          "microsoft",
                          "apple",
                          "sso"
                        ]
                      },
                      "location": {
                        "type": "object",
                        "properties": {
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c4d",
                    "groupId": "G1234567",
                    "userId": "60f7b2a1c9e77c001a2b3c4e",
                    "deviceName": "Chrome 120 on Windows",
                    "ipAddress": "192.168.1.100",
                    "tokenExpiration": "2024-01-16T12:00:00.000Z",
                    "signInMethod": "password",
                    "location": {
                      "city": "Springfield",
                      "state": "Missouri",
                      "country": "United States"
                    },
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api",
          "self"
        ]
      }
    },
    "/auth/logout-all": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Log out every other user in the caller's active group by invalidating their tokens.",
        "description": "Log out every other user in the caller's active group by invalidating their tokens. Operates only on the caller's own active group; takes no request body and does not target any other group.",
        "operationId": "auth.logoutAllOtherGroupUsers",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "loggedOutCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "loggedOutCount": 2
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      }
    },
    "/auth/oauth/exchange": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Exchange a 'session' or 'select' ticket for a JWT Bearer token.",
        "description": "Exchange a 'session' or 'select' ticket for a JWT Bearer token. Consumes the ticket. For a 'select' ticket, userId must be one of the offered accounts; choosing it links the provider to that account for next time. 'signup' tickets are rejected: the email has no account yet, and the person must create one on the Signal House sign-up page. Like POST /auth, an account with two-factor authentication on gets a challenge ({ mfaRequired: true, challengeId, ... }) instead of a token.",
        "operationId": "auth.exchangeOAuthTicket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ticket": {
                    "type": "string",
                    "description": "The ticket from the /auth/callback redirect."
                  },
                  "userId": {
                    "type": "string",
                    "description": "Required for a 'select' ticket: the chosen account's userId."
                  },
                  "deviceToken": {
                    "type": "string",
                    "description": "A trusted-device token from an earlier 2FA verification; skips the second factor while valid."
                  }
                },
                "required": [
                  "ticket"
                ]
              },
              "example": {
                "ticket": "Jx3l9b5m0n2Q8rV1sT4uW7yZ",
                "userId": "60f7b2a1c9e77c001a2b3c4e"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/oauth/links": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "List your sign-in methods: whether you chose your own password (passwordKnown is false for an account created through a provider or Enterprise SSO until it sets a password through a reset link sent to the email its sign-in provider verified; changing the password while signed in doesn't count), and every provider linked to your account.",
        "description": "List your sign-in methods: whether you chose your own password (passwordKnown is false for an account created through a provider or Enterprise SSO until it sets a password through a reset link sent to the email its sign-in provider verified; changing the password while signed in doesn't count), and every provider linked to your account. Requires signing in directly: an OAuth connector token is rejected with 403.",
        "operationId": "auth.readOAuthLinks",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "passwordKnown": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "provider": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "linkedAt": {
                            "type": "string"
                          },
                          "lastLoginAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "passwordKnown": true,
                  "links": [
                    {
                      "provider": "google",
                      "email": "jordan@gmail.com",
                      "linkedAt": "2026-10-01T12:00:00.000Z",
                      "lastLoginAt": "2026-10-14T09:30:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/oauth/links/confirm": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Finish linking a provider.",
        "description": "Finish linking a provider. After the provider round trip the API returns the browser to the portal's /Settings/Security?pendingLink=<ticket>; send that ticket here from the signed-in session. The link is made only for the account it was started for: a pending link started for a different account is refused with a 403 and is used up, so a link URL opened in someone else's browser can never attach their provider to your account. A pending link is single use and expires after 10 minutes. Refused with a 400 when a different account from the same provider is already linked. Requires signing in directly: an OAuth connector token is rejected with 403.",
        "operationId": "auth.confirmOAuthLink",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmOAuthLinkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "passwordKnown": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "provider": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "linkedAt": {
                            "type": "string"
                          },
                          "lastLoginAt": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "passwordKnown": true,
                  "links": [
                    {
                      "provider": "google",
                      "email": "jordan@gmail.com",
                      "linkedAt": "2026-10-17T12:00:00.000Z",
                      "lastLoginAt": null
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/oauth/providers": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "List the sign-in providers enabled on this API.",
        "description": "List the sign-in providers enabled on this API. Only providers with credentials configured are returned. 'sso' is listed when Enterprise SSO is enabled on this API; whether a particular email can use it is only known once GET /auth/oauth/sso is called with that email.",
        "operationId": "auth.readOAuthProviders",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "id": "google",
                    "label": "Google"
                  },
                  {
                    "id": "microsoft",
                    "label": "Microsoft"
                  },
                  {
                    "id": "apple",
                    "label": "Apple"
                  },
                  {
                    "id": "sso",
                    "label": "Enterprise SSO"
                  }
                ]
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/oauth/reauth/confirm": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Finish signing in again with a linked provider.",
        "description": "Finish signing in again with a linked provider. After the provider round trip the API returns the browser to the portal's /Settings/Security?pendingReauth=<token>; send that token here, with the reauthSecret, from the session that called POST /auth/oauth/:provider/reauth. It counts only for that session and that secret: redeemed by another account, another session or without the secret, it is refused with a 403 and used up, so a start link opened in someone else's browser can never confirm your session, even when that browser holds a copy of the same token. Single use, valid for 5 minutes. identityConfirmed is true when two-factor authentication is off, meaning the re-sign-in also counts as POST /auth/2fa/confirm-identity. Requires signing in directly: an OAuth connector token is rejected with 403.",
        "operationId": "auth.confirmOAuthReauth",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmOAuthReauthRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "identityConfirmed": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "identityConfirmed": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/oauth/ticket": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Read what a sign-in ticket resolves to, without consuming it.",
        "description": "Read what a sign-in ticket resolves to, without consuming it. kind is 'session' (exchange it), 'select' (choose one of accounts, then exchange) or 'signup' (finish registration; profile holds the provider's details).",
        "operationId": "auth.readOAuthTicket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReadOAuthTicketRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string"
                    },
                    "provider": {
                      "type": "string"
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "userId": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "groupName": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "kind": "select",
                  "provider": "google",
                  "accounts": [
                    {
                      "userId": "60f7b2a1c9e77c001a2b3c4e",
                      "groupId": "G1234567",
                      "groupName": "Reyes Retail Co.",
                      "role": "admin"
                    },
                    {
                      "userId": "60f7b2a1c9e77c001a2b3c4f",
                      "groupId": "G7654321",
                      "groupName": "Reyes Wholesale",
                      "role": "user"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/oauth/{provider}": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start a provider sign-in, or link a provider to a signed-in account.",
        "description": "Start a provider sign-in, or link a provider to a signed-in account. Navigate the browser here (do not call it with fetch): the API sets a short-lived HttpOnly state cookie and responds 302 to the provider's consent screen. If the sign-in can't start it redirects to the portal's /auth/callback?error=<code> instead: provider_unavailable, sso_not_configured, or invalid_state for a bad link ticket (a failed link goes to /Settings/Security?linkError=<code>). An optional next path is kept with the sign-in's single-use state and handed back on the final redirect, so the user can be returned to where they started.",
        "operationId": "auth.startOAuth",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of 'google', 'microsoft', 'apple' or 'sso' (Enterprise SSO)."
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Required for 'sso': the user's work email. Its domain picks the organization's identity provider, and it is passed to that provider as a login hint.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "linkTicket",
            "in": "query",
            "required": false,
            "description": "Link the provider to the signed-in account that requested this ticket (POST /auth/oauth/:provider/link) instead of signing in. Single-use, valid for 2 minutes, and only for the provider it was issued for. Not accepted for 'sso'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reauthTicket",
            "in": "query",
            "required": false,
            "description": "Sign in again with a provider already linked to the signed-in account, to confirm it's you (POST /auth/oauth/:provider/reauth) instead of signing in. Single-use, valid for 2 minutes, and only for the provider it was issued for. With 'sso', email isn't needed. The provider is asked to make the person sign in again (prompt=login, max_age=0); the API then returns the browser to the portal's /Settings/Security?pendingReauth=<token>, which the session that started it redeems with POST /auth/oauth/reauth/confirm, or ?reauthError=<code> (reauth_wrong_account, reauth_unsupported when the provider sent no auth_time, reauth_stale when the sign-in is more than 5 minutes old, invalid_state, access_denied, provider_error).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "next",
            "in": "query",
            "required": false,
            "description": "A path on the portal to return to after sign-in, e.g. /oauth/consent?request=abc. It must start with a single '/', contain no backslash or control characters, and be at most 512 characters; anything else is ignored and the sign-in continues without it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Response"
          }
        },
        "security": []
      }
    },
    "/auth/oauth/{provider}/callback": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "The provider's redirect target; register this URL with each provider (for Enterprise SSO, each organization registers /auth/oauth/sso/callback with its own identity provider).",
        "description": "The provider's redirect target; register this URL with each provider (for Enterprise SSO, each organization registers /auth/oauth/sso/callback with its own identity provider). Google, Microsoft and SSO providers call it with GET; Apple form-posts to it (POST, response_mode=form_post). It verifies the state and ID token, then redirects (303) to the portal's /auth/callback with ?ticket=… on success (plus &next=<path> when the sign-in was started with one) or ?error=<code> on failure. A link flow redirects to /Settings/Security?pendingLink=<ticket> (confirm it with POST /auth/oauth/links/confirm) or ?linkError=<code> instead. Not called directly by integrations.",
        "operationId": "auth.handleOAuthCallback",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of 'google', 'microsoft', 'apple' or 'sso'."
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "Authorization code from the provider (a form field for Apple).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "The state issued when the sign-in started (a form field for Apple).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "description": "Provider error, e.g. access_denied when the user declines.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "Response"
          }
        },
        "security": []
      }
    },
    "/auth/oauth/{provider}/link": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start linking Google, Microsoft or Apple to your account.",
        "description": "Start linking Google, Microsoft or Apple to your account. Returns a single-use link ticket valid for 2 minutes; send the browser to GET /auth/oauth/:provider?linkTicket=<ticket> to choose the provider account. The provider must confirm the account's email address. One account per provider: to switch, unlink first. Requires a fresh POST /auth/2fa/confirm-identity from the same session, which this spends; without one the request is refused with a 403. Signal House staff and API users can't link providers. An Enterprise SSO identity can't be linked here; it is linked by signing in through the organization's provider.",
        "operationId": "auth.createOAuthLink",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of 'google', 'microsoft' or 'apple'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linkTicket": {
                      "type": "string"
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "linkTicket": "qH7vZ2mK9pR4sT1uW3xY5a",
                  "expiresInSeconds": 120
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Authentication"
        ],
        "summary": "Unlink a provider from your account.",
        "description": "Unlink a provider from your account. Refused with a 400 when it is your only way to sign in: another linked provider, or a password you chose yourself, must remain (set a password with the password-reset flow first). With two-factor authentication on, an account that never chose a password also can't unlink its last linked Microsoft, Apple or Enterprise SSO sign-in that is currently offered (400): turning two-factor authentication off needs a re-sign-in with one, so turn it off or set a password first. Requires a fresh POST /auth/2fa/confirm-identity from the same session; a refused unlink doesn't use it up. Returns your remaining sign-in methods.",
        "operationId": "auth.deleteOAuthLink",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of 'google', 'microsoft', 'apple' or 'sso'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "passwordKnown": {
                      "type": "boolean"
                    },
                    "links": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "passwordKnown": true,
                  "links": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/oauth/{provider}/reauth": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Start signing in again with a provider already linked to your account, to confirm it's you.",
        "description": "Start signing in again with a provider already linked to your account, to confirm it's you. Returns a single-use ticket valid for 2 minutes; send the browser to GET /auth/oauth/:provider?reauthTicket=<ticket>. The ticket is tied to your linked provider account and to this session, and spends nothing. The response also carries a single-use reauthSecret, returned only here: keep it in the browser that starts the flow. The provider round trip returns a pendingReauth, which counts only once this same session redeems it, with that secret, through POST /auth/oauth/reauth/confirm. With two-factor authentication off, a redeemed re-sign-in counts as a POST /auth/2fa/confirm-identity for this session. With it on, it doesn't replace a code, but it is required, together with a code, to turn two-factor authentication off on an account that never chose a password and has a linked Microsoft, Apple or Enterprise SSO sign-in that is currently offered (an account that signs in only with Google turns it off with a code alone). Refused with a 400 when that provider isn't linked to your account, or when it can't confirm a fresh sign-in: Google sends no auth_time, so it is never offered for this (use a code instead). Requires signing in directly: an OAuth connector token is rejected with 403.",
        "operationId": "auth.createOAuthReauth",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "One of 'google', 'microsoft', 'apple' or 'sso'; must be linked to your account."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reauthTicket": {
                      "type": "string"
                    },
                    "reauthSecret": {
                      "type": "string"
                    },
                    "expiresInSeconds": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "reauthTicket": "Lm4pQ8sV2xZ6bD1fH3jK5n",
                  "reauthSecret": "Zt6wE3rY9uI1oP5aS8dF2g",
                  "expiresInSeconds": 120
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/auth/reset-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Reset a password using the single-use token from a password-reset email link.",
        "description": "Reset a password using the single-use token from a password-reset email link. The token is consumed on first use and the user's existing sessions are invalidated. Public — no authentication required.",
        "operationId": "auth.resetPasswordWithToken",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordWithTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/resetpassword/{id}": {
      "put": {
        "tags": [
          "Authentication"
        ],
        "summary": "Reset the password for a specific user ID.",
        "description": "Reset the password for a specific user ID.",
        "operationId": "auth.resetPassword",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The User's ObjectId."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Password reset successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api",
          "self"
        ]
      }
    },
    "/auth/send-verification-email": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Resend the account verification email to the authenticated caller (the email is sent to the caller's own address).",
        "description": "Resend the account verification email to the authenticated caller (the email is sent to the caller's own address). Issuing a new link invalidates the previous one, and only the most recent link will work. Rate limited per user.",
        "operationId": "auth.sendVerificationEmail",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "sent": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user",
          "api"
        ]
      }
    },
    "/auth/verify-email": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Verify a new account's email using the single-use token from the verification email link.",
        "description": "Verify a new account's email using the single-use token from the verification email link. On success the account's email is marked verified and a session JWT is returned for the user the link was emailed to, so clicking the link signs that account in on any device — use the token exactly as you would the one from POST /auth. The token field is omitted when a session cannot be established (a link issued before auto-login shipped, an inactive/ineligible account, or an account with two-factor authentication on, because the link is not a second factor and that user signs in normally); verified is still true in that case, so treat a missing token as 'verified, please log in' rather than a failure. The link is single-use, expires 24 hours after it is issued, and this endpoint is rate limited per source IP. Public — no authentication required.",
        "operationId": "auth.verifyEmail",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The single-use verification token from the email link."
                  }
                },
                "required": [
                  "token"
                ]
              },
              "example": {
                "token": "9f1c0b7a2d4e6f8a1b3c5d7e9f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verified": {
                      "type": "boolean"
                    },
                    "token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "verified": true,
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/billing/fees/{groupId}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve the fee schedule for a group.",
        "description": "Retrieve the fee schedule for a group. Returns fees from the active subscription if one exists (source: 'subscription'), otherwise falls back to the group's fee schedule (source: 'feeSchedule'). When source is 'subscription', a subscriptionType field ('template' or 'custom') is also present. When the active custom subscription has volume tiers, an additive volumePricing object is included (tiers, periodStart, periodEnd, periodOutboundSmsSegments, monthlyMinimumSmsSegments, periodMinimumSmsSegments, rampDays, rampEndsAt, inRamp, currentRate). The monthly minimum ramps up linearly over rampDays: periodMinimumSmsSegments is the minimum the current billing period owes (the share of monthlyMinimumSmsSegments matching how far through the ramp the period ends, rounded down). Volume plans bill by UTC calendar month, starting on the 1st; outside the ramp, a period that covers only part of its month, such as the first month of a plan that starts on the 15th, owes the matching share of the minimum, and its shortfall is measured against that share. inRamp is true while that is still less than the full minimum. smsOutbound remains the first-tier list rate and does not change as volume is consumed. periodStart, periodEnd, periodOutboundSmsSegments, currentRate, periodMinimumSmsSegments and inRamp all describe the calendar month the next send counts toward: once a period's end has passed they describe the following month, even before that period's renewal has run. All fee values are in microdollars (divide by 1,000,000 for USD). Messaging fees come in six parallel rails: unsuffixed fields bill 10DLC traffic, *TollFree fields bill Toll-Free traffic, and *ShortCode fields bill Short Code traffic (base sms/mms in/out plus per-carrier pass-through for Default, T-Mobile, AT&T, Verizon, US Cellular, ClearSky, and Interop; Puerto Rico and Guam carriers bill at platform regional rates). *Canada and *CanadaTollFree fields are the Canada rails, chosen by a Canadian recipient handset: a toll-free sender bills *CanadaTollFree and every other sender bills *Canada. Each rail is a stored base per segment (SMS) or per message (MMS) plus an outbound carrier fee per carrier (Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, and Default for every other carrier), passed through at cost and billed as its own line. An inbound message to a Canadian number bills its rail's inbound base (smsInbound* / mmsInbound*) as its own line; the Canada inbound carrier fields are 0. numberCanadaLocal and numberCanadaTollFree are charged at purchase (the first month) and their *Renew siblings each month. *Uk fields are the UK rail, chosen by a GB recipient handset whatever the sender. Its smsCarrierOutbound* fields (EE, O2, Vodafone, Sky, Lycamobile, Standard, Three, Default) and its number fields (numberUkLocal, numberUkLocalVoice, numberUkAlphanumeric for a UK Alphanumeric Sender ID, and the *Renew siblings) are a negotiated price or null: a number is charged as stored, and null means the price is derived from Signal House's rate card at the platform's margin or multiplier. The response's retail object gives, keyed by those field names, the price actually charged either way: the all-in price per segment for a carrier field (including the rail's smsOutboundUk surcharge), and the setup or monthly price for a number field. Read a UK price from retail. shortCodeActivation and shortCodeMmsEnablement are each charged once for every Short Code brought into service, whether Signal House leases it (RANDOM or VANITY, at fulfillment) or the customer leases it directly (EXTERNAL_LEASE, at request). shortCodeLeaseMonthly (RANDOM) or shortCodeVanityLeaseMonthly (VANITY) is charged monthly on a Signal House-leased number until its lease end date; externally leased codes pay no monthly lease. brandVettingRcsAegis and the rcs* fields are the RCS agent registration fees: the Aegis brand vet, the RCS vet the carrier partner runs (rcsVetting, renewed yearly at rcsVetRenewal), the logo and banner vets, the agent token, the Aegis campaign verification and the T-Mobile activation. rcsAgentMonthly is the monthly agent fee: a launched agent pays it every month, from a month after its first carrier launch until the agent is archived. simSwapCheck and numberVerifyCheck are the Verify fees: simSwapCheck once per SIM Swap check that answers, with or without the swap date, and numberVerifyCheck per Number Verify check that ends VERIFIED or NOT_VERIFIED. The voice fees (voiceOutboundPerSecond, voiceInboundPerSecond, voiceConferencePerMinute, recordingPerMinute, transcriptionPerMinute, sentimentPerRequest, aiAgentPerMinute, voiceDIDMonthly, voiceTollFreeDIDMonthly, didSetup, trunkSetup, profileSetup) are priced in the unit their name gives and always come from the group's fee schedule, also when source is 'subscription'. aiAgentPerMinute is the rate for an AI voice agent's time on a call, prorated per second, on top of the call's own rate. A fee field introduced after an account's fee document was written is reported at the price the account is charged for it: a subscription that lacks the field reports the group's fee schedule price, and a field neither holds reports its default.",
        "operationId": "billing.readFees",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string"
                    },
                    "fees": {
                      "type": "object",
                      "properties": {
                        "smsInbound": {
                          "type": "integer"
                        },
                        "smsOutbound": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefault": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefault": {
                          "type": "integer"
                        },
                        "smsCarrierInboundTMobile": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundTMobile": {
                          "type": "integer"
                        },
                        "smsCarrierInboundATT": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundATT": {
                          "type": "integer"
                        },
                        "smsCarrierInboundVerizon": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundVerizon": {
                          "type": "integer"
                        },
                        "smsCarrierInboundUSCellular": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundUSCellular": {
                          "type": "integer"
                        },
                        "smsCarrierInboundGoogleVoice": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundGoogleVoice": {
                          "type": "integer"
                        },
                        "smsCarrierInboundClearSky": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundClearSky": {
                          "type": "integer"
                        },
                        "smsCarrierInboundInterop": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundInterop": {
                          "type": "integer"
                        },
                        "mmsInbound": {
                          "type": "integer"
                        },
                        "mmsOutbound": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundDefault": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundDefault": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundTMobile": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundTMobile": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundATT": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundATT": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundVerizon": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundVerizon": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundUSCellular": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundUSCellular": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundGoogleVoice": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundGoogleVoice": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundClearSky": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundClearSky": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundInterop": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundInterop": {
                          "type": "integer"
                        },
                        "smsOutboundTollFree": {
                          "type": "integer"
                        },
                        "smsInboundTollFree": {
                          "type": "integer"
                        },
                        "mmsOutboundTollFree": {
                          "type": "integer"
                        },
                        "mmsInboundTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefaultTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefaultTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundTMobileTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundTMobileTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundATTTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundATTTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundVerizonTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundVerizonTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundUSCellularTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundUSCellularTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundDefaultTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundDefaultTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundTMobileTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundTMobileTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundATTTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundATTTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundVerizonTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundVerizonTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundUSCellularTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundUSCellularTollFree": {
                          "type": "integer"
                        },
                        "smsOutboundShortCode": {
                          "type": "integer"
                        },
                        "smsInboundShortCode": {
                          "type": "integer"
                        },
                        "mmsOutboundShortCode": {
                          "type": "integer"
                        },
                        "mmsInboundShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefaultShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefaultShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundTMobileShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundTMobileShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundATTShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundATTShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundVerizonShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundVerizonShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundUSCellularShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundUSCellularShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundClearSkyShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundClearSkyShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierInboundInteropShortCode": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundInteropShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundDefaultShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundDefaultShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundTMobileShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundTMobileShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundATTShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundATTShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundVerizonShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundVerizonShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundUSCellularShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundUSCellularShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundClearSkyShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundClearSkyShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierInboundInteropShortCode": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundInteropShortCode": {
                          "type": "integer"
                        },
                        "shortCodeActivation": {
                          "type": "integer"
                        },
                        "shortCodeMmsEnablement": {
                          "type": "integer"
                        },
                        "shortCodeLeaseMonthly": {
                          "type": "integer"
                        },
                        "shortCodeVanityLeaseMonthly": {
                          "type": "integer"
                        },
                        "numberLocal": {
                          "type": "integer"
                        },
                        "numberLocalRenew": {
                          "type": "integer"
                        },
                        "smsInboundCanada": {
                          "type": "integer"
                        },
                        "smsOutboundCanada": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefaultCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefaultCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundBellCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundRogersCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundTelusCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundVideotronCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundSaskTelCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundEastlinkCanada": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundFiberneticsCanada": {
                          "type": "integer"
                        },
                        "mmsInboundCanada": {
                          "type": "integer"
                        },
                        "mmsOutboundCanada": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundBellCanada": {
                          "type": "integer"
                        },
                        "smsInboundCanadaTollFree": {
                          "type": "integer"
                        },
                        "smsOutboundCanadaTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefaultCanadaTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefaultCanadaTollFree": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundBellCanadaTollFree": {
                          "type": "integer"
                        },
                        "mmsInboundCanadaTollFree": {
                          "type": "integer"
                        },
                        "mmsOutboundCanadaTollFree": {
                          "type": "integer"
                        },
                        "mmsCarrierOutboundBellCanadaTollFree": {
                          "type": "integer"
                        },
                        "numberCanadaLocal": {
                          "type": "integer"
                        },
                        "numberCanadaLocalRenew": {
                          "type": "integer"
                        },
                        "numberCanadaTollFree": {
                          "type": "integer"
                        },
                        "numberCanadaTollFreeRenew": {
                          "type": "integer"
                        },
                        "smsInboundUk": {
                          "type": "integer"
                        },
                        "smsOutboundUk": {
                          "type": "integer"
                        },
                        "smsCarrierInboundDefaultUk": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundEEUk": {},
                        "smsCarrierOutboundDefaultUk": {},
                        "numberUkLocal": {},
                        "numberUkLocalRenew": {},
                        "numberUkLocalVoice": {},
                        "numberUkLocalVoiceRenew": {},
                        "numberUkAlphanumeric": {},
                        "numberUkAlphanumericRenew": {},
                        "brandCreate": {
                          "type": "integer"
                        },
                        "campaignCreate": {
                          "type": "integer"
                        },
                        "brandVettingRcsAegis": {
                          "type": "integer"
                        },
                        "rcsVetting": {
                          "type": "integer"
                        },
                        "rcsVetRenewal": {
                          "type": "integer"
                        },
                        "rcsAgentMonthly": {
                          "type": "integer"
                        },
                        "rcsLogoVet": {
                          "type": "integer"
                        },
                        "rcsBannerVet": {
                          "type": "integer"
                        },
                        "rcsAgentToken": {
                          "type": "integer"
                        },
                        "rcsCampaignVerify": {
                          "type": "integer"
                        },
                        "rcsCarrierActivationTMobile": {
                          "type": "integer"
                        },
                        "simSwapCheck": {
                          "type": "integer"
                        },
                        "numberVerifyCheck": {
                          "type": "integer"
                        },
                        "voiceOutboundPerSecond": {
                          "type": "integer"
                        },
                        "voiceInboundPerSecond": {
                          "type": "integer"
                        },
                        "voiceConferencePerMinute": {
                          "type": "integer"
                        },
                        "recordingPerMinute": {
                          "type": "integer"
                        },
                        "transcriptionPerMinute": {
                          "type": "integer"
                        },
                        "sentimentPerRequest": {
                          "type": "integer"
                        },
                        "aiAgentPerMinute": {
                          "type": "integer"
                        },
                        "voiceDIDMonthly": {
                          "type": "integer"
                        },
                        "voiceTollFreeDIDMonthly": {
                          "type": "integer"
                        },
                        "didSetup": {
                          "type": "integer"
                        },
                        "trunkSetup": {
                          "type": "integer"
                        },
                        "profileSetup": {
                          "type": "integer"
                        },
                        "rcsRichOutbound": {
                          "type": "integer"
                        },
                        "rcsRichMediaOutbound": {
                          "type": "integer"
                        },
                        "rcsRichInbound": {
                          "type": "integer"
                        },
                        "rcsRichMediaInbound": {
                          "type": "integer"
                        },
                        "rcsActionClick": {
                          "type": "integer"
                        },
                        "rcsMediaSurchargeTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundATT": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundUSCellular": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundInterop": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundSpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierOutboundDefault": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundATT": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundUSCellular": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundInterop": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundSpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaOutboundDefault": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundATT": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundUSCellular": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundInterop": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundSpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierInboundDefault": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundATT": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundUSCellular": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundInterop": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundSpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierRichMediaInboundDefault": {
                          "type": "integer"
                        },
                        "rcsSession": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PATT": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PTMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PSpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PDish": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionA2PDefault": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2AATT": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2ATMobile": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2AVerizon": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2ASpectrum": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2ADish": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2AClearSky": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2AXfinity": {
                          "type": "integer"
                        },
                        "rcsCarrierSessionP2ADefault": {
                          "type": "integer"
                        }
                      }
                    },
                    "retail": {
                      "type": "object",
                      "properties": {
                        "smsCarrierOutboundEEUk": {
                          "type": "integer"
                        },
                        "smsCarrierOutboundDefaultUk": {
                          "type": "integer"
                        },
                        "numberUkLocal": {
                          "type": "integer"
                        },
                        "numberUkLocalRenew": {
                          "type": "integer"
                        },
                        "numberUkLocalVoice": {
                          "type": "integer"
                        },
                        "numberUkLocalVoiceRenew": {
                          "type": "integer"
                        },
                        "numberUkAlphanumeric": {
                          "type": "integer"
                        },
                        "numberUkAlphanumericRenew": {
                          "type": "integer"
                        }
                      }
                    },
                    "volumePricing": {
                      "type": "object",
                      "properties": {
                        "tiers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "upTo": {
                                "type": "integer"
                              },
                              "rate": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "periodStart": {
                          "type": "string"
                        },
                        "periodEnd": {
                          "type": "string"
                        },
                        "periodOutboundSmsSegments": {
                          "type": "integer"
                        },
                        "monthlyMinimumSmsSegments": {
                          "type": "integer"
                        },
                        "periodMinimumSmsSegments": {
                          "type": "integer"
                        },
                        "rampDays": {
                          "type": "integer"
                        },
                        "rampEndsAt": {
                          "type": "string"
                        },
                        "inRamp": {
                          "type": "boolean"
                        },
                        "currentRate": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "source": "feeSchedule",
                  "fees": {
                    "smsInbound": 0,
                    "smsOutbound": 20000,
                    "smsCarrierInboundDefault": 4000,
                    "smsCarrierOutboundDefault": 4000,
                    "smsCarrierInboundTMobile": 2500,
                    "smsCarrierOutboundTMobile": 4500,
                    "smsCarrierInboundATT": 3500,
                    "smsCarrierOutboundATT": 3500,
                    "smsCarrierInboundVerizon": 0,
                    "smsCarrierOutboundVerizon": 5000,
                    "smsCarrierInboundUSCellular": 2500,
                    "smsCarrierOutboundUSCellular": 4500,
                    "smsCarrierInboundGoogleVoice": 3500,
                    "smsCarrierOutboundGoogleVoice": 3500,
                    "smsCarrierInboundClearSky": 5000,
                    "smsCarrierOutboundClearSky": 5000,
                    "smsCarrierInboundInterop": 4500,
                    "smsCarrierOutboundInterop": 4500,
                    "mmsInbound": 0,
                    "mmsOutbound": 22000,
                    "mmsCarrierInboundDefault": 10000,
                    "mmsCarrierOutboundDefault": 10000,
                    "mmsCarrierInboundTMobile": 2500,
                    "mmsCarrierOutboundTMobile": 4500,
                    "mmsCarrierInboundATT": 3500,
                    "mmsCarrierOutboundATT": 3500,
                    "mmsCarrierInboundVerizon": 0,
                    "mmsCarrierOutboundVerizon": 7000,
                    "mmsCarrierInboundUSCellular": 2500,
                    "mmsCarrierOutboundUSCellular": 4500,
                    "mmsCarrierInboundGoogleVoice": 3500,
                    "mmsCarrierOutboundGoogleVoice": 3500,
                    "mmsCarrierInboundClearSky": 4000,
                    "mmsCarrierOutboundClearSky": 4000,
                    "mmsCarrierInboundInterop": 3500,
                    "mmsCarrierOutboundInterop": 3500,
                    "smsOutboundTollFree": 8000,
                    "smsInboundTollFree": 8000,
                    "mmsOutboundTollFree": 20000,
                    "mmsInboundTollFree": 20000,
                    "smsCarrierInboundDefaultTollFree": 0,
                    "smsCarrierOutboundDefaultTollFree": 4000,
                    "smsCarrierInboundTMobileTollFree": 3000,
                    "smsCarrierOutboundTMobileTollFree": 3000,
                    "smsCarrierInboundATTTollFree": 3000,
                    "smsCarrierOutboundATTTollFree": 3000,
                    "smsCarrierInboundVerizonTollFree": 0,
                    "smsCarrierOutboundVerizonTollFree": 5000,
                    "smsCarrierInboundUSCellularTollFree": 3000,
                    "smsCarrierOutboundUSCellularTollFree": 3000,
                    "mmsCarrierInboundDefaultTollFree": 0,
                    "mmsCarrierOutboundDefaultTollFree": 10000,
                    "mmsCarrierInboundTMobileTollFree": 10000,
                    "mmsCarrierOutboundTMobileTollFree": 10000,
                    "mmsCarrierInboundATTTollFree": 7500,
                    "mmsCarrierOutboundATTTollFree": 7500,
                    "mmsCarrierInboundVerizonTollFree": 0,
                    "mmsCarrierOutboundVerizonTollFree": 6500,
                    "mmsCarrierInboundUSCellularTollFree": 10000,
                    "mmsCarrierOutboundUSCellularTollFree": 10000,
                    "smsOutboundShortCode": 6500,
                    "smsInboundShortCode": 0,
                    "mmsOutboundShortCode": 22000,
                    "mmsInboundShortCode": 22000,
                    "smsCarrierInboundDefaultShortCode": 0,
                    "smsCarrierOutboundDefaultShortCode": 4500,
                    "smsCarrierInboundTMobileShortCode": 2500,
                    "smsCarrierOutboundTMobileShortCode": 4500,
                    "smsCarrierInboundATTShortCode": 3500,
                    "smsCarrierOutboundATTShortCode": 3500,
                    "smsCarrierInboundVerizonShortCode": 0,
                    "smsCarrierOutboundVerizonShortCode": 5000,
                    "smsCarrierInboundUSCellularShortCode": 2500,
                    "smsCarrierOutboundUSCellularShortCode": 4500,
                    "smsCarrierInboundClearSkyShortCode": 5000,
                    "smsCarrierOutboundClearSkyShortCode": 5000,
                    "smsCarrierInboundInteropShortCode": 4500,
                    "smsCarrierOutboundInteropShortCode": 4500,
                    "mmsCarrierInboundDefaultShortCode": 0,
                    "mmsCarrierOutboundDefaultShortCode": 10000,
                    "mmsCarrierInboundTMobileShortCode": 10000,
                    "mmsCarrierOutboundTMobileShortCode": 10000,
                    "mmsCarrierInboundATTShortCode": 9000,
                    "mmsCarrierOutboundATTShortCode": 9000,
                    "mmsCarrierInboundVerizonShortCode": 0,
                    "mmsCarrierOutboundVerizonShortCode": 7000,
                    "mmsCarrierInboundUSCellularShortCode": 10000,
                    "mmsCarrierOutboundUSCellularShortCode": 10000,
                    "mmsCarrierInboundClearSkyShortCode": 10000,
                    "mmsCarrierOutboundClearSkyShortCode": 10000,
                    "mmsCarrierInboundInteropShortCode": 5000,
                    "mmsCarrierOutboundInteropShortCode": 10000,
                    "shortCodeActivation": 1000000000,
                    "shortCodeMmsEnablement": 500000000,
                    "shortCodeLeaseMonthly": 1000000000,
                    "shortCodeVanityLeaseMonthly": 1500000000,
                    "numberLocal": 1000000,
                    "numberLocalRenew": 1000000,
                    "smsInboundCanada": 6500,
                    "smsOutboundCanada": 6500,
                    "smsCarrierInboundDefaultCanada": 0,
                    "smsCarrierOutboundDefaultCanada": 6400,
                    "smsCarrierOutboundBellCanada": 8000,
                    "smsCarrierOutboundRogersCanada": 9000,
                    "smsCarrierOutboundTelusCanada": 7500,
                    "smsCarrierOutboundVideotronCanada": 6500,
                    "smsCarrierOutboundSaskTelCanada": 6000,
                    "smsCarrierOutboundEastlinkCanada": 6000,
                    "smsCarrierOutboundFiberneticsCanada": 3800,
                    "mmsInboundCanada": 24500,
                    "mmsOutboundCanada": 24500,
                    "mmsCarrierOutboundBellCanada": 29000,
                    "smsInboundCanadaTollFree": 7900,
                    "smsOutboundCanadaTollFree": 7900,
                    "smsCarrierInboundDefaultCanadaTollFree": 0,
                    "smsCarrierOutboundDefaultCanadaTollFree": 6400,
                    "smsCarrierOutboundBellCanadaTollFree": 8700,
                    "mmsInboundCanadaTollFree": 27800,
                    "mmsOutboundCanadaTollFree": 27800,
                    "mmsCarrierOutboundBellCanadaTollFree": 32300,
                    "numberCanadaLocal": 1100000,
                    "numberCanadaLocalRenew": 1100000,
                    "numberCanadaTollFree": 1250000,
                    "numberCanadaTollFreeRenew": 1250000,
                    "smsInboundUk": 0,
                    "smsOutboundUk": 0,
                    "smsCarrierInboundDefaultUk": 0,
                    "smsCarrierOutboundEEUk": null,
                    "smsCarrierOutboundDefaultUk": null,
                    "numberUkLocal": null,
                    "numberUkLocalRenew": null,
                    "numberUkLocalVoice": null,
                    "numberUkLocalVoiceRenew": null,
                    "numberUkAlphanumeric": null,
                    "numberUkAlphanumericRenew": null,
                    "brandCreate": 4500000,
                    "campaignCreate": 15000000,
                    "brandVettingRcsAegis": 75000000,
                    "rcsVetting": 100000000,
                    "rcsVetRenewal": 50000000,
                    "rcsAgentMonthly": 100000000,
                    "rcsLogoVet": 20000000,
                    "rcsBannerVet": 20000000,
                    "rcsAgentToken": 10000000,
                    "rcsCampaignVerify": 10000000,
                    "rcsCarrierActivationTMobile": 500000000,
                    "simSwapCheck": 10000,
                    "numberVerifyCheck": 10000,
                    "voiceOutboundPerSecond": 233,
                    "voiceInboundPerSecond": 142,
                    "voiceConferencePerMinute": 1800,
                    "recordingPerMinute": 2500,
                    "transcriptionPerMinute": 200000,
                    "sentimentPerRequest": 10000,
                    "aiAgentPerMinute": 220000,
                    "voiceDIDMonthly": 5000000,
                    "voiceTollFreeDIDMonthly": 7500000,
                    "didSetup": 1000000,
                    "trunkSetup": 5000000,
                    "profileSetup": 1000000,
                    "rcsRichOutbound": 6500,
                    "rcsRichMediaOutbound": 16000,
                    "rcsRichInbound": 5000,
                    "rcsRichMediaInbound": 5000,
                    "rcsActionClick": 1000,
                    "rcsMediaSurchargeTMobile": 1000,
                    "rcsCarrierOutboundATT": 4500,
                    "rcsCarrierOutboundTMobile": 6200,
                    "rcsCarrierOutboundVerizon": 5000,
                    "rcsCarrierOutboundUSCellular": 6200,
                    "rcsCarrierOutboundClearSky": 4000,
                    "rcsCarrierOutboundInterop": 3000,
                    "rcsCarrierOutboundSpectrum": 4000,
                    "rcsCarrierOutboundXfinity": 4000,
                    "rcsCarrierOutboundDefault": 6200,
                    "rcsCarrierRichMediaOutboundATT": 10000,
                    "rcsCarrierRichMediaOutboundTMobile": 12500,
                    "rcsCarrierRichMediaOutboundVerizon": 7000,
                    "rcsCarrierRichMediaOutboundUSCellular": 12500,
                    "rcsCarrierRichMediaOutboundClearSky": 10000,
                    "rcsCarrierRichMediaOutboundInterop": 5000,
                    "rcsCarrierRichMediaOutboundSpectrum": 6000,
                    "rcsCarrierRichMediaOutboundXfinity": 8000,
                    "rcsCarrierRichMediaOutboundDefault": 12500,
                    "rcsCarrierInboundATT": 4500,
                    "rcsCarrierInboundTMobile": 2500,
                    "rcsCarrierInboundVerizon": 0,
                    "rcsCarrierInboundUSCellular": 2500,
                    "rcsCarrierInboundClearSky": 4000,
                    "rcsCarrierInboundInterop": 0,
                    "rcsCarrierInboundSpectrum": 4000,
                    "rcsCarrierInboundXfinity": 0,
                    "rcsCarrierInboundDefault": 4500,
                    "rcsCarrierRichMediaInboundATT": 10000,
                    "rcsCarrierRichMediaInboundTMobile": 12500,
                    "rcsCarrierRichMediaInboundVerizon": 0,
                    "rcsCarrierRichMediaInboundUSCellular": 12500,
                    "rcsCarrierRichMediaInboundClearSky": 10000,
                    "rcsCarrierRichMediaInboundInterop": 0,
                    "rcsCarrierRichMediaInboundSpectrum": 6000,
                    "rcsCarrierRichMediaInboundXfinity": 0,
                    "rcsCarrierRichMediaInboundDefault": 12500,
                    "rcsSession": 55000,
                    "rcsCarrierSessionA2PATT": 30000,
                    "rcsCarrierSessionA2PTMobile": 60000,
                    "rcsCarrierSessionA2PVerizon": 9000,
                    "rcsCarrierSessionA2PSpectrum": 9000,
                    "rcsCarrierSessionA2PDish": 9000,
                    "rcsCarrierSessionA2PClearSky": 30000,
                    "rcsCarrierSessionA2PXfinity": 10000,
                    "rcsCarrierSessionA2PDefault": 60000,
                    "rcsCarrierSessionP2AATT": 30000,
                    "rcsCarrierSessionP2ATMobile": 60000,
                    "rcsCarrierSessionP2AVerizon": 9000,
                    "rcsCarrierSessionP2ASpectrum": 9000,
                    "rcsCarrierSessionP2ADish": 9000,
                    "rcsCarrierSessionP2AClearSky": 30000,
                    "rcsCarrierSessionP2AXfinity": 0,
                    "rcsCarrierSessionP2ADefault": 60000
                  },
                  "retail": {
                    "smsCarrierOutboundEEUk": 159500,
                    "smsCarrierOutboundDefaultUk": 230000,
                    "numberUkLocal": 6000000,
                    "numberUkLocalRenew": 6000000,
                    "numberUkLocalVoice": 30000000,
                    "numberUkLocalVoiceRenew": 30000000,
                    "numberUkAlphanumeric": 6000000,
                    "numberUkAlphanumericRenew": 6000000
                  },
                  "volumePricing": {
                    "tiers": [
                      {
                        "upTo": 1000000,
                        "rate": 5000
                      },
                      {
                        "upTo": 5000000,
                        "rate": 4500
                      },
                      {
                        "upTo": null,
                        "rate": 4000
                      }
                    ],
                    "periodStart": "2026-10-15T00:00:00.000Z",
                    "periodEnd": "2026-10-31T23:59:59.999Z",
                    "periodOutboundSmsSegments": 600000,
                    "monthlyMinimumSmsSegments": 2000000,
                    "periodMinimumSmsSegments": 1096774,
                    "rampDays": 0,
                    "rampEndsAt": "2026-10-15T00:00:00.000Z",
                    "inRamp": false,
                    "currentRate": 5000
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/invoiceDetails": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve invoice details for a group.",
        "description": "Retrieve invoice details for a group.",
        "operationId": "billing.readInvoiceDetails",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID starting with 'G'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp. Normalized to start-of-UTC-day — the full start day is included.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp. Normalized to end-of-UTC-day — the full end day is included. Hourly resolution is not supported.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "dataDate": {
                        "type": "string"
                      },
                      "transactionSummary": {
                        "type": "object",
                        "properties": {
                          "SMS Outbound 1": {
                            "type": "object",
                            "properties": {
                              "quantity": {
                                "type": "integer"
                              },
                              "amount": {
                                "type": "integer"
                              }
                            }
                          },
                          "MMS Outbound": {
                            "type": "object",
                            "properties": {
                              "quantity": {
                                "type": "integer"
                              },
                              "amount": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "G12345678::S1234567::2026-03-10",
                    "groupId": "G12345678",
                    "subgroupId": "S1234567",
                    "dataDate": "2026-03-10",
                    "transactionSummary": {
                      "SMS Outbound 1": {
                        "quantity": 150,
                        "amount": 3600000
                      },
                      "MMS Outbound": {
                        "quantity": 25,
                        "amount": 800000
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/invoiceDetails/ledger": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve a summarized ledger of billing transactions for a group, grouped by subgroup, entry type, transaction type, and unit price.",
        "description": "Retrieve a summarized ledger of billing transactions for a group, grouped by subgroup, entry type, transaction type, and unit price. All monetary values are in microdollars.",
        "operationId": "billing.readInvoiceLedger",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID starting with 'G'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date in YYYY-MM-DD format (inclusive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date in YYYY-MM-DD format (inclusive). Must be >= startDate.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA timezone for date boundaries (default: UTC).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "subgroupId": {
                        "type": "string"
                      },
                      "entryType": {
                        "type": "string"
                      },
                      "transactionType": {
                        "type": "string"
                      },
                      "unitPrice": {
                        "type": "integer"
                      },
                      "quantity": {
                        "type": "integer"
                      },
                      "amount": {
                        "type": "integer"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "subgroupId": "S1234567",
                    "entryType": "DEBIT",
                    "transactionType": "SMS Outbound 1",
                    "unitPrice": 24000,
                    "quantity": 150,
                    "amount": 3600000
                  },
                  {
                    "subgroupId": null,
                    "entryType": "CREDIT",
                    "transactionType": "Recharge Wallet",
                    "unitPrice": 50000000,
                    "quantity": 1,
                    "amount": 50000000
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/addfunds/{groupId}": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Manually add funds to a wallet.",
        "description": "Manually add funds to a wallet.",
        "operationId": "billing.addFundsToWallet",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddFundsToWalletRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "transactionType": {
                        "type": "string"
                      },
                      "entryType": {
                        "type": "string",
                        "enum": [
                          "DEBIT",
                          "CREDIT"
                        ]
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "quantity": {
                        "type": "integer"
                      },
                      "unitPrice": {
                        "type": "integer"
                      },
                      "referenceId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "accountLast4": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "succeeded",
                          "failed"
                        ]
                      },
                      "currency": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c51",
                    "groupId": "G1234567",
                    "transactionType": "Recharge Wallet",
                    "entryType": "CREDIT",
                    "amount": 50000000,
                    "quantity": 1,
                    "unitPrice": 50000000,
                    "referenceId": "pi_3Ofh2kABC123",
                    "description": "Added funds to wallet for group G1234567",
                    "accountLast4": "4242",
                    "status": "succeeded",
                    "currency": "USD",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/paymentHistory": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve payment history (wallet recharge transactions) with server-side pagination.",
        "description": "Retrieve payment history (wallet recharge transactions) with server-side pagination.",
        "operationId": "billing.readPaymentHistory",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID starting with 'G'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "Start date in YYYY-MM-DD format (inclusive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "End date in YYYY-MM-DD format (inclusive).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (positive integer, default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page, max 10000 (default: 10).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA timezone (default: \"UTC\").",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "transactionType": {
                            "type": "string"
                          },
                          "entryType": {
                            "type": "string",
                            "enum": [
                              "DEBIT",
                              "CREDIT"
                            ]
                          },
                          "amount": {
                            "type": "integer"
                          },
                          "accountLast4": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "succeeded",
                              "failed"
                            ]
                          },
                          "failureMessage": {},
                          "referenceId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "currency": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "unitPrice": {
                            "type": "integer"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "totalRecords": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        },
                        "totalAmount": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "_id": "60f7b2a1c9e77c001a2b3c52",
                      "groupId": "G1234567",
                      "transactionType": "Recharge Wallet",
                      "entryType": "CREDIT",
                      "amount": 20000000,
                      "accountLast4": "4242",
                      "status": "succeeded",
                      "failureMessage": null,
                      "referenceId": "pi_3abc123",
                      "description": "Wallet recharge",
                      "currency": "USD",
                      "quantity": 1,
                      "unitPrice": 20000000,
                      "createdAt": "2024-01-15T14:30:00.000Z"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "limit": 10,
                    "totalRecords": 25,
                    "totalPages": 3,
                    "totalAmount": 500000000
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/paymentMethod/{groupId}": {
      "post": {
        "tags": [
          "Billing"
        ],
        "summary": "Attach a new payment method to a group's wallet.",
        "description": "Attach a new payment method to a group's wallet.",
        "operationId": "billing.attachPaymentMethod",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPaymentMethodRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Payment method pm_1234567890 successfully attached to customer for group G1234567"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/paymentMethod/{groupId}/{paymentMethodId}": {
      "delete": {
        "tags": [
          "Billing"
        ],
        "summary": "Detach a payment method from a group's wallet.",
        "description": "Detach a payment method from a group's wallet.",
        "operationId": "billing.detachPaymentMethod",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          },
          {
            "name": "paymentMethodId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The payment method ID to detach."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Payment method pm_1234567890 successfully detached from customer for group G1234567"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/paymentMethods/{groupId}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve saved payment methods for a group.",
        "description": "Retrieve saved payment methods for a group.",
        "operationId": "billing.readPaymentMethods",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "has_more": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "chargeable": {
                            "type": "boolean"
                          },
                          "customer_id": {
                            "type": "string"
                          },
                          "billing_details": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "address": {
                                "type": "object",
                                "properties": {
                                  "zip": {
                                    "type": "string"
                                  },
                                  "city": {
                                    "type": "string"
                                  },
                                  "state": {
                                    "type": "string"
                                  },
                                  "street": {
                                    "type": "string"
                                  },
                                  "country": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "card": {
                            "type": "object",
                            "properties": {
                              "brand": {
                                "type": "string"
                              },
                              "last4": {
                                "type": "string"
                              },
                              "checks": {
                                "type": "object",
                                "properties": {
                                  "cvc_check": {
                                    "type": "string"
                                  },
                                  "address_line1_check": {
                                    "type": "string"
                                  },
                                  "address_postal_code_check": {
                                    "type": "string"
                                  }
                                }
                              },
                              "funding": {
                                "type": "string"
                              },
                              "exp_year": {
                                "type": "integer"
                              },
                              "exp_month": {
                                "type": "integer"
                              },
                              "holder_name": {
                                "type": "string"
                              },
                              "surchargeable": {
                                "type": "boolean"
                              },
                              "apple_pay": {
                                "type": "boolean"
                              }
                            }
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "has_more": false,
                  "items": [
                    {
                      "id": "pm_8RtXKnvCelMBgqFDaz9p3",
                      "type": "card",
                      "chargeable": true,
                      "customer_id": "cus_Wp4NrTQbYKHJ7mudhXkzv",
                      "billing_details": {
                        "name": "Alex Thompson",
                        "address": {
                          "zip": "90210",
                          "city": "Beverly Hills",
                          "state": "CA",
                          "street": "456 Oak Avenue",
                          "country": "US"
                        }
                      },
                      "card": {
                        "brand": "visa",
                        "last4": "4242",
                        "checks": {
                          "cvc_check": "unchecked",
                          "address_line1_check": "pass",
                          "address_postal_code_check": "pass"
                        },
                        "funding": "credit",
                        "exp_year": 2028,
                        "exp_month": 7,
                        "holder_name": "Alex Thompson",
                        "surchargeable": false,
                        "apple_pay": false
                      },
                      "created_at": "2024-03-10T09:15:30.000Z",
                      "updated_at": "2024-03-10T09:15:30.000Z"
                    }
                  ],
                  "offset": 0,
                  "limit": 30,
                  "total": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/transactionHistory": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve detailed transaction history.",
        "description": "Retrieve detailed transaction history.",
        "operationId": "billing.readTransactionHistory",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entryType",
            "in": "query",
            "required": false,
            "description": "DEBIT or CREDIT.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "transactionType",
            "in": "query",
            "required": false,
            "description": "Filter by transaction type. Values are human-readable labels set at write time (e.g., 'SMS Outbound 1', 'SMS Outbound (Subscription)', 'MMS Outbound', 'Recharge Wallet', 'Number Purchase', 'Brand Creation').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter by RCS charge category: one value, a comma-separated list or a repeated param. RCS_RICH_OUTBOUND, RCS_RICH_MEDIA_OUTBOUND, RCS_INBOUND, RCS_ACTION_CLICK, RCS_MEDIA_SURCHARGE, RCS_FEE_ONBOARDING, RCS_FEE_RENEWAL, RCS_SESSION_ADJUSTMENT (the Signal House session fee part of the daily repricing of a conversational agent's interactive sessions), RCS_SESSION_CARRIER_ADJUSTMENT (the carrier session rate part of that repricing, passed through at cost) or RCS_CARRIER_PASSTHROUGH, which reads RCS carrier charges alone. Any other value answers 400. The rows do not carry the category.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp. Normalized to start-of-UTC-day — the full start day is included.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp. Normalized to end-of-UTC-day — the full end day is included. Hourly resolution is not supported.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page, max 1000 (default: 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "transactionType": {
                        "type": "string"
                      },
                      "entryType": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "quantity": {
                        "type": "integer"
                      },
                      "unitPrice": {
                        "type": "integer"
                      },
                      "description": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c52",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "transactionType": "SMS Outbound 1",
                    "entryType": "DEBIT",
                    "amount": 24000,
                    "quantity": 1,
                    "unitPrice": 24000,
                    "description": "Outbound SMS to 14175551234",
                    "currency": "USD",
                    "createdAt": "2024-01-15T14:30:00.000Z",
                    "updatedAt": "2024-01-15T14:30:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/billing/wallet/{groupId}": {
      "get": {
        "tags": [
          "Billing"
        ],
        "summary": "Retrieve wallet balance and auto-recharge settings for a group.",
        "description": "Retrieve wallet balance and auto-recharge settings for a group.",
        "operationId": "billing.readWallet",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "balance": {
                      "type": "integer"
                    },
                    "reservedAmount": {
                      "type": "integer"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "autoRechargeEnabled": {
                      "type": "boolean"
                    },
                    "autoRechargeThreshold": {
                      "type": "integer"
                    },
                    "autoRechargeToAmount": {
                      "type": "integer"
                    },
                    "primaryPaymentMethodId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secondaryPaymentMethodId": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c51",
                  "groupId": "G1234567",
                  "balance": 150000000,
                  "reservedAmount": 5000000,
                  "currency": "USD",
                  "autoRechargeEnabled": true,
                  "autoRechargeThreshold": 30000000,
                  "autoRechargeToAmount": 100000000,
                  "primaryPaymentMethodId": "pm_1234567890",
                  "secondaryPaymentMethodId": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Billing"
        ],
        "summary": "Update wallet auto-recharge settings.",
        "description": "Update wallet auto-recharge settings. Auto recharge may not be available for all account types.",
        "operationId": "billing.updateWallet",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWalletRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "balance": {
                      "type": "integer"
                    },
                    "reservedAmount": {
                      "type": "integer"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "autoRechargeEnabled": {
                      "type": "boolean"
                    },
                    "autoRechargeThreshold": {
                      "type": "integer"
                    },
                    "autoRechargeToAmount": {
                      "type": "integer"
                    },
                    "primaryPaymentMethodId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secondaryPaymentMethodId": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c51",
                  "groupId": "G1234567",
                  "balance": 150000000,
                  "reservedAmount": 5000000,
                  "currency": "USD",
                  "autoRechargeEnabled": true,
                  "autoRechargeThreshold": 30000000,
                  "autoRechargeToAmount": 100000000,
                  "primaryPaymentMethodId": "pm_1234567890",
                  "secondaryPaymentMethodId": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Read brands using optional query filters.",
        "description": "Read brands using optional query filters. Customer roles must pass at least one filter (id, subgroupId, or groupId) — an unfiltered read-all is restricted to internal use. Toll-free brands carry `tollFree.isBrandReady` (whether the brand can host campaigns), `tollFree.maxNumbersPerCampaign` (the most numbers one of its campaigns can hold), `tollFree.maxOptInMethods` (the most opt-in methods one of its campaigns can declare), `tollFree.requiresPrivacyPolicy` (whether its campaigns need a privacy policy URL), `tollFree.requiresTermsAndConditions` (whether its campaigns need a terms and conditions URL), `tollFree.maxAppealReasonLength` (the longest appeal reason its campaigns may give), `tollFree.labelsSamples` (whether its campaigns' sample messages each start with their use case's name), `tollFree.supportsMms` (whether its numbers can send MMS and group messages) and `tollFree.reviewsBusinessOnSubmit` (whether it's reviewed when it's submitted and keeps its business details from then on). A toll-free brand reviewed on submit also carries the `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel` it was submitted with, and `tollFree.rejectionReason`: why its review rejected it, in plain English, or null. On other toll-free brands these are null or absent.",
        "operationId": "brand.readBrand",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status (e.g., VERIFIED).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationType",
            "in": "query",
            "required": false,
            "description": "Filter by registration type: TEN_DLC or TOLL_FREE. Omit to return brands of all registration types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currentTollFreeCarrier",
            "in": "query",
            "required": false,
            "description": "With groupId or subgroupId: when true, return only toll-free brands that a new toll-free campaign in that group can use (those on the group's current toll-free carrier).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "With groupId or subgroupId: free text finds part of the brand ID, display name or company name. `field:` names brandId, displayName, companyName, ein, email, groupId, subgroupId or referenceId. Repeat the param to send several values; every value must match. Each value is free text, or `field:term` to search one field. Each term is 3 to 100 characters, with at most 5 values; a shorter term returns 400. Works with the scoping filters above.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page, max 1000.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "status": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "PENDING_CREATION",
                          "PENDING_APPROVAL",
                          "UNVERIFIED",
                          "VERIFIED",
                          "VETTED_VERIFIED",
                          "PENDING_DELETE",
                          "DELETED",
                          "DCA_PENDING",
                          "DCA_ACTIVE",
                          "DCA_REJECTED",
                          "DCA_PENDING_2FA",
                          "DCA_PENDING_APPEAL",
                          "SHORT_CODE_REJECTED",
                          null
                        ]
                      },
                      "entityType": {
                        "type": "string",
                        "enum": [
                          "PRIVATE_PROFIT",
                          "PUBLIC_PROFIT",
                          "NON_PROFIT",
                          "GOVERNMENT"
                        ]
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "companyName": {
                        "type": "string"
                      },
                      "ein": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "street": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "email": {
                        "type": "string"
                      },
                      "vertical": {
                        "type": "string",
                        "enum": [
                          "PROFESSIONAL",
                          "REAL_ESTATE",
                          "HEALTHCARE",
                          "HUMAN_RESOURCES",
                          "ENERGY",
                          "ENTERTAINMENT",
                          "RETAIL",
                          "TRANSPORTATION",
                          "AGRICULTURE",
                          "INSURANCE",
                          "POSTAL",
                          "EDUCATION",
                          "HOSPITALITY",
                          "FINANCIAL",
                          "POLITICAL",
                          "GAMBLING",
                          "LEGAL",
                          "CONSTRUCTION",
                          "NGO",
                          "MANUFACTURING",
                          "GOVERNMENT",
                          "TECHNOLOGY",
                          "COMMUNICATION"
                        ]
                      },
                      "brandRelationship": {
                        "type": "string",
                        "enum": [
                          "BASIC_ACCOUNT",
                          "SMALL_ACCOUNT",
                          "MEDIUM_ACCOUNT",
                          "LARGE_ACCOUNT",
                          "KEY_ACCOUNT"
                        ]
                      },
                      "brandScore": {
                        "type": [
                          "integer",
                          "null"
                        ]
                      },
                      "cnamName": {},
                      "carrierSuspensions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "mnoId": {
                              "type": "string"
                            },
                            "mnoName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "CARRIER",
                                "UPSTREAM",
                                "BRAND"
                              ]
                            },
                            "suspensionCategory": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reason": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tcrEventType": {
                              "type": "string"
                            },
                            "suspendedAt": {
                              "type": "string"
                            },
                            "liftedAt": {}
                          }
                        }
                      },
                      "statusHistory": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "timestamp": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED"
                              ]
                            }
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c54",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "status": "VERIFIED",
                    "entityType": "PRIVATE_PROFIT",
                    "displayName": "Acme Corp",
                    "companyName": "Acme Corporation LLC",
                    "ein": "123456789",
                    "phone": "5551234567",
                    "street": "123 Main St",
                    "city": "Springfield",
                    "state": "MO",
                    "postalCode": "65804",
                    "country": "US",
                    "email": "support@acme.com",
                    "vertical": "TECHNOLOGY",
                    "brandRelationship": "BASIC_ACCOUNT",
                    "brandScore": 75,
                    "cnamName": null,
                    "carrierSuspensions": [
                      {
                        "mnoId": "10017",
                        "mnoName": "AT&T",
                        "source": "BRAND",
                        "suspensionCategory": "SPAM",
                        "reason": "Brand B1234567 is suspended on AT&T network. Explanation: High complaint rate",
                        "tcrEventType": "MNO_BRAND_SUSPENSION_RULE_ACTIVE",
                        "suspendedAt": "2026-11-04T15:20:00.000Z",
                        "liftedAt": null
                      }
                    ],
                    "statusHistory": [
                      {
                        "timestamp": "2024-01-15T12:00:00.000Z",
                        "status": "PENDING_CREATION"
                      },
                      {
                        "timestamp": "2024-01-15T12:05:00.000Z",
                        "status": "VERIFIED"
                      }
                    ],
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:05:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Register a new Brand for 10DLC messaging via TCR.",
        "description": "Register a new Brand for 10DLC messaging via TCR.",
        "operationId": "brand.createBrand",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subgroupId": {
                    "type": "string",
                    "description": "ID of the subgroup."
                  },
                  "entityType": {
                    "type": "string",
                    "description": "PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, GOVERNMENT"
                  },
                  "displayName": {
                    "type": "string",
                    "description": "Brand display name."
                  },
                  "companyName": {
                    "type": "string",
                    "description": "Official company name."
                  },
                  "ein": {
                    "type": "string",
                    "description": "Employer Identification Number."
                  },
                  "einIssuingCountry": {
                    "type": "string",
                    "description": "2-letter country code that issued the EIN."
                  },
                  "altBusinessId": {
                    "type": "string",
                    "description": "Alternative business identifier (max 50 chars)."
                  },
                  "altBusinessIdType": {
                    "type": "string",
                    "description": "Type of alt ID: NONE, DUNS, LEI, GIIN."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "Contact first name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Contact last name."
                  },
                  "phone": {
                    "type": "string",
                    "description": "Brand contact phone number."
                  },
                  "mobilePhone": {
                    "type": "string",
                    "description": "Mobile phone number."
                  },
                  "street": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "2-letter state code (required for US addresses)."
                  },
                  "postalCode": {
                    "type": "string",
                    "description": "Zip/Postal code."
                  },
                  "country": {
                    "type": "string",
                    "description": "2-letter country code (e.g., US)."
                  },
                  "email": {
                    "type": "string",
                    "description": "Support email address."
                  },
                  "vertical": {
                    "type": "string",
                    "description": "Industry vertical (e.g., TECHNOLOGY)."
                  },
                  "brandRelationship": {
                    "type": "string",
                    "description": "Brand account tier. Ignored on create — the system always sets this to MEDIUM_ACCOUNT. One of: BASIC_ACCOUNT, SMALL_ACCOUNT, MEDIUM_ACCOUNT, LARGE_ACCOUNT, KEY_ACCOUNT."
                  },
                  "stockSymbol": {
                    "type": "string",
                    "description": "Stock ticker symbol. Required for PUBLIC_PROFIT."
                  },
                  "stockExchange": {
                    "type": "string",
                    "description": "Stock exchange. Required for PUBLIC_PROFIT."
                  },
                  "website": {
                    "type": "string",
                    "description": "Company website URL. Required for PUBLIC_PROFIT."
                  },
                  "businessContactEmail": {
                    "type": "string",
                    "description": "Business contact email. Required for PUBLIC_PROFIT."
                  },
                  "referenceId": {
                    "type": "string",
                    "description": "Your internal reference ID (max 50 chars)."
                  },
                  "tag": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of tags."
                  },
                  "mock": {
                    "type": "boolean",
                    "description": "If true, the brand is registered in TCR's mock environment instead of the live registry. TCR is still called and the mock brand auto-approves, so it does not exercise the rejection and error states a live registration can hit. Brand creation is not billed: nothing is reserved and nothing is charged. Campaign registration and number purchase under a mock brand are billed as normal, and there is no equivalent test flag for number purchase."
                  },
                  "optInLink": {
                    "type": "string",
                    "description": "Opt-in page URL."
                  },
                  "privacyPolicyLink": {
                    "type": "string",
                    "description": "Privacy policy URL."
                  },
                  "termsAndConditionsLink": {
                    "type": "string",
                    "description": "Terms and conditions URL."
                  },
                  "landingId": {
                    "type": "string",
                    "description": "Landing page ID to associate with the brand."
                  },
                  "complianceScanId": {
                    "type": "string",
                    "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                  }
                },
                "required": [
                  "subgroupId",
                  "entityType",
                  "displayName",
                  "companyName",
                  "ein",
                  "phone",
                  "street",
                  "city",
                  "state",
                  "postalCode",
                  "country",
                  "email",
                  "vertical"
                ]
              },
              "example": {
                "subgroupId": "S1234567",
                "entityType": "PRIVATE_PROFIT",
                "displayName": "Acme Corp",
                "companyName": "Acme Corporation LLC",
                "ein": "123456789",
                "phone": "5551234567",
                "street": "123 Main St",
                "city": "Springfield",
                "state": "MO",
                "postalCode": "65804",
                "country": "US",
                "email": "support@acme.com",
                "vertical": "TECHNOLOGY"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {},
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "PENDING_CREATION",
                        "PENDING_APPROVAL",
                        "UNVERIFIED",
                        "VERIFIED",
                        "VETTED_VERIFIED",
                        "PENDING_DELETE",
                        "DELETED",
                        "DCA_PENDING",
                        "DCA_ACTIVE",
                        "DCA_REJECTED",
                        "DCA_PENDING_2FA",
                        "DCA_PENDING_APPEAL",
                        "SHORT_CODE_REJECTED",
                        null
                      ]
                    },
                    "entityType": {
                      "type": "string",
                      "enum": [
                        "PRIVATE_PROFIT",
                        "PUBLIC_PROFIT",
                        "NON_PROFIT",
                        "GOVERNMENT"
                      ]
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "ein": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "street": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "vertical": {
                      "type": "string",
                      "enum": [
                        "PROFESSIONAL",
                        "REAL_ESTATE",
                        "HEALTHCARE",
                        "HUMAN_RESOURCES",
                        "ENERGY",
                        "ENTERTAINMENT",
                        "RETAIL",
                        "TRANSPORTATION",
                        "AGRICULTURE",
                        "INSURANCE",
                        "POSTAL",
                        "EDUCATION",
                        "HOSPITALITY",
                        "FINANCIAL",
                        "POLITICAL",
                        "GAMBLING",
                        "LEGAL",
                        "CONSTRUCTION",
                        "NGO",
                        "MANUFACTURING",
                        "GOVERNMENT",
                        "TECHNOLOGY",
                        "COMMUNICATION"
                      ]
                    },
                    "brandRelationship": {
                      "type": "string",
                      "enum": [
                        "BASIC_ACCOUNT",
                        "SMALL_ACCOUNT",
                        "MEDIUM_ACCOUNT",
                        "LARGE_ACCOUNT",
                        "KEY_ACCOUNT"
                      ]
                    },
                    "statusHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING_CREATION",
                              "PENDING_APPROVAL",
                              "UNVERIFIED",
                              "VERIFIED",
                              "VETTED_VERIFIED",
                              "PENDING_DELETE",
                              "DELETED",
                              "DCA_PENDING",
                              "DCA_ACTIVE",
                              "DCA_REJECTED",
                              "DCA_PENDING_2FA",
                              "DCA_PENDING_APPEAL",
                              "SHORT_CODE_REJECTED"
                            ]
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5e",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": null,
                  "status": "PENDING_CREATION",
                  "entityType": "PRIVATE_PROFIT",
                  "displayName": "Acme Corp",
                  "companyName": "Acme Corporation LLC",
                  "ein": "123456789",
                  "phone": "5551234567",
                  "street": "123 Main St",
                  "city": "Springfield",
                  "state": "MO",
                  "postalCode": "65804",
                  "country": "US",
                  "email": "support@acme.com",
                  "vertical": "TECHNOLOGY",
                  "brandRelationship": "MEDIUM_ACCOUNT",
                  "statusHistory": [
                    {
                      "timestamp": "2024-01-15T12:00:00.000Z",
                      "status": "PENDING_CREATION"
                    }
                  ],
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/appeal/{brandId}": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Retrieve the identity status appeal history for a brand from TCR.",
        "description": "Retrieve the identity status appeal history for a brand from TCR.",
        "operationId": "brand.readAppealHistory",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "appealId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "appealCategories": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "explanation": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "appealId": "AP123456",
                    "brandId": "B1234567",
                    "appealCategories": [
                      "VERIFY_TAX_ID"
                    ],
                    "explanation": "Updated EIN documentation attached for verification.",
                    "status": "PENDING",
                    "createdAt": "2024-01-20T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Submit an identity status appeal for a brand.",
        "description": "Submit an identity status appeal for a brand. Requires a supporting document upload (max 10MB). If TCR refuses the appeal, the response keeps TCR's 4xx status, error carries TCR's reason, and details carries TCR's code and message: for example 400 with details { code: 592, message: 'It is not possible to appeal records that are older than 45 days' } for a brand registered more than 45 days ago, which can no longer be appealed.",
        "operationId": "brand.submitAppeal",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "appealCategories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "One or more of: VERIFY_TAX_ID, VERIFY_NON_PROFIT, VERIFY_GOVERNMENT."
                  },
                  "explanation": {
                    "type": "string",
                    "description": "Explanation for the appeal (max 1024 characters)."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Supporting document (max 10MB)."
                  }
                },
                "required": [
                  "appealCategories",
                  "explanation",
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "Appeal submitted successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/cnam/{brandId}": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Read a brand's caller name (CNAM) and the numbers it applies to: every number whose caller name comes from this brand (its campaign numbers, numbers it was picked on, and campaign-less numbers of subgroups that use it as their default caller-ID brand).",
        "description": "Read a brand's caller name (CNAM) and the numbers it applies to: every number whose caller name comes from this brand (its campaign numbers, numbers it was picked on, and campaign-less numbers of subgroups that use it as their default caller-ID brand). cnamName is null when the brand has none. items lists the first 100 numbers; total counts them all.",
        "operationId": "brand.readBrandCnam",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brandId": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "cnamName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "numbers": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "phoneNumber": {
                                "type": "string"
                              },
                              "friendlyName": {
                                "type": "string"
                              },
                              "cnam": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string"
                                  },
                                  "brandId": {
                                    "type": "string"
                                  },
                                  "brandFrom": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "reason": {},
                                  "updatedAt": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "brandId": "B1A2C3D",
                  "companyName": "ABC Home Services & Repair Inc.",
                  "cnamName": "ABC Home",
                  "eligible": true,
                  "numbers": {
                    "total": 2,
                    "items": [
                      {
                        "phoneNumber": "14175551234",
                        "friendlyName": "Main Line",
                        "cnam": {
                          "name": "ABC Home",
                          "source": "BRAND",
                          "brandId": "B1A2C3D",
                          "brandFrom": "CAMPAIGN",
                          "status": "ACTIVE",
                          "reason": null,
                          "updatedAt": "2026-11-09T18:00:00.000Z"
                        }
                      },
                      {
                        "phoneNumber": "14175551235",
                        "friendlyName": null,
                        "cnam": {
                          "name": "ABC Home",
                          "source": "BRAND",
                          "brandId": "B1A2C3D",
                          "brandFrom": "CAMPAIGN",
                          "status": "ACTIVE",
                          "reason": null,
                          "updatedAt": "2026-11-09T18:00:00.000Z"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Brands"
        ],
        "summary": "Set a brand's caller name for every number whose caller name comes from the brand.",
        "description": "Set a brand's caller name for every number whose caller name comes from the brand. It replaces names set on those numbers, and numbers that later come under the brand get it too. A name set on one number afterwards (PUT /number/:phoneNumber/cnam) still overrides it for that number. The name must come from the brand's registered name with characters only removed, and the brand must be verified. The numbers are updated at the carrier in the background, so their cnam.status is PENDING until then; carriers can take a few days to start showing a new name. Returns 400 if the brand isn't verified or the name isn't allowed.",
        "operationId": "brand.setBrandCnam",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetBrandCnamRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brandId": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "cnamName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "numbers": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "phoneNumber": {
                                "type": "string"
                              },
                              "friendlyName": {
                                "type": "string"
                              },
                              "cnam": {
                                "type": "object",
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "source": {
                                    "type": "string"
                                  },
                                  "brandId": {
                                    "type": "string"
                                  },
                                  "brandFrom": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "reason": {},
                                  "updatedAt": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "brandId": "B1A2C3D",
                  "companyName": "ABC Home Services & Repair Inc.",
                  "cnamName": "ABC Home",
                  "eligible": true,
                  "numbers": {
                    "total": 1,
                    "items": [
                      {
                        "phoneNumber": "14175551234",
                        "friendlyName": "Main Line",
                        "cnam": {
                          "name": "Signal",
                          "source": "BRAND",
                          "brandId": "B1A2C3D",
                          "brandFrom": "CAMPAIGN",
                          "status": "PENDING",
                          "reason": null,
                          "updatedAt": "2026-11-09T18:00:00.000Z"
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Brands"
        ],
        "summary": "Remove a brand's caller name.",
        "description": "Remove a brand's caller name. Numbers that had it go back to the automatic name if their subgroup has caller name auto-apply on, otherwise to no caller name. Names set on a number are kept.",
        "operationId": "brand.deleteBrandCnam",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brandId": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "cnamName": {},
                    "eligible": {
                      "type": "boolean"
                    },
                    "numbers": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "items": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "brandId": "B1A2C3D",
                  "companyName": "ABC Home Services & Repair Inc.",
                  "cnamName": null,
                  "eligible": true,
                  "numbers": {
                    "total": 0,
                    "items": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/brand/externalvetting/import/{brandId}": {
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Import an existing external vetting record completed directly with the provider.",
        "description": "Import an existing external vetting record completed directly with the provider. Not billable.",
        "operationId": "brand.importExternalVettingRequest",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportExternalVettingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "vettingId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "vettingProviderId": {
                      "type": "string"
                    },
                    "vettingClass": {
                      "type": "string"
                    },
                    "vettingStatus": {
                      "type": "string"
                    },
                    "vettedDate": {
                      "type": "string"
                    },
                    "score": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "vettingId": "VT123456",
                  "brandId": "B1234567",
                  "vettingProviderId": "AEGIS",
                  "vettingClass": "STANDARD",
                  "vettingStatus": "ACTIVE",
                  "vettedDate": "2024-01-20T12:00:00.000Z",
                  "score": 85
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/externalvetting/{brandId}": {
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Request 3rd party external vetting to increase daily messaging limits.",
        "description": "Request 3rd party external vetting to increase daily messaging limits.",
        "operationId": "brand.createExternalVettingRequest",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateExternalVettingRequestRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "External vetting request for brand B1234567 has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Retrieve external vetting history for a brand.",
        "description": "Retrieve external vetting history for a brand.",
        "operationId": "brand.readExternalVettingHistory",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "vettingId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "vettingProviderId": {
                        "type": "string"
                      },
                      "vettingClass": {
                        "type": "string"
                      },
                      "vettingStatus": {
                        "type": "string"
                      },
                      "vettedDate": {
                        "type": "string"
                      },
                      "score": {
                        "type": "integer"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "vettingId": "VT123456",
                    "brandId": "B1234567",
                    "vettingProviderId": "AEGIS",
                    "vettingClass": "STANDARD",
                    "vettingStatus": "ACTIVE",
                    "vettedDate": "2024-01-20T12:00:00.000Z",
                    "score": 85
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/feedback/{brandId}": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Retrieve TCR's identity feedback for a brand: why TCR could not verify it.",
        "description": "Retrieve TCR's identity feedback for a brand: why TCR could not verify it. Useful when a 10DLC brand's status is UNVERIFIED. Each category names the fields it concerns and carries TCR's error codes and messages. Correct those fields with PUT /brand/:brandId, then revet the brand, or appeal with POST /brand/appeal/:brandId if the details are already right. Toll-free and short-code brands are not registered with TCR and return 400.",
        "operationId": "brand.readBrandFeedback",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brandId": {
                      "type": "string"
                    },
                    "category": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "errors": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "brandId": "B1234567",
                  "category": [
                    {
                      "id": "TAX_ID",
                      "displayName": "Tax Id",
                      "description": "Tax id does not match with the company name or business type.",
                      "fields": [
                        "ein",
                        "companyName",
                        "entityType"
                      ],
                      "errors": [
                        {
                          "code": "TFTI04",
                          "message": "The submitted legal company name does not match with US EIN."
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/revet/{brandId}": {
      "put": {
        "tags": [
          "Brands"
        ],
        "summary": "Re-submit a brand for vetting to refresh its verification status.",
        "description": "Re-submit a brand for vetting to refresh its verification status.",
        "operationId": "brand.revetBrand",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Brand B1234567 revet has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/short-code": {
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Create a local Short Code brand for manual Signal House review.",
        "description": "Create a local Short Code brand for manual Signal House review. The route forces registrationType=SHORT_CODE, requires the group shortCodeEnabled flag, and returns the brand in PENDING_APPROVAL. Signal House landing pages are not accepted; provide the customer's direct website.",
        "operationId": "brand.createShortCodeBrand",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShortCodeBrandRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "brandId": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "PENDING_CREATION",
                        "PENDING_APPROVAL",
                        "UNVERIFIED",
                        "VERIFIED",
                        "VETTED_VERIFIED",
                        "PENDING_DELETE",
                        "DELETED",
                        "DCA_PENDING",
                        "DCA_ACTIVE",
                        "DCA_REJECTED",
                        "DCA_PENDING_2FA",
                        "DCA_PENDING_APPEAL",
                        "SHORT_CODE_REJECTED",
                        null
                      ]
                    }
                  }
                },
                "example": {
                  "brandId": "SCB7K3M9QXR2V",
                  "registrationType": "SHORT_CODE",
                  "status": "PENDING_APPROVAL"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/toll-free": {
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Register a new Toll-Free (TFN) brand.",
        "description": "Register a new Toll-Free (TFN) brand. Toll-Free registration is free and does not use TCR — the brand is created as a draft with the connectivity provider and is registered when a Toll-Free campaign is submitted for review. Requires the tollFreeEnabled feature flag on the group. Some groups' toll-free brands are reviewed when they're submitted instead: `GET /brand/toll-free-requirements/:groupId` says whether this group's are (`reviewsBusinessOnSubmit`). For such a group the brand also needs `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel`, `tollFree.countryCode` must be `US` or `CA`, and `state` must be a 2-letter state or province code; a request without them is refused with a 400. The brand's status then follows the review of its business: `DCA_PENDING` while the review is under way, which usually takes 1–2 business days, `DCA_ACTIVE` once it passes, or `DCA_REJECTED` with `tollFree.rejectionReason` saying why in plain English. Campaigns can be added once it's `DCA_ACTIVE`. The group's brands with the same business (the same legal name, registration type and number, business structure and address, compared ignoring letter case, punctuation and repeated spaces) share one review: a new brand whose business already passed becomes `DCA_ACTIVE` as soon as it's created, and brands waiting on the same review move together when it ends. A rejected review is never reused, so a new brand with the same business is reviewed again. In a group that reviews each subgroup's business separately (a platform whose subgroups are separate businesses, set up by Signal House), only brands of the same subgroup share a review. The brand's business details can't be changed after it's submitted: `companyName`, `street`, `city`, `state`, `postalCode`, `country`, `firstName`, `lastName`, `tollFree.businessRegistrationType`, `tollFree.taxId`, `tollFree.countryCode`, `tollFree.taxIdIssuingCountry`, `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel`. So a rejected brand is fixed by submitting a new brand with the corrections. Any other group's toll-free brands are refused `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel` with a 400.",
        "operationId": "brand.createTollFreeBrand",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subgroupId": {
                    "type": "string",
                    "description": "ID of the subgroup (8 characters)."
                  },
                  "displayName": {
                    "type": "string",
                    "description": "Brand display name."
                  },
                  "companyName": {
                    "type": "string",
                    "description": "Official company name."
                  },
                  "firstName": {
                    "type": "string",
                    "description": "Contact first name."
                  },
                  "lastName": {
                    "type": "string",
                    "description": "Contact last name."
                  },
                  "street": {
                    "type": "string",
                    "description": "Street address."
                  },
                  "city": {
                    "type": "string",
                    "description": "City."
                  },
                  "state": {
                    "type": "string",
                    "description": "State or province. Must be a 2-letter code for US addresses, and a 2-letter state or province code when the group's toll-free brands are reviewed on submit."
                  },
                  "postalCode": {
                    "type": "string",
                    "description": "Zip/Postal code."
                  },
                  "email": {
                    "type": "string",
                    "description": "Support email address."
                  },
                  "website": {
                    "type": "string",
                    "description": "Company website URL."
                  },
                  "tollFree": {
                    "type": "object",
                    "description": "Toll-Free registration details (see sub-fields below).",
                    "properties": {
                      "businessRegistrationType": {
                        "type": "string",
                        "description": "Business registration ID type (see values below)."
                      },
                      "legalEntityType": {
                        "type": "string",
                        "description": "Legal entity type (see values below)."
                      },
                      "taxId": {
                        "type": "string",
                        "description": "Business tax ID / registration number (max 50 chars)."
                      },
                      "countryCode": {
                        "type": "string",
                        "description": "2-letter ISO country code where the business is registered. US or CA when the group's toll-free brands are reviewed on submit."
                      },
                      "supportPhone": {
                        "type": "string",
                        "description": "Business support / compliance phone number. Must be E.164 with an optional leading + and no spaces, parentheses or hyphens (e.g. 17025550100)."
                      },
                      "taxIdIssuingCountry": {
                        "type": "string",
                        "description": "2-letter ISO country code that issued the tax ID."
                      },
                      "businessDBA": {
                        "type": "string",
                        "description": "Doing-business-as name (max 255 chars)."
                      },
                      "businessWebsite": {
                        "type": "string",
                        "description": "The customer's real website, sent to the toll-free carrier for verification (max 255 chars; distinct from the top-level website / landing URL)."
                      },
                      "businessStructure": {
                        "type": "string",
                        "description": "The business's legal structure (see values below). Required when the group's toll-free brands are reviewed on submit (reviewsBusinessOnSubmit is true on GET /brand/toll-free-requirements/:groupId), and refused with a 400 otherwise. It can't be changed after the brand is submitted."
                      },
                      "industry": {
                        "type": "string",
                        "description": "The business's industry (see values below). Required when the group's toll-free brands are reviewed on submit (reviewsBusinessOnSubmit is true on GET /brand/toll-free-requirements/:groupId), and refused with a 400 otherwise. It can't be changed after the brand is submitted."
                      },
                      "contactEmail": {
                        "type": "string",
                        "description": "The email address of the contact named by firstName and lastName (max 100 chars), kept apart from the support email in email. Required when the group's toll-free brands are reviewed on submit (reviewsBusinessOnSubmit is true on GET /brand/toll-free-requirements/:groupId), and refused with a 400 otherwise. It can't be changed after the brand is submitted."
                      },
                      "contactJobTitle": {
                        "type": "string",
                        "description": "The contact's job title (max 100 chars). Required when the group's toll-free brands are reviewed on submit (reviewsBusinessOnSubmit is true on GET /brand/toll-free-requirements/:groupId), and refused with a 400 otherwise. It can't be changed after the brand is submitted."
                      },
                      "contactJobLevel": {
                        "type": "string",
                        "description": "The contact's job level (see values below). Required when the group's toll-free brands are reviewed on submit (reviewsBusinessOnSubmit is true on GET /brand/toll-free-requirements/:groupId), and refused with a 400 otherwise. It can't be changed after the brand is submitted."
                      }
                    },
                    "required": [
                      "businessRegistrationType",
                      "legalEntityType",
                      "taxId",
                      "countryCode",
                      "supportPhone"
                    ]
                  },
                  "country": {
                    "type": "string",
                    "description": "2-letter country code. When set to US, state must be a 2-letter US state code."
                  },
                  "referenceId": {
                    "type": "string",
                    "description": "Your internal reference ID (max 50 chars)."
                  },
                  "tag": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of tags."
                  },
                  "mock": {
                    "type": "boolean",
                    "description": "Accepted and stored, but has no effect on Toll-Free registration: Toll-Free does not use TCR and is already free."
                  },
                  "optInLink": {
                    "type": "string",
                    "description": "Opt-in page URL."
                  },
                  "privacyPolicyLink": {
                    "type": "string",
                    "description": "Privacy policy URL."
                  },
                  "termsAndConditionsLink": {
                    "type": "string",
                    "description": "Terms and conditions URL."
                  },
                  "landingId": {
                    "type": "string",
                    "description": "Landing page ID to associate with the brand."
                  },
                  "complianceScanId": {
                    "type": "string",
                    "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                  }
                },
                "required": [
                  "subgroupId",
                  "displayName",
                  "companyName",
                  "firstName",
                  "lastName",
                  "street",
                  "city",
                  "state",
                  "postalCode",
                  "email",
                  "website",
                  "tollFree"
                ]
              },
              "example": {
                "subgroupId": "S1234567",
                "displayName": "Acme Corp",
                "companyName": "Acme Corporation LLC",
                "firstName": "Jane",
                "lastName": "Doe",
                "street": "123 Main St",
                "city": "Springfield",
                "state": "MO",
                "postalCode": "65804",
                "email": "support@acme.com",
                "website": "https://acme.com",
                "tollFree": {
                  "businessRegistrationType": "EIN",
                  "legalEntityType": "PRIVATE_COMPANY",
                  "taxId": "123456789",
                  "countryCode": "US",
                  "supportPhone": "+15551234567",
                  "businessWebsite": "https://acme.com"
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "PENDING_CREATION",
                        "PENDING_APPROVAL",
                        "UNVERIFIED",
                        "VERIFIED",
                        "VETTED_VERIFIED",
                        "PENDING_DELETE",
                        "DELETED",
                        "DCA_PENDING",
                        "DCA_ACTIVE",
                        "DCA_REJECTED",
                        "DCA_PENDING_2FA",
                        "DCA_PENDING_APPEAL",
                        "SHORT_CODE_REJECTED",
                        null
                      ]
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "companyName": {
                      "type": "string"
                    },
                    "firstName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "street": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tollFree": {
                      "type": "object",
                      "properties": {
                        "businessRegistrationType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "EIN",
                            "CBN",
                            "NEQ",
                            "PROVINCIAL_NUMBER",
                            "CRN",
                            "VAT",
                            "ACN",
                            "ABN",
                            "BRN",
                            "SIREN",
                            "SIRET",
                            "NZBN",
                            "UST_IDNR",
                            "CIF",
                            "NIF",
                            "CNPJ",
                            "UID",
                            "OTHER",
                            null
                          ]
                        },
                        "legalEntityType": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "PRIVATE_COMPANY",
                            "PUBLIC_COMPANY",
                            "NON_PROFIT",
                            "GOVERNMENT",
                            "SOLE_PROPRIETOR",
                            null
                          ]
                        },
                        "taxId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "countryCode": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "supportPhone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "businessWebsite": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "infobipBrandId": {},
                        "businessStructure": {},
                        "industry": {},
                        "contactEmail": {},
                        "contactJobTitle": {},
                        "contactJobLevel": {},
                        "rejectionReason": {},
                        "isBrandReady": {
                          "type": "boolean"
                        },
                        "maxNumbersPerCampaign": {
                          "type": "integer"
                        },
                        "maxOptInMethods": {
                          "type": "integer"
                        },
                        "requiresPrivacyPolicy": {
                          "type": "boolean"
                        },
                        "requiresTermsAndConditions": {
                          "type": "boolean"
                        },
                        "maxAppealReasonLength": {
                          "type": "integer"
                        },
                        "labelsSamples": {
                          "type": "boolean"
                        },
                        "supportsMms": {
                          "type": "boolean"
                        },
                        "reviewsBusinessOnSubmit": {
                          "type": "boolean"
                        }
                      }
                    },
                    "statusHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "timestamp": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "PENDING_CREATION",
                              "PENDING_APPROVAL",
                              "UNVERIFIED",
                              "VERIFIED",
                              "VETTED_VERIFIED",
                              "PENDING_DELETE",
                              "DELETED",
                              "DCA_PENDING",
                              "DCA_ACTIVE",
                              "DCA_REJECTED",
                              "DCA_PENDING_2FA",
                              "DCA_PENDING_APPEAL",
                              "SHORT_CODE_REJECTED"
                            ]
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5e",
                  "registrationType": "TOLL_FREE",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": "TFNB7K3M9QXR2V",
                  "status": "PENDING_CREATION",
                  "displayName": "Acme Corp",
                  "companyName": "Acme Corporation LLC",
                  "firstName": "Jane",
                  "lastName": "Doe",
                  "street": "123 Main St",
                  "city": "Springfield",
                  "state": "MO",
                  "postalCode": "65804",
                  "email": "support@acme.com",
                  "website": "https://acme.com",
                  "tollFree": {
                    "businessRegistrationType": "EIN",
                    "legalEntityType": "PRIVATE_COMPANY",
                    "taxId": "123456789",
                    "countryCode": "US",
                    "supportPhone": "+15551234567",
                    "businessWebsite": "https://acme.com",
                    "infobipBrandId": null,
                    "businessStructure": null,
                    "industry": null,
                    "contactEmail": null,
                    "contactJobTitle": null,
                    "contactJobLevel": null,
                    "rejectionReason": null,
                    "isBrandReady": false,
                    "maxNumbersPerCampaign": 5,
                    "maxOptInMethods": 4,
                    "requiresPrivacyPolicy": true,
                    "requiresTermsAndConditions": true,
                    "maxAppealReasonLength": 2048,
                    "labelsSamples": true,
                    "supportsMms": true,
                    "reviewsBusinessOnSubmit": false
                  },
                  "statusHistory": [
                    {
                      "timestamp": "2024-01-15T12:00:00.000Z",
                      "status": "PENDING_CREATION"
                    }
                  ],
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/toll-free-requirements/{groupId}": {
      "get": {
        "tags": [
          "Brands"
        ],
        "summary": "Read whether a group's new toll-free brands are reviewed when they're submitted, which decides what `POST /brand/toll-free` needs.",
        "description": "Read whether a group's new toll-free brands are reviewed when they're submitted, which decides what `POST /brand/toll-free` needs. When `reviewsBusinessOnSubmit` is true, a new toll-free brand needs `tollFree.businessStructure`, `tollFree.industry`, `tollFree.contactEmail`, `tollFree.contactJobTitle` and `tollFree.contactJobLevel`, a `tollFree.countryCode` of `US` or `CA` and a 2-letter `state`; its status follows the review of its business (`DCA_PENDING` while the review is under way, `DCA_ACTIVE` once it passes, or `DCA_REJECTED` with `tollFree.rejectionReason`), and its business details can't be changed after it's submitted. When it's false, those five fields are refused with a 400. The answer is for the group's new brands and follows its current toll-free carrier; each brand keeps its own answer in `tollFree.reviewsBusinessOnSubmit`. A group you can't view returns a 403.",
        "operationId": "brand.readTollFreeRequirements",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID starting with 'G'. Any group you can view."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "reviewsBusinessOnSubmit": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567",
                  "reviewsBusinessOnSubmit": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/transfer/{subgroupId}": {
      "post": {
        "tags": [
          "Brands"
        ],
        "summary": "Transfer one or more brands to a different subgroup.",
        "description": "Transfer one or more brands to a different subgroup. Some groups review each subgroup's business separately: a platform whose subgroups are separate businesses, set up by Signal House. In those groups a toll-free brand that was reviewed when it was submitted (its `tollFree.reviewsBusinessOnSubmit` is true) belongs to its subgroup's business and can't move to another subgroup: the request is refused with a 400 that names the brand, and no brand is moved.",
        "operationId": "brand.transferBrands",
        "parameters": [
          {
            "name": "subgroupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The target Subgroup ID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferBrandsRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Successfully transferred 1 brands to subgroup S7654321"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/brand/{brandId}": {
      "put": {
        "tags": [
          "Brands"
        ],
        "summary": "Update an existing brand.",
        "description": "Update an existing brand. For 10DLC brands the update syncs to TCR (only UNVERIFIED/VERIFIED/VETTED_VERIFIED brands are editable). For Toll-Free brands the update syncs to the carrier where it keeps a brand record (only DCA_PENDING/DCA_ACTIVE brands are editable); send Toll-Free address/contact fields and a tollFree object. A Toll-Free brand that was reviewed when it was submitted (its `tollFree.reviewsBusinessOnSubmit` is true) keeps its business details: changing companyName, street, city, state, postalCode, country, firstName, lastName, tollFree.businessRegistrationType, tollFree.taxId, tollFree.countryCode or tollFree.taxIdIssuingCountry is refused (400) with a message naming the changed fields, for example “These fields can't be changed after the brand is submitted: companyName, tollFree.taxId.” Sending a field's stored value is allowed, even written differently, as long as it is otherwise valid: text is compared without surrounding spaces, tollFree.taxId by its letters and digits only (12-3456789 matches 123456789), and country, state, tollFree.countryCode and tollFree.taxIdIssuingCountry regardless of letter case. Its other fields stay editable. A Toll-Free brand's update never accepts tollFree.businessStructure, tollFree.industry, tollFree.contactEmail, tollFree.contactJobTitle or tollFree.contactJobLevel (400): they are set when the brand is created.",
        "operationId": "brand.updateBrand",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "companyName": {
                    "type": "string",
                    "description": "Official company name."
                  },
                  "displayName": {
                    "type": "string",
                    "description": "Brand display name."
                  },
                  "email": {
                    "type": "string",
                    "description": "Support email address."
                  },
                  "tollFree": {
                    "type": "object",
                    "description": "Toll-Free editable fields (Toll-Free brands only): legalEntityType, businessRegistrationType, taxId, countryCode, supportPhone, taxIdIssuingCountry, businessDBA, businessWebsite. supportPhone must be E.164 with an optional leading + and no spaces, parentheses or hyphens (e.g. 17025550100). subgroupId is immutable. businessStructure, industry, contactEmail, contactJobTitle and contactJobLevel are set when the brand is created and aren't accepted here."
                  }
                }
              },
              "example": {
                "email": "newsupport@acme.com"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Brand B1234567 update has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Brands"
        ],
        "summary": "Delete a brand and deregister it from its registrar (TCR for 10DLC brands; for Toll-Free brands, the toll-free carrier where it keeps a brand record).",
        "description": "Delete a brand and deregister it from its registrar (TCR for 10DLC brands; for Toll-Free brands, the toll-free carrier where it keeps a brand record).",
        "operationId": "brand.deleteBrand",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand lookup id (carrier Brand ID, Mongo _id, or internal reference UUID)."
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Brand B1234567 deletion has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/campaign": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Read campaigns using optional query filters.",
        "description": "Read campaigns using optional query filters.",
        "operationId": "campaign.readCampaign",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by campaign status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationType",
            "in": "query",
            "required": false,
            "description": "Filter by registration type: TEN_DLC, TOLL_FREE, or SHORT_CODE. Omit to return campaigns of all registration types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "With brandId, subgroupId or groupId: free text finds part of the campaign ID. `field:` names campaignId or brandId. Repeat the param to send several values; every value must match. Each value is free text, or `field:term` to search one field. Each term is 3 to 100 characters, with at most 5 values; a shorter term returns 400. Works with the scoping filters above.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "campaignId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "PENDING_REVIEW",
                          "REJECTED",
                          "PENDING_CREATION",
                          "TCR_REGISTER_FAILED",
                          "TCR_REGISTERED",
                          "TCR_UPSTREAM_FAILED",
                          "TCR_UPSTREAMED",
                          "DCA_DRAFT_FAILED",
                          "DCA_DRAFT",
                          "DCA_REGISTER_FAILED",
                          "PENDING_DCA_APPROVAL",
                          "DCA_REJECTED",
                          "ACTIVE",
                          "PENDING_DELETE",
                          "EXPIRED",
                          "CANCELLED_FOR_COMPLIANCE"
                        ]
                      },
                      "usecase": {
                        "type": "string",
                        "enum": [
                          "2FA",
                          "ACCOUNT_NOTIFICATION",
                          "AGENTS_FRANCHISES",
                          "CARRIER_EXEMPT",
                          "CHARITY",
                          "CUSTOMER_CARE",
                          "DELIVERY_NOTIFICATION",
                          "EMERGENCY",
                          "FRAUD_ALERT",
                          "HIGHER_EDUCATION",
                          "K12_EDUCATION",
                          "LOW_VOLUME",
                          "M2M",
                          "MARKETING",
                          "MIXED",
                          "POLITICAL",
                          "POLLING_VOTING",
                          "PROXY",
                          "PUBLIC_SAFETY_RESTRICTED",
                          "PUBLIC_SERVICE_ANNOUNCEMENT",
                          "SECURITY_ALERT",
                          "SOCIAL",
                          "SOLE_PROPRIETOR",
                          "SWEEPSTAKE",
                          "TRIAL",
                          "UCAAS_HIGH",
                          "UCAAS_LOW"
                        ]
                      },
                      "description": {
                        "type": "string"
                      },
                      "messageFlow": {
                        "type": "string"
                      },
                      "embeddedLink": {
                        "type": "boolean"
                      },
                      "embeddedPhone": {
                        "type": "boolean"
                      },
                      "numberPool": {
                        "type": "boolean"
                      },
                      "ageGated": {
                        "type": "boolean"
                      },
                      "directLending": {
                        "type": "boolean"
                      },
                      "subscriberOptIn": {
                        "type": "boolean"
                      },
                      "subscriberOptOut": {
                        "type": "boolean"
                      },
                      "subscriberHelp": {
                        "type": "boolean"
                      },
                      "sample1": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "autoRenewal": {
                        "type": "boolean"
                      },
                      "privacyPolicyLink": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "termsAndConditionsLink": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "mnoMetadata": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "mno": {
                              "type": "string"
                            },
                            "mnoSupport": {
                              "type": "boolean"
                            },
                            "qualify": {
                              "type": "boolean"
                            },
                            "tpm": {
                              "type": "integer"
                            },
                            "brandTier": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "statusHistory": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "timestamp": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "PENDING_REVIEW",
                                "REJECTED",
                                "PENDING_CREATION",
                                "TCR_REGISTER_FAILED",
                                "TCR_REGISTERED",
                                "TCR_UPSTREAM_FAILED",
                                "TCR_UPSTREAMED",
                                "DCA_DRAFT_FAILED",
                                "DCA_DRAFT",
                                "DCA_REGISTER_FAILED",
                                "PENDING_DCA_APPROVAL",
                                "DCA_REJECTED",
                                "ACTIVE",
                                "PENDING_DELETE",
                                "EXPIRED",
                                "CANCELLED_FOR_COMPLIANCE"
                              ]
                            },
                            "eventType": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "brandId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "brandName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "cspId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "cspName": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      },
                      "sentiment": {
                        "type": "object",
                        "properties": {
                          "sevenDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "label": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scoredCount": {
                                "type": "integer"
                              },
                              "positive": {
                                "type": "integer"
                              },
                              "neutral": {
                                "type": "integer"
                              },
                              "negative": {
                                "type": "integer"
                              }
                            }
                          },
                          "thirtyDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "label": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scoredCount": {
                                "type": "integer"
                              },
                              "positive": {
                                "type": "integer"
                              },
                              "neutral": {
                                "type": "integer"
                              },
                              "negative": {
                                "type": "integer"
                              }
                            }
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "health": {
                        "type": "object",
                        "properties": {
                          "sevenDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "optOutRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "optOutScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "messagesSent": {
                                "type": "integer"
                              },
                              "messagesDelivered": {
                                "type": "integer"
                              },
                              "messagesFailed": {
                                "type": "integer"
                              },
                              "optOuts": {
                                "type": "integer"
                              }
                            }
                          },
                          "thirtyDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "deliveryRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "optOutRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "optOutScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "messagesSent": {
                                "type": "integer"
                              },
                              "messagesDelivered": {
                                "type": "integer"
                              },
                              "messagesFailed": {
                                "type": "integer"
                              },
                              "optOuts": {
                                "type": "integer"
                              }
                            }
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "carrierSuspensions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "mnoId": {
                              "type": "string"
                            },
                            "mnoName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "source": {
                              "type": "string",
                              "enum": [
                                "CARRIER",
                                "UPSTREAM",
                                "BRAND"
                              ]
                            },
                            "suspensionCategory": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "reason": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tcrEventType": {
                              "type": "string"
                            },
                            "suspendedAt": {
                              "type": "string"
                            },
                            "liftedAt": {}
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c55",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "campaignId": "C1234567",
                    "status": "ACTIVE",
                    "usecase": "MARKETING",
                    "description": "Weekly promotional discounts and updates to registered retail customers.",
                    "messageFlow": "Users opt-in by entering their phone number on our website registration form.",
                    "embeddedLink": false,
                    "embeddedPhone": false,
                    "numberPool": false,
                    "ageGated": false,
                    "directLending": false,
                    "subscriberOptIn": true,
                    "subscriberOptOut": true,
                    "subscriberHelp": true,
                    "sample1": "Hi {name}, this week save 20% on all items! Reply STOP to opt out.",
                    "autoRenewal": true,
                    "privacyPolicyLink": "https://example.com/privacy",
                    "termsAndConditionsLink": "https://example.com/terms",
                    "mnoMetadata": [
                      {
                        "mno": "ATT",
                        "mnoSupport": true,
                        "qualify": true,
                        "tpm": 4500,
                        "brandTier": "MID"
                      }
                    ],
                    "statusHistory": [
                      {
                        "timestamp": "2024-01-15T12:00:00.000Z",
                        "status": "PENDING_REVIEW",
                        "eventType": "Campaign Submitted",
                        "brandId": "BRAND001",
                        "brandName": "Acme Corp",
                        "cspId": "SK62Q5O",
                        "cspName": "Signal House LLC",
                        "description": "Campaign submitted for review"
                      },
                      {
                        "timestamp": "2024-01-16T10:00:00.000Z",
                        "status": "ACTIVE",
                        "eventType": "Campaign Activated",
                        "brandId": "BRAND001",
                        "brandName": "Acme Corp",
                        "cspId": "SK62Q5O",
                        "cspName": "Signal House LLC",
                        "description": "Campaign activated"
                      }
                    ],
                    "sentiment": {
                      "sevenDay": {
                        "score": 42,
                        "label": "positive",
                        "scoredCount": 128,
                        "positive": 96,
                        "neutral": 20,
                        "negative": 12
                      },
                      "thirtyDay": {
                        "score": 18,
                        "label": "neutral",
                        "scoredCount": 512,
                        "positive": 300,
                        "neutral": 150,
                        "negative": 62
                      },
                      "updatedAt": "2024-01-16T09:50:00.000Z"
                    },
                    "health": {
                      "sevenDay": {
                        "score": 9.5,
                        "deliveryRate": 94.2,
                        "optOutRate": 1.1,
                        "deliveryScore": 10,
                        "optOutScore": 9,
                        "messagesSent": 1240,
                        "messagesDelivered": 1168,
                        "messagesFailed": 31,
                        "optOuts": 14
                      },
                      "thirtyDay": {
                        "score": 9,
                        "deliveryRate": 91.8,
                        "optOutRate": 1.6,
                        "deliveryScore": 9,
                        "optOutScore": 8,
                        "messagesSent": 5310,
                        "messagesDelivered": 4875,
                        "messagesFailed": 210,
                        "optOuts": 85
                      },
                      "updatedAt": "2024-01-16T09:50:00.000Z"
                    },
                    "carrierSuspensions": [
                      {
                        "mnoId": "10038",
                        "mnoName": "Verizon Wireless",
                        "source": "CARRIER",
                        "suspensionCategory": "SPAM",
                        "reason": "Campaign C1234567 suspended on Verizon Wireless network. Suspension Category: SPAM. Details: High Customer Complaints (16%)",
                        "tcrEventType": "MNO_CAMPAIGN_OPERATION_SUSPENDED",
                        "suspendedAt": "2026-11-04T15:20:00.000Z",
                        "liftedAt": null
                      }
                    ],
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-16T10:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a new 10DLC Campaign and assign numbers to it.",
        "description": "Create a new 10DLC Campaign and assign numbers to it. Submits for Signal House review. Set useDefaultTemplate to true to auto-fill registration content from your verified brand (portal “Use SH Default Template” parity).",
        "operationId": "campaign.createCampaign",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "useDefaultTemplate": {
                    "type": "boolean",
                    "description": "When true, auto-generates campaign registration fields from Signal House portal templates using brand info and vertical. 10DLC only — not supported on POST /campaign/toll-free. Default: false. When false or omitted, supply the full registration payload manually."
                  },
                  "brandId": {
                    "type": "string",
                    "description": "The ID of the verified Brand."
                  },
                  "usecase": {
                    "type": "string",
                    "description": "Campaign usecase (e.g., MARKETING, CUSTOMER_CARE, MIXED)."
                  },
                  "subUsecases": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Sub-usecases. Each value must be one of the accepted sub-usecase values (see below) — a subset of the usecase enum that excludes SOCIAL, which TCR rejects as a sub-usecase. Required when usecase is LOW_VOLUME (1-5 items) or MIXED (2-5 items)."
                  },
                  "description": {
                    "type": "string",
                    "description": "Detailed description of the campaign (40-4096 chars). Required unless useDefaultTemplate is true (auto-generated from brand info, vertical, and optional landing page)."
                  },
                  "messageFlow": {
                    "type": "string",
                    "description": "How users opt-in to the campaign (40-4096 chars). Required unless useDefaultTemplate is true (auto-generated from brand info and use case)."
                  },
                  "phoneNumbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of unassigned phone numbers to link. Max 49 unless numberPool is true. Max 5000 total."
                  },
                  "embeddedLink": {
                    "type": "boolean",
                    "description": "Whether the campaign includes embedded links. Default: true."
                  },
                  "embeddedPhone": {
                    "type": "boolean",
                    "description": "Whether the campaign includes embedded phone numbers. Default: false."
                  },
                  "embeddedLinkSample": {
                    "type": "string",
                    "description": "Sample embedded link URL (max 255 chars). Required when embeddedLink is true."
                  },
                  "sampleMediaIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Up to 5 mediaIds from POST /campaign/sample-media: sample MMS media shown to carrier and TCR reviewers. Each file must belong to your group. Attached to the TCR campaign once it is registered."
                  },
                  "termsAndConditions": {
                    "type": "boolean",
                    "description": "Whether T&C apply. Default: true."
                  },
                  "numberPool": {
                    "type": "boolean",
                    "description": "Whether the campaign uses a number pool. Default: false."
                  },
                  "ageGated": {
                    "type": "boolean",
                    "description": "Whether the campaign content is age-gated. Required when useDefaultTemplate is true. Default: false when omitted on full-payload requests."
                  },
                  "directLending": {
                    "type": "boolean",
                    "description": "Whether the campaign involves direct lending. Required when useDefaultTemplate is true. Default: false when omitted on full-payload requests."
                  },
                  "subscriberOptIn": {
                    "type": "boolean",
                    "description": "Whether subscriber opt-in is enabled. Default: true."
                  },
                  "subscriberOptOut": {
                    "type": "boolean",
                    "description": "Whether subscriber opt-out is enabled. Default: true."
                  },
                  "subscriberHelp": {
                    "type": "boolean",
                    "description": "Whether subscriber help is enabled. Default: true."
                  },
                  "sample1": {
                    "type": "string",
                    "description": "Sample message 1 (20-1024 chars). At least one of sample1–sample5 is required when useDefaultTemplate is true."
                  },
                  "sample2": {
                    "type": "string",
                    "description": "Sample message 2 (20-1024 chars)."
                  },
                  "sample3": {
                    "type": "string",
                    "description": "Sample message 3 (20-1024 chars)."
                  },
                  "sample4": {
                    "type": "string",
                    "description": "Sample message 4 (20-1024 chars)."
                  },
                  "sample5": {
                    "type": "string",
                    "description": "Sample message 5 (20-1024 chars)."
                  },
                  "helpMessage": {
                    "type": "string",
                    "description": "Auto-reply for HELP keyword. Required when subscriberHelp is true (default)."
                  },
                  "optinKeywords": {
                    "type": "string",
                    "description": "Comma separated keywords (default: START,SUBSCRIBE)."
                  },
                  "optoutKeywords": {
                    "type": "string",
                    "description": "Comma separated keywords (default: STOP,UNSUBSCRIBE)."
                  },
                  "helpKeywords": {
                    "type": "string",
                    "description": "Comma separated help keywords (default: HELP)."
                  },
                  "optinMessage": {
                    "type": "string",
                    "description": "Auto-reply for opt-in keyword (20-1024 chars). Required when subscriberOptIn is true (default)."
                  },
                  "optoutMessage": {
                    "type": "string",
                    "description": "Auto-reply for opt-out keyword (20-1024 chars). Required when subscriberOptOut is true (default)."
                  },
                  "autoRenewal": {
                    "type": "boolean",
                    "description": "Whether the campaign auto-renews. Default: true."
                  },
                  "tag": {
                    "type": "string",
                    "description": "Tag for the campaign (max 255 chars)."
                  },
                  "privacyPolicyLink": {
                    "type": "string",
                    "description": "Link to your public privacy policy (max 2048 chars). Required unless useDefaultTemplate is true (defaults to the brand privacyPolicyLink)."
                  },
                  "termsAndConditionsLink": {
                    "type": "string",
                    "description": "Link to your public terms of service (max 2048 chars). Required unless useDefaultTemplate is true (defaults to the brand terms link)."
                  },
                  "complianceScanId": {
                    "type": "string",
                    "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                  }
                },
                "required": [
                  "brandId",
                  "usecase",
                  "description",
                  "messageFlow",
                  "phoneNumbers",
                  "privacyPolicyLink",
                  "termsAndConditionsLink"
                ]
              },
              "example": {
                "brandId": "B1234567",
                "usecase": "MARKETING",
                "description": "This campaign is used to send weekly promotional discounts and updates to our registered retail customers.",
                "messageFlow": "Users opt-in by entering their phone number on our website registration form located at https://example.com/signup.",
                "sample1": "Acme Deals: 20% off this week only! Reply STOP to opt out, HELP for help. Msg&data rates may apply.",
                "sample2": "Acme Deals: Flash sale ends tonight at midnight. Reply STOP to opt out, HELP for help.",
                "optinMessage": "Acme Deals: You are now subscribed to weekly promotions. Reply STOP to opt out, HELP for help.",
                "optoutMessage": "Acme Deals: You have been unsubscribed and will no longer receive messages. Reply START to resubscribe.",
                "helpMessage": "Acme Deals: For support call 1-800-555-0100 or email help@example.com. Reply STOP to opt out.",
                "embeddedLinkSample": "https://example.com/deals/weekly",
                "phoneNumbers": [
                  "14175551234"
                ],
                "privacyPolicyLink": "https://example.com/privacy",
                "termsAndConditionsLink": "https://example.com/terms"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "usecase": {
                      "type": "string",
                      "enum": [
                        "2FA",
                        "ACCOUNT_NOTIFICATION",
                        "AGENTS_FRANCHISES",
                        "CARRIER_EXEMPT",
                        "CHARITY",
                        "CUSTOMER_CARE",
                        "DELIVERY_NOTIFICATION",
                        "EMERGENCY",
                        "FRAUD_ALERT",
                        "HIGHER_EDUCATION",
                        "K12_EDUCATION",
                        "LOW_VOLUME",
                        "M2M",
                        "MARKETING",
                        "MIXED",
                        "POLITICAL",
                        "POLLING_VOTING",
                        "PROXY",
                        "PUBLIC_SAFETY_RESTRICTED",
                        "PUBLIC_SERVICE_ANNOUNCEMENT",
                        "SECURITY_ALERT",
                        "SOCIAL",
                        "SOLE_PROPRIETOR",
                        "SWEEPSTAKE",
                        "TRIAL",
                        "UCAAS_HIGH",
                        "UCAAS_LOW"
                      ]
                    },
                    "description": {
                      "type": "string"
                    },
                    "messageFlow": {
                      "type": "string"
                    },
                    "phoneNumbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c55",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": "B1234567",
                  "campaignId": "C1234567",
                  "status": "PENDING_REVIEW",
                  "usecase": "MARKETING",
                  "description": "This campaign is used to send weekly promotional discounts and updates to our registered retail customers.",
                  "messageFlow": "Users opt-in by entering their phone number on our website registration form located at https://example.com/signup.",
                  "phoneNumbers": [
                    "14175551234"
                  ],
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/appealDcaRejection/{id}": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Appeal or resubmit a failed campaign.",
        "description": "Appeal or resubmit a failed campaign. Accepted statuses: REJECTED, TCR_REGISTER_FAILED (resets to PENDING_REVIEW for re-review by Signal House), TCR_UPSTREAM_FAILED, DCA_DRAFT_FAILED, DCA_REGISTER_FAILED, DCA_DRAFT (resumes the pipeline from the point of failure), and DCA_REJECTED (submits a formal DCA appeal). Toll-Free campaigns never sync with TCR, so TCR_REGISTER_FAILED/TCR_UPSTREAM_FAILED cannot occur for them; their DCA_DRAFT_FAILED/DCA_REGISTER_FAILED/DCA_DRAFT recovery re-queues the next step directly instead of syncing with TCR first. For Short Code campaigns, REJECTED and DCA_REJECTED both return synchronously to PENDING_REVIEW for internal Signal House review; no external carrier appeal is sent. A Toll-Free campaign whose brand's `tollFree.requiresPrivacyPolicy` is true is refused with 400 when neither it nor its brand has a privacyPolicyLink, and likewise termsAndConditionsLink when `tollFree.requiresTermsAndConditions` is true; add them with an update first.",
        "operationId": "campaign.appealDcaRejection",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID to appeal."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppealDcaRejectionRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Campaign DCA appeal has been queued for processing"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/health": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Return portal-parity campaign health (1–10) aggregated over 7-day and 30-day windows for a campaign.",
        "description": "Return portal-parity campaign health (1–10) aggregated over 7-day and 30-day windows for a campaign. Aggregation matches the portal behavior: only numbers with `hasData=true` and `score!=null` are included in averages.",
        "operationId": "campaign.readCampaignHealth",
        "parameters": [
          {
            "name": "campaignId",
            "in": "query",
            "required": true,
            "description": "Campaign ID to compute health for.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeNumbers",
            "in": "query",
            "required": false,
            "description": "When true, include per-number health entries in `numbers`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "type": "string"
                    },
                    "sevenDay": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "deliveryRate": {
                          "type": "number"
                        },
                        "optOutRate": {
                          "type": "number"
                        },
                        "deliveryScore": {
                          "type": "integer"
                        },
                        "optOutScore": {
                          "type": "integer"
                        },
                        "hasData": {
                          "type": "boolean"
                        }
                      }
                    },
                    "thirtyDay": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "deliveryRate": {
                          "type": "integer"
                        },
                        "optOutRate": {
                          "type": "number"
                        },
                        "deliveryScore": {
                          "type": "integer"
                        },
                        "optOutScore": {
                          "type": "integer"
                        },
                        "hasData": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "campaignId": "C1234567",
                  "sevenDay": {
                    "score": 8.5,
                    "deliveryRate": 91.2,
                    "optOutRate": 1.1,
                    "deliveryScore": 9,
                    "optOutScore": 8,
                    "hasData": true
                  },
                  "thirtyDay": {
                    "score": 7.5,
                    "deliveryRate": 85,
                    "optOutRate": 2.2,
                    "deliveryScore": 8,
                    "optOutScore": 7,
                    "hasData": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/campaign/nudge/{campaignId}": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Nudge a connectivity partner (CNP) to prioritize review of a campaign.",
        "description": "Nudge a connectivity partner (CNP) to prioritize review of a campaign. The campaign must be in PENDING_DCA_APPROVAL status. Useful when a campaign has been sitting idle in review for an extended period.",
        "operationId": "campaign.nudgeDcaForCampaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID to nudge."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Nudge successful"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/opt-in-image": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Upload an opt-in proof image to be hosted on-platform.",
        "description": "Upload an opt-in proof image to be hosted on-platform. Returns a publicly-fetchable URL suitable for a Toll-Free campaign's tollFree.optInImageURLs or a Short Code campaign's shortCode.screenshotUrl. The image is validated and compressed before storage. Max upload 5MB, one file.",
        "operationId": "campaign.uploadOptInImage",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The opt-in proof image to host, sent as the multipart form field 'file'. Max 5MB."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "imageId": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "imageId": "3f1b9c2e-7a4d-4b21-9c1e-2a6f8d0e5b7a",
                  "url": "https://v2.signalhouse.io/campaign/opt-in-image/3f1b9c2e-7a4d-4b21-9c1e-2a6f8d0e5b7a"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/opt-in-image/from-landing": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Auto-capture an opt-in proof image from a generated landing page and host it on-platform.",
        "description": "Auto-capture an opt-in proof image from a generated landing page and host it on-platform. The page must be ACTIVE and generated by Signal House. Returns a publicly-fetchable URL suitable for a Toll-Free campaign's tollFree.optInImageURLs. A Toll-Free brand has one page per campaign, so landingId is required for one — the request is refused rather than resolved to an arbitrary page. A 10DLC brand has a single page and may omit it.",
        "operationId": "campaign.captureOptInImageFromLanding",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "description": "The ID of the brand whose generated landing page should be captured."
                  },
                  "landingId": {
                    "type": "string",
                    "description": "The specific landing page to capture. Required for a Toll-Free brand; must belong to brandId. Omitted for a 10DLC brand, the brand's single page is used."
                  }
                },
                "required": [
                  "brandId"
                ]
              },
              "example": {
                "brandId": "TFNB7K3M9QXR2V",
                "landingId": "L1234567"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "imageId": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "imageId": "8c2d1f4a-9b6e-4c33-8a7f-1e5b3d0a2c9f",
                  "url": "https://v2.signalhouse.io/campaign/opt-in-image/8c2d1f4a-9b6e-4c33-8a7f-1e5b3d0a2c9f"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/opt-in-image/{imageId}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Fetch a hosted opt-in proof image's raw bytes.",
        "description": "Fetch a hosted opt-in proof image's raw bytes. This route is public (no authentication) so carriers and aggregators can fetch the proof by URL. Responds with the raw image bytes and the stored Content-Type.",
        "operationId": "campaign.readPublicOptInImage",
        "parameters": [
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "imageId",
            "in": "query",
            "required": true,
            "description": "The hosted image's public identifier (path parameter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/campaign/sample-media": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Upload a sample media file for a 10DLC campaign: an example of the MMS content the campaign will send, shown to carrier and TCR reviewers.",
        "description": "Upload a sample media file for a 10DLC campaign: an example of the MMS content the campaign will send, shown to carrier and TCR reviewers. Reference the returned mediaId in sampleMediaIds on POST /campaign or PUT /campaign/:id. The file type is detected from its bytes. Accepted: JPEG, PNG, GIF, MP4, MP3. Max 5MB, one file. Files are private to your group.",
        "operationId": "campaign.uploadSampleMedia",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The sample media file, sent as the multipart form field 'file'. Max 5MB."
                  },
                  "groupId": {
                    "type": "string",
                    "description": "The group the file belongs to. Defaults to your active group; if sent, it must be your active group."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mediaId": {
                      "type": "string"
                    },
                    "fileName": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "mediaId": "5d2e8a41-6c3b-4f7e-9a12-0b8c4e6f1a3d",
                  "fileName": "spring-sale.png",
                  "mimeType": "image/png",
                  "size": 248113
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/sample-media/{mediaId}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Download a campaign sample media file your group owns.",
        "description": "Download a campaign sample media file your group owns. Responds with the raw file bytes and the stored Content-Type.",
        "operationId": "campaign.readSampleMedia",
        "parameters": [
          {
            "name": "mediaId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mediaId",
            "in": "query",
            "required": true,
            "description": "The mediaId returned by POST /campaign/sample-media (path parameter).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/short-code": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a Short Code campaign for manual Signal House review.",
        "description": "Create a Short Code campaign for manual Signal House review. Send the complete JSON payload in the campaignData multipart field. Upload the opt-in proof screenshot first through POST /campaign/opt-in-image and pass the returned URL as shortCode.screenshotUrl; it is required and must be a Signal House-hosted opt-in image owned by your group. Request the Short Code separately through POST /number/short-code after creation.",
        "operationId": "campaign.createShortCodeCampaign",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "- campaignData.privacyPolicyLink, termsAndConditionsLink (String): Public policy URLs (each at most 2048 characters).\n- campaignData.optinMessage, optoutMessage, helpMessage (String): Subscriber keyword responses, each 20-1024 characters.\n- campaignData.sample1, sample2, sample3 (String): Required example messages, each 20-1024 characters.",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaignData": {
                    "type": "string",
                    "contentMediaType": "application/json",
                    "description": "The complete JSON campaign payload in a multipart field named campaignData. The nested fields below belong in this JSON value.",
                    "properties": {
                      "brandId": {
                        "type": "string",
                        "description": "Existing eligible Short Code brand ID."
                      },
                      "tag": {
                        "type": "string",
                        "description": "Campaign tag (max 255 characters)."
                      },
                      "shortCode": {
                        "type": "object",
                        "properties": {
                          "useCases": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "One or more Short Code use cases."
                          },
                          "optInMethods": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "One or more opt-in methods; every selected method needs a description."
                          },
                          "optInMethodDescriptions": {
                            "type": "object",
                            "description": "Descriptions keyed by opt-in method, such as WEB. Each selected method requires a 20-2048 character description."
                          },
                          "messageFrequency": {
                            "type": "string",
                            "description": "RECURRING or SINGLE."
                          },
                          "pricingTier": {
                            "type": "string",
                            "description": "STANDARD or FTEU."
                          },
                          "programSummary": {
                            "type": "string",
                            "description": "Messaging-program summary (40-2048 characters)."
                          },
                          "optInConfirmationMessage": {
                            "type": "string",
                            "description": "Opt-in confirmation text (20-1024 characters)."
                          },
                          "adultContent": {
                            "type": "boolean",
                            "description": "Whether the program has adult content. Default: false."
                          },
                          "doubleOptInMessage": {
                            "type": "string",
                            "description": "Required when adultContent is true; 20-1024 characters."
                          },
                          "screenshotUrl": {
                            "type": "string",
                            "description": "Hosted opt-in proof screenshot URL returned by POST /campaign/opt-in-image. External URLs, images owned by another group, and images already linked to another campaign are rejected."
                          },
                          "optInUrl": {
                            "type": "string",
                            "description": "Public HTTPS URL of the live opt-in experience, shown to reviewers as a link. Private, local, and credentialed URLs are rejected."
                          }
                        },
                        "required": [
                          "useCases",
                          "optInMethods",
                          "optInMethodDescriptions",
                          "messageFrequency",
                          "pricingTier",
                          "programSummary",
                          "optInConfirmationMessage",
                          "screenshotUrl",
                          "optInUrl"
                        ]
                      },
                      "complianceScanId": {
                        "type": "string",
                        "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                      }
                    },
                    "required": [
                      "brandId"
                    ]
                  }
                },
                "required": [
                  "campaignData"
                ]
              },
              "example": {
                "brandId": "SCB7K3M9QXR2V",
                "privacyPolicyLink": "https://acme.com/privacy",
                "termsAndConditionsLink": "https://acme.com/terms",
                "optinMessage": "Acme Alerts: You are subscribed. Reply STOP to opt out.",
                "optoutMessage": "Acme Alerts: You are unsubscribed. Reply START to rejoin.",
                "helpMessage": "Acme Alerts: Contact support@example.com for help.",
                "sample1": "Acme Alerts: Your order is ready for pickup. Reply STOP to opt out.",
                "sample2": "Acme Alerts: Your delivery is scheduled for tomorrow. Reply STOP to opt out.",
                "sample3": "Acme Alerts: Your account update is complete. Reply STOP to opt out.",
                "shortCode": {
                  "useCases": [
                    "ALERTS"
                  ],
                  "optInMethods": [
                    "WEB"
                  ],
                  "optInMethodDescriptions": {
                    "WEB": "Customers enter their number and consent to receive Acme Alerts on our secure website."
                  },
                  "messageFrequency": "RECURRING",
                  "pricingTier": "STANDARD",
                  "programSummary": "Acme sends account, order, and delivery alerts to customers who opt in on its website.",
                  "optInConfirmationMessage": "Acme Alerts: You are subscribed. Reply STOP to opt out.",
                  "screenshotUrl": "https://v2.signalhouse.io/campaign/opt-in-image/3f1b9c2e-7a4d-4b21-9c1e-2a6f8d0e5b7a",
                  "optInUrl": "https://acme.com/opt-in"
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "shortCode": {
                      "type": "object",
                      "properties": {
                        "screenshotUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "optInUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                },
                "example": {
                  "campaignId": "SCCM5H2N8PWQ3Z",
                  "registrationType": "SHORT_CODE",
                  "status": "PENDING_REVIEW",
                  "shortCode": {
                    "screenshotUrl": "https://v2.signalhouse.io/campaign/opt-in-image/3f1b9c2e-7a4d-4b21-9c1e-2a6f8d0e5b7a",
                    "optInUrl": "https://acme.com/opt-in"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/short-code/artifact/{artifactId}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Download the private receipt for an externally leased Short Code.",
        "description": "Download the private receipt for an externally leased Short Code. The receipt identifier is available at shortCode.numberSource.externalLease.receiptArtifactId on the owning campaign. The route returns raw file bytes with the stored Content-Type and an inline filename; use a binary response type in your HTTP client. Opt-in screenshots are public at shortCode.screenshotUrl and are not downloaded from this endpoint.",
        "operationId": "campaign.readCampaignArtifact",
        "parameters": [
          {
            "name": "artifactId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "UUID receipt artifact ID from shortCode.numberSource.externalLease.receiptArtifactId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/short-code/{id}": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Update editable fields on a Short Code campaign.",
        "description": "Update editable fields on a Short Code campaign. Customer updates are allowed only while the campaign is in Signal House Review or Signal House Rejected status. The number source and assigned Short Code cannot be changed. To replace the opt-in proof, upload a new image through POST /campaign/opt-in-image and pass its URL as shortCode.screenshotUrl.",
        "operationId": "campaign.updateShortCodeCampaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Short Code campaign ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "description": "- sample1, sample2, sample3 (String): Sample messages (each 20-1024 characters).",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "privacyPolicyLink": {
                    "type": "string",
                    "description": "Public privacy policy URL (max 2048 characters)."
                  },
                  "termsAndConditionsLink": {
                    "type": "string",
                    "description": "Public terms and conditions URL (max 2048 characters)."
                  },
                  "optinMessage": {
                    "type": "string",
                    "description": "Opt-in confirmation message (20-1024 characters)."
                  },
                  "optoutMessage": {
                    "type": "string",
                    "description": "Opt-out confirmation message (20-1024 characters)."
                  },
                  "helpMessage": {
                    "type": "string",
                    "description": "HELP response message (20-1024 characters)."
                  },
                  "tag": {
                    "type": "string",
                    "description": "Campaign tag (max 255 characters)."
                  },
                  "shortCode": {
                    "type": "object",
                    "description": "Editable Short Code details: useCases, optInMethods, optInMethodDescriptions, messageFrequency (RECURRING or SINGLE), pricingTier (STANDARD or FTEU), adultContent, doubleOptInMessage, programSummary, optInConfirmationMessage, optInUrl, and screenshotUrl (a hosted opt-in image URL from POST /campaign/opt-in-image; external URLs are rejected). The supplied fields are merged with existing details and must remain a valid Short Code configuration."
                  }
                }
              },
              "example": {
                "shortCode": {
                  "programSummary": "Weekly promotional offers and order updates for registered customers.",
                  "screenshotUrl": "https://v2.signalhouse.io/campaign/opt-in-image/8c2d1f4a-9b6e-4c33-8a7f-1e5b3d0a2c9f"
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "shortCode": {
                      "type": "object",
                      "properties": {
                        "optInUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "screenshotUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                },
                "example": {
                  "campaignId": "SCCM5H2N8PWQ3Z",
                  "registrationType": "SHORT_CODE",
                  "status": "PENDING_REVIEW",
                  "shortCode": {
                    "optInUrl": "https://acme.com/opt-in",
                    "screenshotUrl": "https://v2.signalhouse.io/campaign/opt-in-image/8c2d1f4a-9b6e-4c33-8a7f-1e5b3d0a2c9f"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/short-code/{id}/cancel": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Request or complete cancellation of a Short Code campaign.",
        "description": "Request or complete cancellation of a Short Code campaign. Customers may request cancellation from any non-terminal state. An issued RANDOM, VANITY, or EXTERNAL_LEASE code enters PENDING_DELETE (displayed as Cancellation Pending), disables messaging, and remains assigned while Signal House completes Registry offboarding; persisted cancellation state remains the durable work queue even if Slack is unavailable. Every issued Short Code has a fixed, non-renewable lease end date: when it ends, the campaign becomes EXPIRED and the number is deactivated pending staff Registry offboarding. Unissued RANDOM/VANITY requests and staff-confirmed cancellations transition directly to EXPIRED. Repeated calls are idempotent.",
        "operationId": "campaign.cancelShortCodeCampaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Short Code campaign ID to cancel."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "shortCode": {
                      "type": "object",
                      "properties": {
                        "assignedPhoneNumber": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cancellationRequest": {
                          "type": "object",
                          "properties": {
                            "requestId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING",
                                "COMPLETED",
                                "DISMISSED",
                                null
                              ]
                            },
                            "requestedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "campaignId": "SCCM5H2N8PWQ3Z",
                  "registrationType": "SHORT_CODE",
                  "status": "PENDING_DELETE",
                  "shortCode": {
                    "assignedPhoneNumber": "12345",
                    "cancellationRequest": {
                      "requestId": "SCCR7K3M9QXR2V",
                      "status": "PENDING",
                      "requestedAt": "2026-07-27T14:00:00.000Z"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/throughput-limits": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Return the carrier throughput ceilings a campaign is currently sending under: the AT&T per-minute limit (per campaign; SMS in segments, MMS in messages; held 10% under AT&T's published ceiling, stated as marginPercent) and the T-Mobile daily cap (per brand, in segments), each with its current tier and the next rung on the ladder, plus today's T-Mobile usage read from the same per-brand-EIN UTC-day counter the send path increments.",
        "description": "Return the carrier throughput ceilings a campaign is currently sending under: the AT&T per-minute limit (per campaign; SMS in segments, MMS in messages; held 10% under AT&T's published ceiling, stated as marginPercent) and the T-Mobile daily cap (per brand, in segments), each with its current tier and the next rung on the ladder, plus today's T-Mobile usage read from the same per-brand-EIN UTC-day counter the send path increments. Resolved with the exact brand status / brand score rules the send path enforces with, so the figure shown is the figure applied. A null tier or limit means the ladder does not apply (unverified brand, GOVERNMENT entity, PUBLIC_SAFETY_RESTRICTED usecase, or a brand that cannot be read); a null nextTier means the top rung, or a LOW_VOLUME campaign, which is capped by its usecase rather than its brand. usedToday is null when the brand has no EIN or when the ladder does not apply to it (the counter is only ever written for a brand the ladder applies to, and is only read for one). Because the counter is keyed per EIN rather than per brand, usedToday is a shared total whenever another verified brand in the same group carries the same EIN and also has a T-Mobile limit; tmobile.sharedWith names those sibling brands (empty when none) so the figure is never read as this brand's exclusive usage.",
        "operationId": "campaign.readCampaignThroughputLimits",
        "parameters": [
          {
            "name": "campaignId",
            "in": "query",
            "required": true,
            "description": "Campaign ID to resolve limits for.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "campaignId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "usecase": {
                      "type": "string"
                    },
                    "brand": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string"
                        },
                        "brandScore": {
                          "type": "integer"
                        },
                        "entityType": {
                          "type": "string"
                        }
                      }
                    },
                    "att": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string"
                        },
                        "scope": {
                          "type": "string"
                        },
                        "unit": {
                          "type": "string"
                        },
                        "sms": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            }
                          }
                        },
                        "mms": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            }
                          }
                        },
                        "marginPercent": {
                          "type": "integer"
                        },
                        "nextTier": {
                          "type": "object",
                          "properties": {
                            "tier": {
                              "type": "string"
                            },
                            "minBrandScore": {
                              "type": "integer"
                            },
                            "requiresVettedVerified": {
                              "type": "boolean"
                            },
                            "sms": {
                              "type": "object",
                              "properties": {
                                "limit": {
                                  "type": "integer"
                                }
                              }
                            },
                            "mms": {
                              "type": "object",
                              "properties": {
                                "limit": {
                                  "type": "integer"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "tmobile": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string"
                        },
                        "scope": {
                          "type": "string"
                        },
                        "unit": {
                          "type": "string"
                        },
                        "dailyLimit": {
                          "type": "integer"
                        },
                        "thresholds": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          }
                        },
                        "nextTier": {
                          "type": "object",
                          "properties": {
                            "tier": {
                              "type": "string"
                            },
                            "minBrandScore": {
                              "type": "integer"
                            },
                            "requiresVettedVerified": {
                              "type": "boolean"
                            },
                            "dailyLimit": {
                              "type": "integer"
                            }
                          }
                        },
                        "usedToday": {
                          "type": "object",
                          "properties": {
                            "date": {
                              "type": "string"
                            },
                            "segments": {
                              "type": "integer"
                            },
                            "resetsAt": {
                              "type": "string"
                            }
                          }
                        },
                        "sharedWith": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "campaignId": "C1234567",
                  "brandId": "B1234567",
                  "usecase": "MIXED",
                  "brand": {
                    "status": "VETTED_VERIFIED",
                    "brandScore": 68,
                    "entityType": "PRIVATE_PROFIT"
                  },
                  "att": {
                    "tier": "standardMed",
                    "scope": "campaign",
                    "unit": "segments per minute",
                    "sms": {
                      "limit": 2160
                    },
                    "mms": {
                      "limit": 1080
                    },
                    "marginPercent": 10,
                    "nextTier": {
                      "tier": "standardHigh",
                      "minBrandScore": 75,
                      "requiresVettedVerified": false,
                      "sms": {
                        "limit": 4050
                      },
                      "mms": {
                        "limit": 2160
                      }
                    }
                  },
                  "tmobile": {
                    "tier": "standardMed",
                    "scope": "brand",
                    "unit": "segments per day",
                    "dailyLimit": 40000,
                    "thresholds": [
                      75,
                      90,
                      100
                    ],
                    "nextTier": {
                      "tier": "standardHigh",
                      "minBrandScore": 75,
                      "requiresVettedVerified": false,
                      "dailyLimit": 200000
                    },
                    "usedToday": {
                      "date": "2026-09-10",
                      "segments": 12480,
                      "resetsAt": "2026-09-11T00:00:00.000Z"
                    },
                    "sharedWith": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/campaign/throughput-usage": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Return today's T-Mobile usage against the daily limit for every active campaign in a group that has one, in one call: the same limit and the same per-brand-EIN UTC-day counter as GET /campaign/throughput-limits.",
        "description": "Return today's T-Mobile usage against the daily limit for every active campaign in a group that has one, in one call: the same limit and the same per-brand-EIN UTC-day counter as GET /campaign/throughput-limits. Use it to warn when a brand nears its cap; the API also raises TMOBILE_THROUGHPUT_75 / 90 / 100 webhook events as a brand crosses each threshold. Campaigns the T-Mobile ladder does not apply to (unverified brand, GOVERNMENT entity, PUBLIC_SAFETY_RESTRICTED usecase) are left out. Every campaign of a brand shows the same usage, since the cap is per brand; a LOW_VOLUME campaign's limit is 2,000 segments whatever the brand's score. The counter resets at UTC midnight (resetsAt). Because the counter is keyed per EIN, usedToday is a shared total whenever another brand returned in this same call carries the same EIN; tmobile.sharedWith names those sibling brands (empty when none).",
        "operationId": "campaign.readGroupThroughputUsage",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID to read usage for.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "campaignId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "brandName": {
                        "type": "string"
                      },
                      "usecase": {
                        "type": "string",
                        "enum": [
                          "2FA",
                          "ACCOUNT_NOTIFICATION",
                          "AGENTS_FRANCHISES",
                          "CARRIER_EXEMPT",
                          "CHARITY",
                          "CUSTOMER_CARE",
                          "DELIVERY_NOTIFICATION",
                          "EMERGENCY",
                          "FRAUD_ALERT",
                          "HIGHER_EDUCATION",
                          "K12_EDUCATION",
                          "LOW_VOLUME",
                          "M2M",
                          "MARKETING",
                          "MIXED",
                          "POLITICAL",
                          "POLLING_VOTING",
                          "PROXY",
                          "PUBLIC_SAFETY_RESTRICTED",
                          "PUBLIC_SERVICE_ANNOUNCEMENT",
                          "SECURITY_ALERT",
                          "SOCIAL",
                          "SOLE_PROPRIETOR",
                          "SWEEPSTAKE",
                          "TRIAL",
                          "UCAAS_HIGH",
                          "UCAAS_LOW"
                        ]
                      },
                      "tmobile": {
                        "type": "object",
                        "properties": {
                          "tier": {
                            "type": "string"
                          },
                          "dailyLimit": {
                            "type": "integer"
                          },
                          "usedToday": {
                            "type": "object",
                            "properties": {
                              "date": {
                                "type": "string"
                              },
                              "segments": {
                                "type": "integer"
                              },
                              "resetsAt": {
                                "type": "string"
                              }
                            }
                          },
                          "sharedWith": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "brandId": {
                                  "type": "string"
                                },
                                "brandName": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": [
                  {
                    "campaignId": "C1234567",
                    "brandId": "B1234567",
                    "brandName": "Acme Dental Group",
                    "usecase": "MIXED",
                    "tmobile": {
                      "tier": "standardMed",
                      "dailyLimit": 40000,
                      "usedToday": {
                        "date": "2026-10-31",
                        "segments": 31200,
                        "resetsAt": "2026-11-01T00:00:00.000Z"
                      },
                      "sharedWith": [
                        {
                          "brandId": "B7654321",
                          "brandName": "Acme Dental Group West"
                        }
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/campaign/toll-free": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Create a new Toll-Free (TFN) campaign and submit it for Signal House review.",
        "description": "Create a new Toll-Free (TFN) campaign and submit it for Signal House review. The brand referenced by brandId must already be a registered Toll-Free brand. Toll-Free registration is free and does not use TCR — there are no STOP/HELP keyword or sample-message fields; the exampleMessage is stored verbatim. Requires the tollFreeEnabled feature flag on the group. Some toll-free carriers take exactly one opt-in method (verbal, web or keyword; the brand's `tollFree.maxOptInMethods` is 1) and need specific use cases rather than MIXED alone; such campaigns are refused with 400 otherwise.",
        "operationId": "campaign.createTollFreeCampaign",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "description": "The ID of the registered Toll-Free Brand."
                  },
                  "tollFree": {
                    "type": "object",
                    "description": "Toll-Free registration details (see sub-fields below).",
                    "properties": {
                      "useCase": {
                        "type": "string",
                        "description": "Toll-Free use case, a single value (see values below)."
                      },
                      "messageVolume": {
                        "type": "string",
                        "description": "Expected monthly message volume tier (see values below)."
                      },
                      "programSummary": {
                        "type": "string",
                        "description": "Summary of the messaging program (40-500 chars)."
                      },
                      "exampleMessage": {
                        "type": "string",
                        "description": "Example message sent to subscribers (1-1000 chars). Holds one sample per use case; the carrier caps this field at 1000 characters. When the brand's tollFree.labelsSamples is true, start each sample with its use case's name (for example \"Notifications: …\"); otherwise send them as plain messages."
                      },
                      "customerCareEmail": {
                        "type": "string",
                        "description": "Customer care / support email address."
                      },
                      "optInImageURLs": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Opt-in proof image URLs (at least 1; each max 2048 chars)."
                      },
                      "optIns": {
                        "type": "object",
                        "description": "Opt-in methods. Optional sub-objects: verbal { callToAction }, web { callToAction, url }, keyword { callToAction, keywords[] }, interactiveVoiceResponse { callToAction }. Each callToAction is 20-1024 characters."
                      },
                      "multiNumberReason": {
                        "type": "string",
                        "description": "Reason for requesting more than one Toll-Free number on the campaign (max 500 chars). Required when more than one number is assigned; stored for internal review only."
                      },
                      "useCases": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The sender's real use-case picks. tollFree.useCase above carries the single value the carrier accepts (MIXED when there is more than one); these are what a Signal House landing page renders a consent checkbox per. Carriers that need specific use cases rather than MIXED take them from here when present; other carriers never receive them."
                      },
                      "channels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Channels consent covers: SMS, MMS, VOICE. Never forwarded to the carrier."
                      },
                      "landingId": {
                        "type": "string",
                        "description": "The Signal House landing page whose consent boxes this campaign's opt-in call-to-action describes. Must be an ACTIVE Toll-Free page owned by the same brand and group; the request is rejected otherwise."
                      }
                    },
                    "required": [
                      "useCase",
                      "messageVolume",
                      "programSummary",
                      "exampleMessage",
                      "customerCareEmail",
                      "optInImageURLs"
                    ]
                  },
                  "phoneNumbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Toll-Free numbers to assign: 1 up to the brand's tollFree.maxNumbersPerCampaign (at most 5). Must be owned by the subgroup and currently unassigned. The numbers must be on the same toll-free carrier as the brand; a campaign whose numbers and brand are on different carriers is refused. Numbers are locked to the campaign once assigned and cannot be moved or added afterward."
                  },
                  "privacyPolicyLink": {
                    "type": "string",
                    "description": "Link to your public privacy policy (max 2048 chars). When the brand's tollFree.requiresPrivacyPolicy is true, the request is refused with 400 only if the campaign, the brand and the referenced Toll-Free landing page (tollFree.landingId) all lack this URL. Order of precedence: campaign, brand, landing page."
                  },
                  "termsAndConditionsLink": {
                    "type": "string",
                    "description": "Link to your public terms of service (max 2048 chars). When the brand's tollFree.requiresTermsAndConditions is true, the request is refused with 400 only if the campaign, the brand and the referenced Toll-Free landing page (tollFree.landingId) all lack this URL. Order of precedence: campaign, brand, landing page."
                  },
                  "tag": {
                    "type": "string",
                    "description": "Tag for the campaign (max 255 chars)."
                  },
                  "autoRenewal": {
                    "type": "boolean",
                    "description": "Whether the campaign auto-renews. Default: true."
                  },
                  "complianceScanId": {
                    "type": "string",
                    "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                  }
                },
                "required": [
                  "brandId",
                  "tollFree",
                  "phoneNumbers"
                ]
              },
              "example": {
                "brandId": "TFNB7K3M9QXR2V",
                "tollFree": {
                  "useCase": "GENERAL_MARKETING",
                  "messageVolume": "TEN_THOUSAND",
                  "programSummary": "Weekly promotional offers and order updates for registered customers.",
                  "exampleMessage": "Acme Deals: 20% off this week only! Reply STOP to opt out, HELP for help.",
                  "customerCareEmail": "support@example.com",
                  "optInImageURLs": [
                    "https://example.com/optin-proof.png"
                  ],
                  "optIns": {
                    "web": {
                      "callToAction": "Subscribe on our website",
                      "url": "https://example.com/signup"
                    }
                  }
                },
                "phoneNumbers": [
                  "18885551234"
                ],
                "privacyPolicyLink": "https://example.com/privacy",
                "termsAndConditionsLink": "https://example.com/terms"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "registrationType": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC",
                        "TOLL_FREE",
                        "SHORT_CODE"
                      ]
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "phoneNumbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tollFree": {
                      "type": "object",
                      "properties": {
                        "useCase": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "TWO_FA",
                            "APP_NOTIFICATIONS",
                            "APPOINTMENTS",
                            "AUCTIONS",
                            "AUTO_DEALERSHIP_SERVICES",
                            "BANKING",
                            "BILLING",
                            "BOOKING_CONFIRMATIONS",
                            "BUSINESS_UPDATES",
                            "COVID_19_ALERTS",
                            "CAREER_TRAINING",
                            "CHATBOT",
                            "CONVERSATIONAL_ALERTS",
                            "COURIER_SERVICES_DELIVERIES",
                            "EDUCATIONAL",
                            "EMERGENCY_ALERTS",
                            "EMPLOYEE_ALERTS_NOTIFICATIONS",
                            "EVENTS_PLANNING",
                            "FINANCIAL_SERVICES",
                            "FRAUD_ALERTS",
                            "FUNDRAISING",
                            "GENERAL_MARKETING",
                            "HR_STAFFING",
                            "HEALTHCARE",
                            "HOUSING_COMMUNITY_UPDATES",
                            "INSURANCE_SERVICES",
                            "JOB_ALERTS",
                            "LEGAL_SERVICES",
                            "MIXED",
                            "MOTIVATIONAL_REMINDERS",
                            "NOTARY_NOTIFICATIONS",
                            "NOTIFICATIONS",
                            "ORDER_NOTIFICATIONS",
                            "POLITICAL",
                            "PUBLIC_WORKS",
                            "REAL_ESTATE_SERVICES",
                            "RECEIPT_NOTIFICATIONS",
                            "RELIGIOUS_SERVICES",
                            "REPAIR_DIAGNOSTICS_ALERTS",
                            "REWARDS_PROGRAM",
                            "SURVEYS",
                            "SYSTEM_ALERTS",
                            "WAITLIST_ALERTS",
                            "WEBINAR_REMINDERS",
                            "WORKSHOP_ALERTS",
                            null
                          ]
                        },
                        "messageVolume": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "TEN",
                            "HUNDRED",
                            "THOUSAND",
                            "TEN_THOUSAND",
                            "HUNDRED_THOUSAND",
                            "TWO_HUNDRED_FIFTY_THOUSAND",
                            "FIVE_HUNDRED_THOUSAND",
                            "SEVEN_HUNDRED_FIFTY_THOUSAND",
                            "ONE_MILLION",
                            "FIVE_MILLION",
                            "TEN_MILLION_PLUS",
                            null
                          ]
                        },
                        "programSummary": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "exampleMessage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "customerCareEmail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "optInImageURLs": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "autoRenewal": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c55",
                  "registrationType": "TOLL_FREE",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": "TFNB7K3M9QXR2V",
                  "campaignId": "TFNC5H2N8PWQ3Z",
                  "status": "PENDING_REVIEW",
                  "phoneNumbers": [
                    "18885551234"
                  ],
                  "tollFree": {
                    "useCase": "GENERAL_MARKETING",
                    "messageVolume": "TEN_THOUSAND",
                    "programSummary": "Weekly promotional offers and order updates for registered customers.",
                    "exampleMessage": "Acme Deals: 20% off this week only! Reply STOP to opt out, HELP for help.",
                    "customerCareEmail": "support@example.com",
                    "optInImageURLs": [
                      "https://example.com/optin-proof.png"
                    ]
                  },
                  "autoRenewal": true,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/campaign/{id}": {
      "put": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Update an existing campaign.",
        "description": "Update an existing campaign. Returns 202 Accepted. The response body is state-dependent: when the campaign is in a non-steady (mid-pipeline) state, the update is stored and applied later, and the response is { \"Message\": \"Campaign update stored. Changes will be applied once the campaign reaches a stable state.\" }. When the campaign is in a steady state, the update is applied immediately and the response is the serialized campaign (shown below). On some toll-free carriers a campaign can't be changed while it is being registered, in review or active (400), apart from autoRenewal and tag; change it after a rejection and appeal. On those carriers an update's tollFree replaces the stored one whole, so it must itself have a use case other than MIXED and exactly one opt-in method (verbal, web or keyword); it is refused with 400 otherwise. When the brand's tollFree.requiresPrivacyPolicy is true, an update that empties privacyPolicyLink is refused with 400 unless the brand has a privacyPolicyLink of its own; likewise termsAndConditionsLink when tollFree.requiresTermsAndConditions is true.",
        "operationId": "campaign.updateCampaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID to update."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING_REVIEW",
                        "REJECTED",
                        "PENDING_CREATION",
                        "TCR_REGISTER_FAILED",
                        "TCR_REGISTERED",
                        "TCR_UPSTREAM_FAILED",
                        "TCR_UPSTREAMED",
                        "DCA_DRAFT_FAILED",
                        "DCA_DRAFT",
                        "DCA_REGISTER_FAILED",
                        "PENDING_DCA_APPROVAL",
                        "DCA_REJECTED",
                        "ACTIVE",
                        "PENDING_DELETE",
                        "EXPIRED",
                        "CANCELLED_FOR_COMPLIANCE"
                      ]
                    },
                    "usecase": {
                      "type": "string",
                      "enum": [
                        "2FA",
                        "ACCOUNT_NOTIFICATION",
                        "AGENTS_FRANCHISES",
                        "CARRIER_EXEMPT",
                        "CHARITY",
                        "CUSTOMER_CARE",
                        "DELIVERY_NOTIFICATION",
                        "EMERGENCY",
                        "FRAUD_ALERT",
                        "HIGHER_EDUCATION",
                        "K12_EDUCATION",
                        "LOW_VOLUME",
                        "M2M",
                        "MARKETING",
                        "MIXED",
                        "POLITICAL",
                        "POLLING_VOTING",
                        "PROXY",
                        "PUBLIC_SAFETY_RESTRICTED",
                        "PUBLIC_SERVICE_ANNOUNCEMENT",
                        "SECURITY_ALERT",
                        "SOCIAL",
                        "SOLE_PROPRIETOR",
                        "SWEEPSTAKE",
                        "TRIAL",
                        "UCAAS_HIGH",
                        "UCAAS_LOW"
                      ]
                    },
                    "description": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c55",
                  "campaignId": "C1234567",
                  "status": "ACTIVE",
                  "usecase": "MARKETING",
                  "description": "Updated campaign description for weekly promotional offers.",
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Campaigns"
        ],
        "summary": "Delete a 10DLC or Toll-Free campaign.",
        "description": "Delete a 10DLC or Toll-Free campaign. A campaign in PENDING_REVIEW, REJECTED or TCR_REGISTER_FAILED expires immediately and the updated campaign is returned. A campaign in TCR_UPSTREAM_FAILED, DCA_DRAFT_FAILED, DCA_REGISTER_FAILED or DCA_REJECTED moves to PENDING_DELETE, and an ACTIVE campaign is deregistered from TCR/DCA; both are queued and return a message. Any creation fees still reserved are released once. Short Code campaigns are cancelled through the Short Code cancellation endpoint instead.",
        "operationId": "campaign.deleteCampaign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID to delete."
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Campaign deletion has been queued for processing"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/compliance/cases": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "List the compliance cases you can see, newest first.",
        "description": "List the compliance cases you can see, newest first. A case appears once it holds a suspension or a carrier ticket, or once Signal House sends requirements. counts.open is your open cases; counts.waitingOnYou is the open cases with requirements still to answer.",
        "operationId": "compliance.readCases",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "A group you can view. Defaults to your active group.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "OPEN, LIFT_REQUESTED or CLOSED.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "description": "new, customer, ready, lift_requested or closed. stage=customer lists your open items.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "objectType",
            "in": "query",
            "required": false,
            "description": "CAMPAIGN, BRAND, NUMBER, RCS_AGENT or SUBGROUP.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "objectId",
            "in": "query",
            "required": false,
            "description": "The campaign id, brand id, number (digits), RCS agent id or subgroup id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Only cases in this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "suspended",
            "in": "query",
            "required": false,
            "description": "true lists only cases with an open suspension or hold; false leaves them out.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Opened on or after this ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Opened on or before this ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "createdAt (newest first, the default), fixBy (soonest due first) or severity.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, from 1. Default 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Cases per page, 1 to 200. Default 25.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "caseId": {
                            "type": "string"
                          },
                          "objectType": {
                            "type": "string",
                            "enum": [
                              "CAMPAIGN",
                              "BRAND",
                              "NUMBER",
                              "RCS_AGENT",
                              "SUBGROUP"
                            ]
                          },
                          "objectId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "OPEN",
                              "LIFT_REQUESTED",
                              "CLOSED"
                            ]
                          },
                          "stage": {
                            "type": "string"
                          },
                          "suspended": {
                            "type": "boolean"
                          },
                          "reasonTemplate": {
                            "type": "string",
                            "enum": [
                              "OPT_IN",
                              "CONTENT",
                              "SCAM",
                              "COMPLAINTS",
                              "REPUTATION",
                              "OTHER"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "customerNote": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blocks": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "subject": {
                                  "type": "object",
                                  "properties": {
                                    "kind": {
                                      "type": "string"
                                    },
                                    "id": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "by": {
                                  "type": "string"
                                },
                                "startedAt": {
                                  "type": "string"
                                },
                                "liftedAt": {}
                              }
                            }
                          },
                          "tickets": {
                            "type": "array",
                            "items": {}
                          },
                          "requirements": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "requirementId": {
                                  "type": "string"
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "RECORDS",
                                    "CAMPAIGN_EDIT",
                                    "NUMBER_ACTION",
                                    "CONFIRM"
                                  ]
                                },
                                "text": {
                                  "type": "string"
                                },
                                "addedAt": {
                                  "type": "string"
                                },
                                "doneAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "doneByName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "answer": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "fileIds": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "sentAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fixBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "liftRequestedAt": {},
                          "closedAt": {},
                          "closeReason": {},
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "open": {
                          "type": "integer"
                        },
                        "waitingOnYou": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "caseId": "CASE-150",
                      "objectType": "CAMPAIGN",
                      "objectId": "C3PW9NE",
                      "status": "OPEN",
                      "stage": "customer",
                      "suspended": true,
                      "reasonTemplate": "OPT_IN",
                      "reason": "Opt-out and complaint volume",
                      "customerNote": "T-Mobile wants to see consent for the contacts you uploaded this week before it lifts the suspension.",
                      "blocks": [
                        {
                          "subject": {
                            "kind": "CAMPAIGN",
                            "id": "C3PW9NE"
                          },
                          "by": "T-Mobile",
                          "startedAt": "2026-11-09T14:05:12.000Z",
                          "liftedAt": null
                        }
                      ],
                      "tickets": [],
                      "requirements": [
                        {
                          "requirementId": "CASE-150-1",
                          "kind": "RECORDS",
                          "text": "Upload opt-in records for the contacts you added recently",
                          "addedAt": "2026-11-09T15:10:00.000Z",
                          "doneAt": "2026-11-10T16:20:00.000Z",
                          "doneByName": "Derek Sloan",
                          "answer": "Export from our CRM, Oct 1 to Nov 8",
                          "fileIds": [
                            "cf_9c1e77d0a4b24f6e"
                          ]
                        },
                        {
                          "requirementId": "CASE-150-2",
                          "kind": "CONFIRM",
                          "text": "Remove contacts you can't show consent for",
                          "addedAt": "2026-11-09T15:10:00.000Z",
                          "doneAt": null,
                          "doneByName": null,
                          "answer": null,
                          "fileIds": []
                        }
                      ],
                      "sentAt": "2026-11-09T15:10:00.000Z",
                      "fixBy": "2026-11-14T15:10:00.000Z",
                      "liftRequestedAt": null,
                      "closedAt": null,
                      "closeReason": null,
                      "createdAt": "2026-11-09T14:05:12.000Z"
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 25,
                  "totalPages": 1,
                  "counts": {
                    "open": 1,
                    "waitingOnYou": 1
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/compliance/cases/{caseId}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Read one compliance case: its stage, suspensions, tickets and requirements.",
        "description": "Read one compliance case: its stage, suspensions, tickets and requirements.",
        "operationId": "compliance.readCase",
        "parameters": [
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The case id, CASE-<number>."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "caseId": {
                      "type": "string"
                    },
                    "objectType": {
                      "type": "string",
                      "enum": [
                        "CAMPAIGN",
                        "BRAND",
                        "NUMBER",
                        "RCS_AGENT",
                        "SUBGROUP"
                      ]
                    },
                    "objectId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OPEN",
                        "LIFT_REQUESTED",
                        "CLOSED"
                      ]
                    },
                    "stage": {
                      "type": "string"
                    },
                    "suspended": {
                      "type": "boolean"
                    },
                    "reasonTemplate": {
                      "type": "string",
                      "enum": [
                        "OPT_IN",
                        "CONTENT",
                        "SCAM",
                        "COMPLAINTS",
                        "REPUTATION",
                        "OTHER"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "customerNote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "blocks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subject": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            }
                          },
                          "by": {
                            "type": "string"
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "liftedAt": {}
                        }
                      }
                    },
                    "tickets": {
                      "type": "array",
                      "items": {}
                    },
                    "requirements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "requirementId": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "RECORDS",
                              "CAMPAIGN_EDIT",
                              "NUMBER_ACTION",
                              "CONFIRM"
                            ]
                          },
                          "text": {
                            "type": "string"
                          },
                          "addedAt": {
                            "type": "string"
                          },
                          "doneAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "doneByName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "answer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fileIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fixBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "liftRequestedAt": {},
                    "closedAt": {},
                    "closeReason": {},
                    "createdAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "caseId": "CASE-150",
                  "objectType": "CAMPAIGN",
                  "objectId": "C3PW9NE",
                  "status": "OPEN",
                  "stage": "customer",
                  "suspended": true,
                  "reasonTemplate": "OPT_IN",
                  "reason": "Opt-out and complaint volume",
                  "customerNote": "T-Mobile wants to see consent for the contacts you uploaded this week before it lifts the suspension.",
                  "blocks": [
                    {
                      "subject": {
                        "kind": "CAMPAIGN",
                        "id": "C3PW9NE"
                      },
                      "by": "T-Mobile",
                      "startedAt": "2026-11-09T14:05:12.000Z",
                      "liftedAt": null
                    }
                  ],
                  "tickets": [],
                  "requirements": [
                    {
                      "requirementId": "CASE-150-1",
                      "kind": "RECORDS",
                      "text": "Upload opt-in records for the contacts you added recently",
                      "addedAt": "2026-11-09T15:10:00.000Z",
                      "doneAt": "2026-11-10T16:20:00.000Z",
                      "doneByName": "Derek Sloan",
                      "answer": "Export from our CRM, Oct 1 to Nov 8",
                      "fileIds": [
                        "cf_9c1e77d0a4b24f6e"
                      ]
                    },
                    {
                      "requirementId": "CASE-150-2",
                      "kind": "CONFIRM",
                      "text": "Remove contacts you can't show consent for",
                      "addedAt": "2026-11-09T15:10:00.000Z",
                      "doneAt": null,
                      "doneByName": null,
                      "answer": null,
                      "fileIds": []
                    }
                  ],
                  "sentAt": "2026-11-09T15:10:00.000Z",
                  "fixBy": "2026-11-14T15:10:00.000Z",
                  "liftRequestedAt": null,
                  "closedAt": null,
                  "closeReason": null,
                  "createdAt": "2026-11-09T14:05:12.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/compliance/cases/{caseId}/requirements/{requirementId}": {
      "put": {
        "tags": [
          "Compliance"
        ],
        "summary": "Answer one requirement with a note, files, or both.",
        "description": "Answer one requirement with a note, files, or both. A RECORDS requirement needs at least one file or a note. Once every requirement is answered, the case moves to the ready stage and Signal House reviews it. Returns the case.",
        "operationId": "compliance.answerRequirement",
        "parameters": [
          {
            "name": "caseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The case id, CASE-<number>."
          },
          {
            "name": "requirementId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The requirement, CASE-<number>-<number>."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnswerRequirementRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "caseId": {
                      "type": "string"
                    },
                    "objectType": {
                      "type": "string",
                      "enum": [
                        "CAMPAIGN",
                        "BRAND",
                        "NUMBER",
                        "RCS_AGENT",
                        "SUBGROUP"
                      ]
                    },
                    "objectId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OPEN",
                        "LIFT_REQUESTED",
                        "CLOSED"
                      ]
                    },
                    "stage": {
                      "type": "string"
                    },
                    "suspended": {
                      "type": "boolean"
                    },
                    "reasonTemplate": {
                      "type": "string",
                      "enum": [
                        "OPT_IN",
                        "CONTENT",
                        "SCAM",
                        "COMPLAINTS",
                        "REPUTATION",
                        "OTHER"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "customerNote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "blocks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subject": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            }
                          },
                          "by": {
                            "type": "string"
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "liftedAt": {}
                        }
                      }
                    },
                    "tickets": {
                      "type": "array",
                      "items": {}
                    },
                    "requirements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "requirementId": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "RECORDS",
                              "CAMPAIGN_EDIT",
                              "NUMBER_ACTION",
                              "CONFIRM"
                            ]
                          },
                          "text": {
                            "type": "string"
                          },
                          "addedAt": {
                            "type": "string"
                          },
                          "doneAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "doneByName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "answer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "fileIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "sentAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fixBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "liftRequestedAt": {},
                    "closedAt": {},
                    "closeReason": {},
                    "createdAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "caseId": "CASE-150",
                  "objectType": "CAMPAIGN",
                  "objectId": "C3PW9NE",
                  "status": "OPEN",
                  "stage": "ready",
                  "suspended": true,
                  "reasonTemplate": "OPT_IN",
                  "reason": "Opt-out and complaint volume",
                  "customerNote": "T-Mobile wants to see consent for the contacts you uploaded this week before it lifts the suspension.",
                  "blocks": [
                    {
                      "subject": {
                        "kind": "CAMPAIGN",
                        "id": "C3PW9NE"
                      },
                      "by": "T-Mobile",
                      "startedAt": "2026-11-09T14:05:12.000Z",
                      "liftedAt": null
                    }
                  ],
                  "tickets": [],
                  "requirements": [
                    {
                      "requirementId": "CASE-150-1",
                      "kind": "RECORDS",
                      "text": "Upload opt-in records for the contacts you added recently",
                      "addedAt": "2026-11-09T15:10:00.000Z",
                      "doneAt": "2026-11-10T16:20:00.000Z",
                      "doneByName": "Derek Sloan",
                      "answer": "Export from our CRM, Oct 1 to Nov 8",
                      "fileIds": [
                        "cf_9c1e77d0a4b24f6e"
                      ]
                    },
                    {
                      "requirementId": "CASE-150-2",
                      "kind": "CONFIRM",
                      "text": "Remove contacts you can't show consent for",
                      "addedAt": "2026-11-09T15:10:00.000Z",
                      "doneAt": "2026-11-11T09:00:00.000Z",
                      "doneByName": "Derek Sloan",
                      "answer": "Removed 312 contacts without consent",
                      "fileIds": []
                    }
                  ],
                  "sentAt": "2026-11-09T15:10:00.000Z",
                  "fixBy": "2026-11-14T15:10:00.000Z",
                  "liftRequestedAt": null,
                  "closedAt": null,
                  "closeReason": null,
                  "createdAt": "2026-11-09T14:05:12.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/compliance/files": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Upload a file to a compliance case, for example the opt-in records a requirement asks for.",
        "description": "Upload a file to a compliance case, for example the opt-in records a requirement asks for. Pass the returned fileId in fileIds when you answer the requirement. Files are private to your group and Signal House.",
        "operationId": "compliance.uploadFile",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "caseId": {
                    "type": "string",
                    "description": "The case the file answers."
                  },
                  "requirementId": {
                    "type": "string",
                    "description": "The requirement the file answers."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "A CSV, XLSX, PDF, PNG, JPG or TXT file, up to 10 MB. A CSV or TXT must be valid UTF-8, with a filename that ends in .csv or .txt. A case holds at most 50 files."
                  }
                },
                "required": [
                  "caseId",
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fileId": {
                      "type": "string"
                    },
                    "fileName": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "fileId": "cf_9c1e77d0a4b24f6e",
                  "fileName": "opt-in-records-oct.csv",
                  "mimeType": "text/csv",
                  "size": 482113
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/compliance/files/{fileId}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Download a compliance file.",
        "description": "Download a compliance file. Returns the file bytes with its Content-Type, as an attachment.",
        "operationId": "compliance.readFile",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The fileId POST /compliance/files returned."
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/group": {
      "get": {
        "tags": [
          "Groups"
        ],
        "summary": "Retrieve group information by ID.",
        "description": "Retrieve group information by ID. The id parameter is required for customer roles — an unfiltered read-all is restricted to Signal House internal roles and returns 403 for all other roles. The response carries optOutEnforcement (boolean, default true): whether Signal House suppresses the group's sends to recipients who have opted out. It is false only while the account holds a signed Opt-Out Handling Attestation, and cannot be set through this or any other endpoint; signing the attestation in the portal turns it off and re-enabling automated opt-out turns it back on.",
        "operationId": "group.readGroup",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Specific Group ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "optOutEnforcement": {
                        "type": "boolean"
                      },
                      "groupName": {
                        "type": "string"
                      },
                      "contactFirstName": {
                        "type": "string"
                      },
                      "contactLastName": {
                        "type": "string"
                      },
                      "groupCompanyName": {
                        "type": "string"
                      },
                      "addressLine1": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "country": {
                        "type": "string"
                      },
                      "postalCode": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "complianceStatus": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c56",
                    "groupId": "G1234567",
                    "optOutEnforcement": true,
                    "groupName": "Acme Parent Group",
                    "contactFirstName": "John",
                    "contactLastName": "Doe",
                    "groupCompanyName": "Acme Global",
                    "addressLine1": "123 Main St",
                    "city": "Springfield",
                    "state": "MO",
                    "country": "US",
                    "postalCode": "65804",
                    "phone": "5551234567",
                    "status": "active",
                    "complianceStatus": "unverified",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/group/counts": {
      "get": {
        "tags": [
          "Groups"
        ],
        "summary": "Retrieve resource counts grouped by group.",
        "description": "Retrieve resource counts grouped by group. Results include only groups the authenticated caller can access.",
        "operationId": "group.getGroupCounts",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Restrict results to an accessible Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1–1000).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip; requires limit.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "groupId": {
                            "type": "string"
                          },
                          "subgroups": {
                            "type": "integer"
                          },
                          "endpoints": {
                            "type": "integer"
                          },
                          "api_keys": {
                            "type": "integer"
                          },
                          "brands": {
                            "type": "integer"
                          },
                          "campaigns": {
                            "type": "integer"
                          },
                          "phone_numbers": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "groupId": "G1234567",
                      "subgroups": 2,
                      "endpoints": 3,
                      "api_keys": 1,
                      "brands": 2,
                      "campaigns": 2,
                      "phone_numbers": 4
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 20,
                  "totalPages": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/group/onboarding/my": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Retrieve the authenticated caller's customer-safe onboarding preferences — the selections captured at signup plus the gate flags derived from them.",
        "description": "Retrieve the authenticated caller's customer-safe onboarding preferences — the selections captured at signup plus the gate flags derived from them. This endpoint never returns internal KYC, staff assignment, referral, or external-reference data. Staff roles and sessions with no active group receive a synthetic verified, selection-free record rather than an error.",
        "operationId": "onboarding.readMyOnboarding",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "acceptedTermsOfService": {
                      "type": "boolean"
                    },
                    "emailVerified": {
                      "type": "boolean"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "estimatedVolume": {
                      "type": "string"
                    },
                    "pendingExternalLink": {}
                  }
                },
                "example": {
                  "acceptedTermsOfService": true,
                  "emailVerified": true,
                  "products": [
                    "api"
                  ],
                  "estimatedVolume": "10k-100k",
                  "pendingExternalLink": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/group/ontraport": {
      "get": {
        "tags": [
          "Groups"
        ],
        "summary": "Get the group's Ontraport connection status: whether it's connected, the webhook URL to paste into an Ontraport automation's Send to a Webhook step, and whether the connection is enabled.",
        "description": "Get the group's Ontraport connection status: whether it's connected, the webhook URL to paste into an Ontraport automation's Send to a Webhook step, and whether the connection is enabled.",
        "operationId": "ontraport.readOntraportConnection",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "webhookUrl": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "connected": true,
                  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "signalhouse_admin"
        ]
      },
      "put": {
        "tags": [
          "Groups"
        ],
        "summary": "Connect or reconnect the group's own Ontraport account.",
        "description": "Connect or reconnect the group's own Ontraport account. The API Key and App ID are verified with a read-only call to Ontraport before anything is stored; a bad pair throws rather than saving. Both are encrypted at rest and never returned by any read.",
        "operationId": "ontraport.connectOntraport",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectOntraportRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "webhookUrl": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "connected": true,
                  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "signalhouse_admin"
        ]
      },
      "delete": {
        "tags": [
          "Groups"
        ],
        "summary": "Disconnect (disable) the group's Ontraport connection.",
        "description": "Disconnect (disable) the group's Ontraport connection. The webhook stops accepting deliveries immediately, but the stored API Key, App ID, and any linked Ontraport contact ids are kept, so reconnecting resumes cleanly. The primary self-service way to kill a leaked webhook URL.",
        "operationId": "ontraport.disconnectOntraport",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "webhookUrl": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "connected": true,
                  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/aBcDeFgHiJkLmNoPqRsTuVwXyZ012345",
                  "enabled": false
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "signalhouse_admin"
        ]
      }
    },
    "/group/ontraport/regenerate-token": {
      "put": {
        "tags": [
          "Groups"
        ],
        "summary": "Mint a fresh webhook token for an existing connection, immediately invalidating the old URL.",
        "description": "Mint a fresh webhook token for an existing connection, immediately invalidating the old URL. A second self-service way to kill a leaked webhook URL, for when sending should keep working but the old URL needs to stop accepting deliveries. Throws if the group has no Ontraport connection yet.",
        "operationId": "ontraport.regenerateOntraportWebhookToken",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OntraportGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "webhookUrl": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "connected": true,
                  "webhookUrl": "https://api.signalhouse.io/integrations/ontraport/webhook/zYxWvUtSrQpOnMlKjIhGfEdCbA987654",
                  "enabled": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "signalhouse_admin"
        ]
      }
    },
    "/group/sso": {
      "get": {
        "tags": [
          "Groups"
        ],
        "summary": "Get the group's Enterprise SSO configuration: whether SSO is available on this API, the redirect URL to register with the identity provider, the saved provider (without its client secret), and each claimed domain with the DNS record that verifies it.",
        "description": "Get the group's Enterprise SSO configuration: whether SSO is available on this API, the redirect URL to register with the identity provider, the saved provider (without its client secret), and each claimed domain with the DNS record that verifies it.",
        "operationId": "groupSso.readSsoConfiguration",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "callbackUrl": {
                      "type": "string"
                    },
                    "connection": {
                      "type": "object",
                      "properties": {
                        "connectionId": {
                          "type": "string"
                        },
                        "issuer": {
                          "type": "string"
                        },
                        "clientId": {
                          "type": "string"
                        },
                        "hasClientSecret": {
                          "type": "boolean"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain": {
                            "type": "string"
                          },
                          "verified": {
                            "type": "boolean"
                          },
                          "verifiedAt": {},
                          "lastCheckedAt": {},
                          "verificationRecord": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567",
                  "available": true,
                  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
                  "connection": {
                    "connectionId": "6711c0ffee0000000000abcd",
                    "issuer": "https://acme.okta.com",
                    "clientId": "0oa1b2c3d4e5f6g7h8i9",
                    "hasClientSecret": true,
                    "enabled": true,
                    "createdAt": "2026-10-01T12:00:00.000Z",
                    "updatedAt": "2026-10-01T12:00:00.000Z"
                  },
                  "domains": [
                    {
                      "domain": "acme.com",
                      "verified": false,
                      "verifiedAt": null,
                      "lastCheckedAt": null,
                      "verificationRecord": {
                        "type": "TXT",
                        "name": "_signalhouse-verification.acme.com",
                        "value": "signalhouse-verification=Zk3l9b5m0n2Q8rV1sT4uW7yZx2"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      },
      "put": {
        "tags": [
          "Groups"
        ],
        "summary": "Create or update the group's identity provider.",
        "description": "Create or update the group's identity provider. The issuer must publish an OpenID Connect discovery document at a public https address; the API reads it before saving and stores the issuer exactly as the document names it. Requires a fresh POST /auth/2fa/confirm-identity from the same session, which a successful save spends.",
        "operationId": "groupSso.saveSsoConnection",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveSsoConnectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "callbackUrl": {
                      "type": "string"
                    },
                    "connection": {
                      "type": "object",
                      "properties": {
                        "issuer": {
                          "type": "string"
                        },
                        "clientId": {
                          "type": "string"
                        },
                        "hasClientSecret": {
                          "type": "boolean"
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    },
                    "domains": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567",
                  "available": true,
                  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
                  "connection": {
                    "issuer": "https://acme.okta.com",
                    "clientId": "0oa1b2c3d4e5f6g7h8i9",
                    "hasClientSecret": true,
                    "enabled": true
                  },
                  "domains": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      },
      "delete": {
        "tags": [
          "Groups"
        ],
        "summary": "Remove the group's identity provider and all its domains, and unlink every account that signed in through it.",
        "description": "Remove the group's identity provider and all its domains, and unlink every account that signed in through it. The accounts themselves are kept. Requires a fresh POST /auth/2fa/confirm-identity from the same session.",
        "operationId": "groupSso.deleteSsoConnection",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "available": {
                      "type": "boolean"
                    },
                    "callbackUrl": {
                      "type": "string"
                    },
                    "connection": {},
                    "domains": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567",
                  "available": true,
                  "callbackUrl": "https://api.signalhouse.io/auth/oauth/sso/callback",
                  "connection": null,
                  "domains": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      }
    },
    "/group/sso/domains": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Claim an email domain for the group's SSO.",
        "description": "Claim an email domain for the group's SSO. The claim does nothing until it is verified; the response includes the TXT record to publish. Refused for public mailbox domains and for a domain another group has already verified.",
        "operationId": "groupSso.addSsoDomain",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoDomainRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      }
    },
    "/group/sso/domains/{domain}": {
      "delete": {
        "tags": [
          "Groups"
        ],
        "summary": "Remove a domain from the group's SSO.",
        "description": "Remove a domain from the group's SSO. People on it stop signing in through the group's identity provider; their accounts are kept.",
        "operationId": "groupSso.removeSsoDomain",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The domain."
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      }
    },
    "/group/sso/domains/{domain}/verify": {
      "post": {
        "tags": [
          "Groups"
        ],
        "summary": "Verify a claimed domain by looking up its TXT record at _signalhouse-verification.<domain>.",
        "description": "Verify a claimed domain by looking up its TXT record at _signalhouse-verification.<domain>. Returns a 400 while the record isn't found (DNS changes can take a while to appear), or when another group verified the domain first.",
        "operationId": "groupSso.verifySsoDomain",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The claimed domain."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OntraportGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin"
        ]
      }
    },
    "/group/{id}": {
      "put": {
        "tags": [
          "Groups"
        ],
        "summary": "Update an existing group.",
        "description": "Update an existing group.",
        "operationId": "group.updateGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "groupName": {
                      "type": "string"
                    },
                    "cspId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "defaultCnpSubgroupId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "complianceStatus": {
                      "type": "string",
                      "enum": [
                        "unverified",
                        "pending",
                        "verified",
                        "rejected"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c56",
                  "groupId": "G1234567",
                  "groupName": "Acme Parent Group Updated",
                  "cspId": "CSP123",
                  "defaultCnpSubgroupId": "S1234567",
                  "status": "active",
                  "complianceStatus": "unverified",
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing"
        ]
      }
    },
    "/landing": {
      "post": {
        "tags": [
          "Landing"
        ],
        "summary": "Create a new landing page associated with a specific brand.",
        "description": "Create a new landing page associated with a specific brand. Requires a file upload for the logo, unless useBrandTemplate is set for a Toll-Free page — the brand's template supplies the logo in that case.",
        "operationId": "landing.createLanding",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "type": "string",
                    "description": "Brand ID. If provided, groupId and subgroupId are derived from the brand. If omitted or set to 'pending', subgroupId is required."
                  },
                  "subgroupId": {
                    "type": "string",
                    "description": "Subgroup ID. Required when brandId is not provided or is 'pending'."
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the landing page."
                  },
                  "primaryBackgroundColor": {
                    "type": "string",
                    "description": "Primary background hex color code (e.g., #FFFFFF). Defaults to #FFFFFF."
                  },
                  "secondaryBackgroundColor": {
                    "type": "string",
                    "description": "Secondary background hex color code. Defaults to #FFFFFF."
                  },
                  "primaryTextColor": {
                    "type": "string",
                    "description": "Primary text hex color code. Defaults to #000000."
                  },
                  "secondaryTextColor": {
                    "type": "string",
                    "description": "Secondary text hex color code. Defaults to #000000."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Webhook URL for landing page events."
                  },
                  "registrationType": {
                    "type": "string",
                    "description": "Which page type to build: TEN_DLC (default) or TOLL_FREE. A TOLL_FREE page renders one consent checkbox per use case per channel from the values below instead of deriving them from the brand's campaigns."
                  },
                  "tollFree": {
                    "type": "object",
                    "description": "Toll-Free consent content. Required when registrationType is TOLL_FREE. Sent as a JSON string in the multipart body.",
                    "properties": {
                      "useCases": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The campaign's real use cases. At least one required when registrationType is TOLL_FREE."
                      },
                      "channels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Channels consent covers: SMS, MMS, VOICE. At least one required when registrationType is TOLL_FREE."
                      },
                      "consentDisclosure": {
                        "type": "string",
                        "description": "Shared disclosure rendered once above the checkboxes (max 1024 chars). Required when registrationType is TOLL_FREE."
                      },
                      "consentBoxes": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        },
                        "description": "The rendered consent boxes, each { useCase, channel, text } with text at most 512 chars. Max 16 boxes. Required when registrationType is TOLL_FREE."
                      }
                    }
                  },
                  "useBrandTemplate": {
                    "type": "boolean",
                    "description": "Toll-Free only. Build the page from the brand's landing page template (GET /landing/template/:brandId), taking its colors, logo and webhook URL from there. No logo file is required when set. description is still supplied by the caller, because the About paragraph names the message types this campaign's use cases cover."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The logo image file. Must be uploaded as a multipart/form-data field named 'file'. Max 3 MB. Required unless useBrandTemplate is set."
                  }
                },
                "required": [
                  "description"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "landingId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "themeColor": {
                      "type": "object",
                      "properties": {
                        "primaryBackgroundColor": {
                          "type": "string"
                        },
                        "secondaryBackgroundColor": {
                          "type": "string"
                        },
                        "primaryTextColor": {
                          "type": "string"
                        },
                        "secondaryTextColor": {
                          "type": "string"
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "INACTIVE"
                      ]
                    },
                    "landingPageUrl": {
                      "type": "string"
                    },
                    "privacyPolicyUrl": {
                      "type": "string"
                    },
                    "termsAndConditionsUrl": {
                      "type": "string"
                    },
                    "optInLinkUrl": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c57",
                  "landingId": "L1234567",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": "B1234567",
                  "description": "Sign up to receive updates from Acme Corp",
                  "themeColor": {
                    "primaryBackgroundColor": "#FFFFFF",
                    "secondaryBackgroundColor": "#F5F5F5",
                    "primaryTextColor": "#000000",
                    "secondaryTextColor": "#666666"
                  },
                  "status": "ACTIVE",
                  "landingPageUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                  "privacyPolicyUrl": "https://acme-corp.landing.example.com/intake/L1234567/privacy-policy",
                  "termsAndConditionsUrl": "https://acme-corp.landing.example.com/intake/L1234567/terms-service",
                  "optInLinkUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/landing/brand/{brandId}": {
      "get": {
        "tags": [
          "Landing"
        ],
        "summary": "Retrieve the landing page associated with a specific brand.",
        "description": "Retrieve the landing page associated with a specific brand. Returns an empty array if not found, or a single-element array when found. Toll-Free pages also carry registrationType and the stored tollFree consent object.",
        "operationId": "landing.readLandingByBrandId",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "landingId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "themeColor": {
                        "type": "object",
                        "properties": {
                          "primaryBackgroundColor": {
                            "type": "string"
                          },
                          "secondaryBackgroundColor": {
                            "type": "string"
                          },
                          "primaryTextColor": {
                            "type": "string"
                          },
                          "secondaryTextColor": {
                            "type": "string"
                          }
                        }
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "ACTIVE",
                          "INACTIVE"
                        ]
                      },
                      "webhookUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "usecases": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "subUsecases": {
                        "type": "array",
                        "items": {}
                      },
                      "landingPageUrl": {
                        "type": "string"
                      },
                      "privacyPolicyUrl": {
                        "type": "string"
                      },
                      "termsAndConditionsUrl": {
                        "type": "string"
                      },
                      "optInLinkUrl": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c57",
                    "landingId": "L1234567",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "description": "Sign up to receive updates from Acme Corp",
                    "themeColor": {
                      "primaryBackgroundColor": "#FFFFFF",
                      "secondaryBackgroundColor": "#F5F5F5",
                      "primaryTextColor": "#000000",
                      "secondaryTextColor": "#666666"
                    },
                    "status": "ACTIVE",
                    "webhookUrl": "https://your-server.com/api/landing-events",
                    "usecases": [
                      "MARKETING"
                    ],
                    "subUsecases": [],
                    "landingPageUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                    "privacyPolicyUrl": "https://acme-corp.landing.example.com/intake/L1234567/privacy-policy",
                    "termsAndConditionsUrl": "https://acme-corp.landing.example.com/intake/L1234567/terms-service",
                    "optInLinkUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/landing/public/{landingId}": {
      "get": {
        "tags": [
          "Landing"
        ],
        "summary": "Retrieve a public-facing landing page.",
        "description": "Retrieve a public-facing landing page. Does not require authentication. A Toll-Free page additionally returns registrationType and a tollFree object carrying the consent disclosure and boxes the page renders; usecases and subUsecases are present but empty for those pages.",
        "operationId": "landing.readPublicLanding",
        "parameters": [
          {
            "name": "landingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Landing Page ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "landingData": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "brandName": {
                          "type": "string"
                        },
                        "logo": {
                          "type": "string"
                        },
                        "themeColor": {
                          "type": "object",
                          "properties": {
                            "primaryBackgroundColor": {
                              "type": "string"
                            },
                            "secondaryBackgroundColor": {
                              "type": "string"
                            },
                            "primaryTextColor": {
                              "type": "string"
                            },
                            "secondaryTextColor": {
                              "type": "string"
                            }
                          }
                        },
                        "webhookUrl": {
                          "type": "string"
                        },
                        "usecases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "subUsecases": {
                          "type": "array",
                          "items": {}
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "metaData": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "phoneNumber": {
                              "type": "string"
                            }
                          }
                        },
                        "registrationType": {
                          "type": "string"
                        },
                        "tollFree": {
                          "type": "object",
                          "properties": {
                            "useCases": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "channels": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "consentDisclosure": {
                              "type": "string"
                            },
                            "consentBoxes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "useCase": {
                                    "type": "string"
                                  },
                                  "channel": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "landingData": {
                    "description": "Sign up to receive updates from Acme Corp",
                    "brandName": "Acme Corp",
                    "logo": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
                    "themeColor": {
                      "primaryBackgroundColor": "#FFFFFF",
                      "secondaryBackgroundColor": "#F5F5F5",
                      "primaryTextColor": "#000000",
                      "secondaryTextColor": "#666666"
                    },
                    "webhookUrl": "https://your-server.com/api/landing-events",
                    "usecases": [
                      "MARKETING",
                      "CUSTOMER_CARE"
                    ],
                    "subUsecases": [],
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "metaData": {
                      "state": "MO",
                      "email": "support@acme.com",
                      "phoneNumber": "5551234567"
                    },
                    "registrationType": "TOLL_FREE",
                    "tollFree": {
                      "useCases": [
                        "APPOINTMENTS",
                        "BILLING"
                      ],
                      "channels": [
                        "SMS",
                        "MMS"
                      ],
                      "consentDisclosure": "Our message frequency may vary. Message & data rates apply. Reply STOP to unsubscribe from further messaging. Reply HELP for more information.",
                      "consentBoxes": [
                        {
                          "useCase": "APPOINTMENTS",
                          "channel": "SMS",
                          "text": "Consent to receive SMS about Appointments from Acme Corp."
                        },
                        {
                          "useCase": "APPOINTMENTS",
                          "channel": "MMS",
                          "text": "Consent to receive MMS about Appointments from Acme Corp."
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/landing/template/{brandId}": {
      "get": {
        "tags": [
          "Landing"
        ],
        "summary": "Retrieve a Toll-Free brand's landing page template — the reusable presentation (description fragment, colors, logo, webhook) that every page generated for the brand snapshots at creation.",
        "description": "Retrieve a Toll-Free brand's landing page template — the reusable presentation (description fragment, colors, logo, webhook) that every page generated for the brand snapshots at creation. Returns an empty array when the brand has no template. Toll-Free only; a 10DLC brand carries these fields on its single landing page instead.",
        "operationId": "landing.readLandingTemplateByBrandId",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "userDescription": {
                        "type": "string"
                      },
                      "themeColor": {
                        "type": "object",
                        "properties": {
                          "primaryBackgroundColor": {
                            "type": "string"
                          },
                          "secondaryBackgroundColor": {
                            "type": "string"
                          },
                          "primaryTextColor": {
                            "type": "string"
                          },
                          "secondaryTextColor": {
                            "type": "string"
                          }
                        }
                      },
                      "webhookUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c60",
                    "brandId": "TFNB7K3M9QXR2V",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "userDescription": "healthcare scheduling company",
                    "themeColor": {
                      "primaryBackgroundColor": "#FFFFFF",
                      "secondaryBackgroundColor": "#F5F5F5",
                      "primaryTextColor": "#000000",
                      "secondaryTextColor": "#666666"
                    },
                    "webhookUrl": "https://your-server.com/api/landing-events",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Landing"
        ],
        "summary": "Create or replace a Toll-Free brand's landing page template.",
        "description": "Create or replace a Toll-Free brand's landing page template. Sent as multipart/form-data with the logo under the file field. A brand has exactly one template, so this is an upsert. Editing a template never alters a page that already exists — pages snapshot the template at creation, so a URL already given to a carrier keeps rendering what was declared. Any field you omit keeps its stored value, so a colour-only save leaves the logo, the other colours and the webhook untouched. The logo is required only the first time. userDescription is the customer's own sentence about the business, not the finished About paragraph: the services clause naming a campaign's message types is added per page at generation.",
        "operationId": "landing.upsertLandingTemplate",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Brand ID the template belongs to."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "userDescription": {
                    "type": "string",
                    "description": "The customer's own sentence about their business (max 2048 characters)."
                  },
                  "primaryBackgroundColor": {
                    "type": "string",
                    "description": "Hex color; defaults to #FFFFFF."
                  },
                  "secondaryBackgroundColor": {
                    "type": "string",
                    "description": "Hex color; defaults to #FFFFFF."
                  },
                  "primaryTextColor": {
                    "type": "string",
                    "description": "Hex color; defaults to #000000."
                  },
                  "secondaryTextColor": {
                    "type": "string",
                    "description": "Hex color; defaults to #000000."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Where generated pages post opt-in submissions."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Logo image (JPEG/PNG, max 3MB). Required when creating the template; omit to keep the stored logo."
                  }
                },
                "required": [
                  "userDescription"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "userDescription": {
                      "type": "string"
                    },
                    "themeColor": {
                      "type": "object",
                      "properties": {
                        "primaryBackgroundColor": {
                          "type": "string"
                        },
                        "secondaryBackgroundColor": {
                          "type": "string"
                        },
                        "primaryTextColor": {
                          "type": "string"
                        },
                        "secondaryTextColor": {
                          "type": "string"
                        }
                      }
                    },
                    "webhookUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c60",
                  "brandId": "TFNB7K3M9QXR2V",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "userDescription": "healthcare scheduling company",
                  "themeColor": {
                    "primaryBackgroundColor": "#FFFFFF",
                    "secondaryBackgroundColor": "#F5F5F5",
                    "primaryTextColor": "#000000",
                    "secondaryTextColor": "#666666"
                  },
                  "webhookUrl": "https://your-server.com/api/landing-events",
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/landing/{landingId}": {
      "get": {
        "tags": [
          "Landing"
        ],
        "summary": "Retrieve landing page details including dynamic usecases and URL fields.",
        "description": "Retrieve landing page details including dynamic usecases and URL fields. URL fields (landingPageUrl, privacyPolicyUrl, termsAndConditionsUrl, optInLinkUrl) are present only when the associated brand is found. Toll-Free pages also carry registrationType and the stored tollFree consent object.",
        "operationId": "landing.readLanding",
        "parameters": [
          {
            "name": "landingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Landing Page ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "landingId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "themeColor": {
                      "type": "object",
                      "properties": {
                        "primaryBackgroundColor": {
                          "type": "string"
                        },
                        "secondaryBackgroundColor": {
                          "type": "string"
                        },
                        "primaryTextColor": {
                          "type": "string"
                        },
                        "secondaryTextColor": {
                          "type": "string"
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "INACTIVE"
                      ]
                    },
                    "webhookUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "usecases": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subUsecases": {
                      "type": "array",
                      "items": {}
                    },
                    "landingPageUrl": {
                      "type": "string"
                    },
                    "privacyPolicyUrl": {
                      "type": "string"
                    },
                    "termsAndConditionsUrl": {
                      "type": "string"
                    },
                    "optInLinkUrl": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c57",
                  "landingId": "L1234567",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "brandId": "B1234567",
                  "description": "Sign up to receive updates from Acme Corp",
                  "themeColor": {
                    "primaryBackgroundColor": "#FFFFFF",
                    "secondaryBackgroundColor": "#F5F5F5",
                    "primaryTextColor": "#000000",
                    "secondaryTextColor": "#666666"
                  },
                  "status": "ACTIVE",
                  "webhookUrl": "https://your-server.com/api/landing-events",
                  "usecases": [
                    "MARKETING",
                    "CUSTOMER_CARE"
                  ],
                  "subUsecases": [],
                  "landingPageUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                  "privacyPolicyUrl": "https://acme-corp.landing.example.com/intake/L1234567/privacy-policy",
                  "termsAndConditionsUrl": "https://acme-corp.landing.example.com/intake/L1234567/terms-service",
                  "optInLinkUrl": "https://acme-corp.landing.example.com/intake/L1234567",
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Landing"
        ],
        "summary": "Update an existing landing page.",
        "description": "Update an existing landing page.",
        "operationId": "landing.updateLanding",
        "parameters": [
          {
            "name": "landingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Landing Page ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "description": "Description of the landing page."
                  },
                  "primaryBackgroundColor": {
                    "type": "string",
                    "description": "Primary background hex color code."
                  },
                  "secondaryBackgroundColor": {
                    "type": "string",
                    "description": "Secondary background hex color code."
                  },
                  "primaryTextColor": {
                    "type": "string",
                    "description": "Primary text hex color code."
                  },
                  "secondaryTextColor": {
                    "type": "string",
                    "description": "Secondary text hex color code."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Webhook URL for landing page events."
                  },
                  "registrationType": {
                    "type": "string",
                    "description": "Immutable once the page exists. May be resent with its current value, but a request that changes it is rejected — a page whose URL is already declared to a carrier would otherwise stop rendering the consent boxes that were declared."
                  },
                  "tollFree": {
                    "type": "object",
                    "description": "Toll-Free consent content. Replaces the whole subdocument when sent. Sent as a JSON string in the multipart body.",
                    "properties": {
                      "useCases": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "The campaign's real use cases. At least one required when registrationType is TOLL_FREE."
                      },
                      "channels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Channels consent covers: SMS, MMS, VOICE. At least one required when registrationType is TOLL_FREE."
                      },
                      "consentDisclosure": {
                        "type": "string",
                        "description": "Shared disclosure rendered once above the checkboxes (max 1024 chars). Required when registrationType is TOLL_FREE."
                      },
                      "consentBoxes": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        },
                        "description": "The rendered consent boxes, each { useCase, channel, text } with text at most 512 chars. Max 16 boxes. Required when registrationType is TOLL_FREE."
                      }
                    }
                  },
                  "useBrandTemplate": {
                    "type": "boolean",
                    "description": "Toll-Free only. Re-copy the brand's landing page template into this page, so a corrected logo or color reaches a page that already exists instead of creating a second one."
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Updated logo image file. Must be uploaded as a multipart/form-data field named 'file'. Max 3 MB."
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "landingId": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "themeColor": {
                      "type": "object",
                      "properties": {
                        "primaryBackgroundColor": {
                          "type": "string"
                        },
                        "secondaryBackgroundColor": {
                          "type": "string"
                        },
                        "primaryTextColor": {
                          "type": "string"
                        },
                        "secondaryTextColor": {
                          "type": "string"
                        }
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "INACTIVE"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c57",
                  "landingId": "L1234567",
                  "description": "Updated landing page description",
                  "themeColor": {
                    "primaryBackgroundColor": "#FFFFFF",
                    "secondaryBackgroundColor": "#F5F5F5",
                    "primaryTextColor": "#000000",
                    "secondaryTextColor": "#666666"
                  },
                  "status": "ACTIVE",
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Landing"
        ],
        "summary": "Inactivate a landing page.",
        "description": "Inactivate a landing page.",
        "operationId": "landing.deleteLanding",
        "parameters": [
          {
            "name": "landingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Landing Page ID to delete."
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Landing page with ID L1234567 has been deleted"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve message logs with advanced filtering.",
        "description": "Retrieve message logs with advanced filtering. When fetching a single message by id, the response includes a cost field representing the net cost in microdollars (1,000,000 = $1.00). An RCS message carries ratedCostMicros, what its RCS leg was rated at when queued, and, once it settles, carrierFeeMicros: the carrier pass-through and media surcharge charged for it, written when an outbound RCS message is delivered or read and when an inbound RCS message is charged. A message that never settles over RCS has no carrierFeeMicros, and a later RCS session adjustment does not change it. An inbound message carries inReplyToMessageId, the message it answers. A reply chip or button names its message, so that link is exact; any other reply links to the newest message your number or agent sent that handset in the 7 days before it, while that message was sent, delivered or read and was not a STOP or HELP auto-reply. It is absent when there is no such message, on P2P replies, and on replies stored before the link was switched on. If that message has a parentMessageId, it was an RCS fallback, and the parent is the RCS message you sent.",
        "operationId": "message.readMessage",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific Message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to messages attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Cannot be combined with campaignId (400); a phoneNumber filter narrows further. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Filter by Group ID. (Required when id is not provided.)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number. Repeat the parameter for multiple values (e.g. phoneNumber=12025551234&phoneNumber=12025555678).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "senderPhoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by sender phone number. A plain value is an exact match; repeat the parameter for multiple exact values (e.g. senderPhoneNumber=12025551234&senderPhoneNumber=12025555678). A value containing % is a partial-match wildcard (e.g. %5551 matches numbers ending in 5551); 3-15 digits are required alongside the %. In the URL itself, encode the literal % as %25 (e.g. %255551).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientPhoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by recipient phone number. A plain value is an exact match; repeat the parameter for multiple exact values (e.g. recipientPhoneNumber=12025551234&recipientPhoneNumber=12025555678). A value containing % is a partial-match wildcard (e.g. %5551 matches numbers ending in 5551); 3-15 digits are required alongside the %. In the URL itself, encode the literal % as %25 (e.g. %255551).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by message status (ENQUEUED, DEQUEUED, SENT, FAILED, DELIVERED, and for RCS messages READ, EXPIRED, FALLBACK, BLOCKED). Repeat the parameter for multiple values (e.g. status=DELIVERED&status=SENT). Without status, a group that has ever had an RCS agent gets every status. Any other group gets ENQUEUED, DEQUEUED, SENT, FAILED and DELIVERED.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Filter by direction (INBOUND or OUTBOUND).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "required": false,
            "description": "Filter by message type. Accepts a single value or an array (repeat the param for multiple values, e.g. messageType=SMS&messageType=MMS, or pass a comma-separated list). Allowed values: SMS, MMS, RCS, WHATSAPP, VIBER, P2P. When omitted, defaults to all non-P2P types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Filter by messaging channel. Accepts a single value or an array (cumulative — repeat the param, e.g. channel=tenDLC&channel=p2p, or pass a comma-separated list). Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode, p2p, rcs. Channel is stored on the message at write time and filtered directly on read; legacy (pre-stamp) messages fold into tenDLC. Ignored when matchAny is true (matchAny takes precedence).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "matchAny",
            "in": "query",
            "required": false,
            "description": "When true, the provided campaignId/brandId/phoneNumber filters are combined with OR (a message matches ANY of them) instead of the default most-specific-single behavior. subgroupId stays an AND scope. Opt-in; default behavior is unchanged when omitted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentimentLabel",
            "in": "query",
            "required": false,
            "description": "Filter by sentiment. Accepts a single value or an array (cumulative — repeat the param, e.g. sentimentLabel=positive&sentimentLabel=negative, or pass a comma-separated list). Allowed values: positive, neutral, negative. The label is derived from the message's sentimentScore using inclusive ±25 thresholds, so this filter selects the matching score range: positive is >= 25, negative is <= -25, and neutral is everything between. Unscored messages (sentimentScore null) match no value, and outbound messages are never scored.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "errorCode",
            "in": "query",
            "required": false,
            "description": "Filter FAILED messages by Signal House error code (single value, comma-separated list or repeated param). OUT is the campaign opt-out, shown as RECIPIENT_OPTED_OUT. Carrier codes are not filterable here; they live inside successOrFailureReason.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode. (Required when id is not provided.)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back. (Required when id is not provided.)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateId",
            "in": "query",
            "required": false,
            "description": "Filter by the template an RCS message was sent from. This filter, templateVersion, bulkId, fallbackReason, billingClass, deliveredChannel and isTest=true read RCS messages only unless messageType names another type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "templateVersion",
            "in": "query",
            "required": false,
            "description": "Filter by the template version an RCS message was sent from. A positive whole number; any other value answers 400.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bulkId",
            "in": "query",
            "required": false,
            "description": "Filter by the bulkId that POST /message/rcs or POST /message/rcs/batch returned: the messages of one send.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fallbackReason",
            "in": "query",
            "required": false,
            "description": "Filter by why an RCS message ran its fallback: NOT_CAPABLE, CARRIER_NOT_LAUNCHED, TTL_EXPIRED, RCS_ERROR, PROVIDER_ERROR or SMS_ONLY.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "billingClass",
            "in": "query",
            "required": false,
            "description": "Filter by RCS billing class: RICH or RICH_MEDIA.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "deliveredChannel",
            "in": "query",
            "required": false,
            "description": "Filter by the channel that delivered an RCS message: rcs, sms or mms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "isTest",
            "in": "query",
            "required": false,
            "description": "true returns RCS test messages only; false leaves them out.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by: createdAt, segmentCount, status, or sentimentScore.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "Sort order (asc/desc).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "required": false,
            "description": "true returns { data, total, page, limit, totalPages, totalExact, partial, countError } instead of the array, where data is the page. total is the number of messages the filters match, counted on the analytics mirror, which can trail the list by seconds, so totalExact is false, except with id, where it is true (total 1, or 0 when no message matches). It is null, never 0, when there is no count: countError is FILTER_NOT_COUNTABLE when senderPhoneNumber or recipientPhoneNumber is set, and COUNT_UNAVAILABLE when the count could not run; data is still returned. partial is true when startDate is before 2026-01-12, the first day the count covers, so total counts only from that day. Omitted or false: the bare array, unchanged.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "campaignId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "phoneNumber": {
                        "type": "string"
                      },
                      "carrier": {
                        "type": "string"
                      },
                      "messageType": {
                        "type": "string",
                        "enum": [
                          "SMS",
                          "MMS",
                          "RCS",
                          "WHATSAPP",
                          "VIBER",
                          "P2P"
                        ]
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "INBOUND",
                          "OUTBOUND"
                        ]
                      },
                      "recipientPhoneNumber": {
                        "type": "string"
                      },
                      "messageBody": {
                        "type": "string"
                      },
                      "segmentCount": {
                        "type": "integer"
                      },
                      "sentimentScore": {},
                      "sentimentLabel": {},
                      "sentimentScoredAt": {},
                      "status": {
                        "type": "string",
                        "enum": [
                          "ENQUEUED",
                          "DEQUEUED",
                          "SENT",
                          "FAILED",
                          "DELIVERED",
                          "READ",
                          "EXPIRED",
                          "FALLBACK",
                          "BLOCKED"
                        ]
                      },
                      "statusHistory": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "timestamp": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "ENQUEUED",
                                "DEQUEUED",
                                "SENT",
                                "FAILED",
                                "DELIVERED",
                                "READ",
                                "EXPIRED",
                                "FALLBACK",
                                "BLOCKED"
                              ]
                            }
                          }
                        }
                      },
                      "cost": {
                        "type": "integer"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c58",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "campaignId": "C1234567",
                    "phoneNumber": "12246431042",
                    "carrier": "T-Mobile",
                    "messageType": "SMS",
                    "direction": "OUTBOUND",
                    "recipientPhoneNumber": "14175551234",
                    "messageBody": "Hello from Signal House API!",
                    "segmentCount": 1,
                    "sentimentScore": null,
                    "sentimentLabel": null,
                    "sentimentScoredAt": null,
                    "status": "DELIVERED",
                    "statusHistory": [
                      {
                        "timestamp": "2024-01-15T14:30:00.000Z",
                        "status": "ENQUEUED"
                      },
                      {
                        "timestamp": "2024-01-15T14:30:01.000Z",
                        "status": "DEQUEUED"
                      },
                      {
                        "timestamp": "2024-01-15T14:30:02.000Z",
                        "status": "SENT"
                      },
                      {
                        "timestamp": "2024-01-15T14:30:05.000Z",
                        "status": "DELIVERED"
                      }
                    ],
                    "cost": 23000,
                    "createdAt": "2024-01-15T14:30:00.000Z",
                    "updatedAt": "2024-01-15T14:30:05.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve aggregated message analytics.",
        "description": "Retrieve aggregated message analytics. Sentiment arrives already weighted server-side (sum score / scored count) over inbound scored messages in range — never a mean of per-message scores — with a per-message-type breakdown alongside it. Clients never need to compute an average. The response also carries derived health figures — healthScore (1–10), healthDeliveryRate, healthOptOutRate, healthDeliveryScore and healthOptOutScore, each null when nothing was sent — computed from the response's own counters by the same formula GET /number/health uses; elsewhere these fields are absent.",
        "operationId": "message.getMessageAnalytics",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "required": false,
            "description": "Scopes the sentiment figures to SMS, MMS and/or P2P (single value, array, or comma-separated). Omit for all scored types. It does NOT narrow the message counts, which are always returned split per type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID. Repeat the parameter for multiple values (e.g. subgroupId=id1&subgroupId=id2).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID. Repeat the parameter for multiple values (e.g. brandId=BABC123&brandId=BDEF456).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID. Repeat the parameter for multiple values (e.g. campaignId=CABC123&campaignId=CDEF456).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number. Repeat the parameter for multiple values (e.g. phoneNumber=12025551234&phoneNumber=12025555678).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier. Repeat the parameter for multiple values (e.g. carrier=att&carrier=verizon).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrierFamily",
            "in": "query",
            "required": false,
            "description": "Filter by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, the Canada rails' families for Canadian handsets; Standard and IceWireless also appear on Canadian messages sent before those families). Repeat the parameter or pass a comma-separated list for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "matchAny",
            "in": "query",
            "required": false,
            "description": "When true, the provided campaignId/brandId/phoneNumber filters are combined with OR (match ANY) instead of the default most-specific-single behavior. subgroupId stays an AND scope. Opt-in; default behavior is unchanged when omitted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Filter by messaging channel. Accepts a single value or an array (cumulative — repeat the param, e.g. channel=tenDLC&channel=tollFree, or pass a comma-separated list). Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode, p2p. Channel is filtered on the stored channel column; tenDLC folds the legacy channel-absent bucket in, and p2p is a first-class channel. Ignored when matchAny is true (matchAny takes precedence).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "smsQueued": {
                      "type": "integer"
                    },
                    "smsDequeued": {
                      "type": "integer"
                    },
                    "smsSent": {
                      "type": "integer"
                    },
                    "smsDelivered": {
                      "type": "integer"
                    },
                    "smsFailed": {
                      "type": "integer"
                    },
                    "smsInbound": {
                      "type": "integer"
                    },
                    "smsOutboundSegments": {
                      "type": "integer"
                    },
                    "smsInboundSegments": {
                      "type": "integer"
                    },
                    "smsOptOuts": {
                      "type": "integer"
                    },
                    "smsShortlinksSent": {
                      "type": "integer"
                    },
                    "smsUniqueShortlinksClicked": {
                      "type": "integer"
                    },
                    "mmsQueued": {
                      "type": "integer"
                    },
                    "mmsDequeued": {
                      "type": "integer"
                    },
                    "mmsSent": {
                      "type": "integer"
                    },
                    "mmsDelivered": {
                      "type": "integer"
                    },
                    "mmsFailed": {
                      "type": "integer"
                    },
                    "mmsInbound": {
                      "type": "integer"
                    },
                    "mmsOutboundSegments": {
                      "type": "integer"
                    },
                    "mmsInboundSegments": {
                      "type": "integer"
                    },
                    "mmsOptOuts": {
                      "type": "integer"
                    },
                    "mmsShortlinksSent": {
                      "type": "integer"
                    },
                    "mmsUniqueShortlinksClicked": {
                      "type": "integer"
                    },
                    "p2pQueued": {
                      "type": "integer"
                    },
                    "p2pDequeued": {
                      "type": "integer"
                    },
                    "p2pSent": {
                      "type": "integer"
                    },
                    "p2pDelivered": {
                      "type": "integer"
                    },
                    "p2pFailed": {
                      "type": "integer"
                    },
                    "p2pInbound": {
                      "type": "integer"
                    },
                    "p2pOutboundSegments": {
                      "type": "integer"
                    },
                    "p2pInboundSegments": {
                      "type": "integer"
                    },
                    "sentimentScore": {
                      "type": "integer"
                    },
                    "sentimentLabel": {
                      "type": "string"
                    },
                    "sentimentScoredCount": {
                      "type": "integer"
                    },
                    "sentimentPositive": {
                      "type": "integer"
                    },
                    "sentimentNeutral": {
                      "type": "integer"
                    },
                    "sentimentNegative": {
                      "type": "integer"
                    },
                    "smsSentimentScore": {
                      "type": "integer"
                    },
                    "smsSentimentLabel": {
                      "type": "string"
                    },
                    "smsSentimentScoredCount": {
                      "type": "integer"
                    },
                    "smsSentimentPositive": {
                      "type": "integer"
                    },
                    "smsSentimentNeutral": {
                      "type": "integer"
                    },
                    "smsSentimentNegative": {
                      "type": "integer"
                    },
                    "mmsSentimentScore": {
                      "type": "integer"
                    },
                    "mmsSentimentLabel": {
                      "type": "string"
                    },
                    "mmsSentimentScoredCount": {
                      "type": "integer"
                    },
                    "mmsSentimentPositive": {
                      "type": "integer"
                    },
                    "mmsSentimentNeutral": {
                      "type": "integer"
                    },
                    "mmsSentimentNegative": {
                      "type": "integer"
                    },
                    "p2pSentimentScore": {},
                    "p2pSentimentLabel": {},
                    "p2pSentimentScoredCount": {
                      "type": "integer"
                    },
                    "p2pSentimentPositive": {
                      "type": "integer"
                    },
                    "p2pSentimentNeutral": {
                      "type": "integer"
                    },
                    "p2pSentimentNegative": {
                      "type": "integer"
                    },
                    "healthScore": {
                      "type": "number"
                    },
                    "healthDeliveryRate": {
                      "type": "number"
                    },
                    "healthOptOutRate": {
                      "type": "number"
                    },
                    "healthDeliveryScore": {
                      "type": "integer"
                    },
                    "healthOptOutScore": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "smsQueued": 100,
                  "smsDequeued": 100,
                  "smsSent": 98,
                  "smsDelivered": 95,
                  "smsFailed": 3,
                  "smsInbound": 42,
                  "smsOutboundSegments": 105,
                  "smsInboundSegments": 42,
                  "smsOptOuts": 2,
                  "smsShortlinksSent": 98,
                  "smsUniqueShortlinksClicked": 12,
                  "mmsQueued": 25,
                  "mmsDequeued": 25,
                  "mmsSent": 24,
                  "mmsDelivered": 23,
                  "mmsFailed": 1,
                  "mmsInbound": 10,
                  "mmsOutboundSegments": 25,
                  "mmsInboundSegments": 10,
                  "mmsOptOuts": 0,
                  "mmsShortlinksSent": 0,
                  "mmsUniqueShortlinksClicked": 0,
                  "p2pQueued": 50,
                  "p2pDequeued": 50,
                  "p2pSent": 49,
                  "p2pDelivered": 48,
                  "p2pFailed": 1,
                  "p2pInbound": 0,
                  "p2pOutboundSegments": 50,
                  "p2pInboundSegments": 0,
                  "sentimentScore": 34,
                  "sentimentLabel": "positive",
                  "sentimentScoredCount": 42,
                  "sentimentPositive": 25,
                  "sentimentNeutral": 14,
                  "sentimentNegative": 3,
                  "smsSentimentScore": 30,
                  "smsSentimentLabel": "positive",
                  "smsSentimentScoredCount": 35,
                  "smsSentimentPositive": 20,
                  "smsSentimentNeutral": 12,
                  "smsSentimentNegative": 3,
                  "mmsSentimentScore": 62,
                  "mmsSentimentLabel": "positive",
                  "mmsSentimentScoredCount": 7,
                  "mmsSentimentPositive": 5,
                  "mmsSentimentNeutral": 2,
                  "mmsSentimentNegative": 0,
                  "p2pSentimentScore": null,
                  "p2pSentimentLabel": null,
                  "p2pSentimentScoredCount": 0,
                  "p2pSentimentPositive": 0,
                  "p2pSentimentNeutral": 0,
                  "p2pSentimentNegative": 0,
                  "healthScore": 9.5,
                  "healthDeliveryRate": 96.9,
                  "healthOptOutRate": 1.6,
                  "healthDeliveryScore": 10,
                  "healthOptOutScore": 9
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics/by-error-code": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve a paginated breakdown of failed messages grouped by error code.",
        "description": "Retrieve a paginated breakdown of failed messages grouped by error code. Each row contains per-channel (sms/mms/p2p) error counts plus an enriched description sourced from the local Infobip error code lookup. Failures with no `[NNN]` error code are grouped by cause into their own null-code rows: content-moderation blocks (errorCategory 'CONTENT_MODERATION'), AT&T per-minute-limit rejects ('CARRIER_RATE_LIMIT'), P2P-STOP opt-outs, campaign opt-outs and Do Not Contact blocks (all 'RECIPIENT_OPTED_OUT', each on its own row with its own description), and P2P messages never offered to the carrier because the SMPP bind stayed down past the hold window ('PROVIDER_UNAVAILABLE'); any remaining code-less failure buckets into the null-code landline/carrier-incapable row. Counts come from an hourly rollup refreshed every 10 minutes. Limit is capped server-side at 50 per page.",
        "operationId": "message.getAnalyticsByErrorCode",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrierFamily",
            "in": "query",
            "required": false,
            "description": "Filter by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, the Canada rails' families for Canadian handsets; Standard and IceWireless also appear on Canadian messages sent before those families). Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode. It is then floored to the start of its hour, because the counts come from an hourly rollup: a start of 18:30 includes failures from 18:00.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back. The hour containing the end bound is included whole, because the counts come from an hourly rollup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number. Defaults to 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows per page. Defaults to 50, capped at 50.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Scope rows + ranking by the stored channel column. Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode, p2p (single or comma/array), or \"both\" (default) for every code. When a specific channel is selected, totalErrors reflects that channel.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "errorCode",
            "in": "query",
            "required": false,
            "description": "Narrow the breakdown to a single failure reason: a numeric Infobip carrier code as a string (e.g. \"607\"), the Signal House campaign-opt-out code \"OUT\", or a no-code failure class (other, moderation, att_limit, p2p_stop, campaign_opt_out, dnc_blocked, bind_hold_expired). totalErrors still reflects every reason — it is the rate denominator, not the filtered count. An unrecognized value is a 400. Omitted: every reason.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "errorCode": {
                            "type": "integer"
                          },
                          "errorDescription": {
                            "type": "string"
                          },
                          "errorCategory": {
                            "type": "string"
                          },
                          "smsErrorCount": {
                            "type": "integer"
                          },
                          "mmsErrorCount": {
                            "type": "integer"
                          },
                          "p2pErrorCount": {
                            "type": "integer"
                          },
                          "totalErrorCount": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "totalErrors": {
                      "type": "object",
                      "properties": {
                        "sms": {
                          "type": "integer"
                        },
                        "mms": {
                          "type": "integer"
                        },
                        "p2p": {
                          "type": "integer"
                        },
                        "all": {
                          "type": "integer"
                        }
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "rows": [
                    {
                      "errorCode": 351,
                      "errorDescription": "The message was rejected by the carrier. The mobile number may be deactivated, unable to receive messages, or rejected for spam.",
                      "errorCategory": "DELIVERY_ERRORS",
                      "smsErrorCount": 80,
                      "mmsErrorCount": 10,
                      "p2pErrorCount": 0,
                      "totalErrorCount": 90
                    },
                    {
                      "errorCode": null,
                      "errorDescription": "Message sent to landline or carrier incapable of receiving text messages.",
                      "errorCategory": null,
                      "smsErrorCount": 5,
                      "mmsErrorCount": 0,
                      "p2pErrorCount": 0,
                      "totalErrorCount": 5
                    }
                  ],
                  "totalCount": 2,
                  "totalErrors": {
                    "sms": 85,
                    "mms": 10,
                    "p2p": 0,
                    "all": 95
                  },
                  "page": 1,
                  "limit": 50
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics/by-subgroup": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve a paginated breakdown of message metrics grouped by subgroup.",
        "description": "Retrieve a paginated breakdown of message metrics grouped by subgroup. Each row carries the full set of sms/mms/p2p metric columns plus sms/mms opt-out counts so callers can apply channel toggles client-side without refetching. Opt-outs are sourced from the DNC analytics MV and merged in by subgroupId. Each row also carries that subgroup's inbound-message sentiment — sentimentScore is the volume-weighted average of every scored inbound message in that subgroup (-100..100, null when nothing was scored), alongside its label, the scored count and the positive/neutral/negative counts, plus the same six per message type under smsSentiment*, mmsSentiment* and p2pSentiment* prefixes. Scores are derived server-side and must never be re-averaged across rows: combine the counts, not the scores. Limit is capped server-side at 50 per page.",
        "operationId": "message.getAnalyticsBySubgroup",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier. Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrierFamily",
            "in": "query",
            "required": false,
            "description": "Filter by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, the Canada rails' families for Canadian handsets; Standard and IceWireless also appear on Canadian messages sent before those families). Repeat for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number. Defaults to 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows per page. Defaults to 50, capped at 50.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Scope rows + ranking by the stored channel column. Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode, p2p (single or comma/array), or \"both\" (default) for all activity. Pagination's totalCount also reflects this scoping.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "required": false,
            "description": "Scopes the sentiment figures to SMS, MMS and/or P2P (single value, array, or comma-separated). Omit for all scored types. It does NOT narrow the message counts, which are always returned split per type.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subgroupId": {
                            "type": "string"
                          },
                          "subgroupName": {
                            "type": "string"
                          },
                          "smsQueued": {
                            "type": "integer"
                          },
                          "smsDequeued": {
                            "type": "integer"
                          },
                          "smsSent": {
                            "type": "integer"
                          },
                          "smsDelivered": {
                            "type": "integer"
                          },
                          "smsFailed": {
                            "type": "integer"
                          },
                          "smsInbound": {
                            "type": "integer"
                          },
                          "smsOutboundSegments": {
                            "type": "integer"
                          },
                          "smsInboundSegments": {
                            "type": "integer"
                          },
                          "smsOptOuts": {
                            "type": "integer"
                          },
                          "smsShortlinksSent": {
                            "type": "integer"
                          },
                          "mmsQueued": {
                            "type": "integer"
                          },
                          "mmsDequeued": {
                            "type": "integer"
                          },
                          "mmsSent": {
                            "type": "integer"
                          },
                          "mmsDelivered": {
                            "type": "integer"
                          },
                          "mmsFailed": {
                            "type": "integer"
                          },
                          "mmsInbound": {
                            "type": "integer"
                          },
                          "mmsOutboundSegments": {
                            "type": "integer"
                          },
                          "mmsInboundSegments": {
                            "type": "integer"
                          },
                          "mmsOptOuts": {
                            "type": "integer"
                          },
                          "mmsShortlinksSent": {
                            "type": "integer"
                          },
                          "p2pQueued": {
                            "type": "integer"
                          },
                          "p2pDequeued": {
                            "type": "integer"
                          },
                          "p2pSent": {
                            "type": "integer"
                          },
                          "p2pDelivered": {
                            "type": "integer"
                          },
                          "p2pFailed": {
                            "type": "integer"
                          },
                          "p2pInbound": {
                            "type": "integer"
                          },
                          "p2pOutboundSegments": {
                            "type": "integer"
                          },
                          "p2pInboundSegments": {
                            "type": "integer"
                          },
                          "sentimentScore": {
                            "type": "integer"
                          },
                          "sentimentLabel": {
                            "type": "string"
                          },
                          "sentimentScoredCount": {
                            "type": "integer"
                          },
                          "sentimentPositive": {
                            "type": "integer"
                          },
                          "sentimentNeutral": {
                            "type": "integer"
                          },
                          "sentimentNegative": {
                            "type": "integer"
                          },
                          "smsSentimentScore": {
                            "type": "integer"
                          },
                          "smsSentimentLabel": {
                            "type": "string"
                          },
                          "smsSentimentScoredCount": {
                            "type": "integer"
                          },
                          "...": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "rows": [
                    {
                      "subgroupId": "S1234567",
                      "subgroupName": "Coastal Dental Group",
                      "smsQueued": 0,
                      "smsDequeued": 0,
                      "smsSent": 4172,
                      "smsDelivered": 4126,
                      "smsFailed": 46,
                      "smsInbound": 88,
                      "smsOutboundSegments": 4218,
                      "smsInboundSegments": 88,
                      "smsOptOuts": 7,
                      "smsShortlinksSent": 1240,
                      "mmsQueued": 0,
                      "mmsDequeued": 0,
                      "mmsSent": 0,
                      "mmsDelivered": 0,
                      "mmsFailed": 0,
                      "mmsInbound": 0,
                      "mmsOutboundSegments": 0,
                      "mmsInboundSegments": 0,
                      "mmsOptOuts": 0,
                      "mmsShortlinksSent": 0,
                      "p2pQueued": 0,
                      "p2pDequeued": 0,
                      "p2pSent": 0,
                      "p2pDelivered": 0,
                      "p2pFailed": 0,
                      "p2pInbound": 0,
                      "p2pOutboundSegments": 0,
                      "p2pInboundSegments": 0,
                      "sentimentScore": 42,
                      "sentimentLabel": "positive",
                      "sentimentScoredCount": 120,
                      "sentimentPositive": 85,
                      "sentimentNeutral": 23,
                      "sentimentNegative": 12,
                      "smsSentimentScore": 40,
                      "smsSentimentLabel": "positive",
                      "smsSentimentScoredCount": 100,
                      "...": "mmsSentiment* and p2pSentiment* follow the same shape"
                    }
                  ],
                  "totalCount": 8,
                  "page": 1,
                  "limit": 50
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics/detail": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve aggregated analytics data for charting and widgets.",
        "description": "Retrieve aggregated analytics data for charting and widgets. Returns card totals plus data grouped by date, phone number (top 50 by volume, excluding P2P), and carrier (top 50 by volume, excluding P2P). cardTotals and every row also carry sentiment, already weighted server-side (sum score / scored count) for that row's scope, plus a per-message-type breakdown. A high-volume number/date/carrier always outweighs a low-volume one. These fields are always present on every row — sentimentScore and sentimentLabel are null (and the counts 0) when nothing in that row's scope has been scored. cardTotals and every row additionally carry the five derived health figures (healthScore, healthDeliveryRate, healthOptOutRate, healthDeliveryScore, healthOptOutScore — each row scored from its own counters, never assembled from sub-rows), and the optional byBreakdown series is available; elsewhere those fields are absent and breakdown is rejected.",
        "operationId": "message.getAnalyticsDetail",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageType",
            "in": "query",
            "required": false,
            "description": "Scopes the sentiment figures to SMS, MMS and/or P2P (single value, array, or comma-separated). Omit for all scored types. It does NOT narrow the message counts, which are always returned split per type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID. Repeat the parameter for multiple values (e.g. subgroupId=id1&subgroupId=id2).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID. Repeat the parameter for multiple values (e.g. brandId=BABC123&brandId=BDEF456).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID. Repeat the parameter for multiple values (e.g. campaignId=CABC123&campaignId=CDEF456).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number. Repeat the parameter for multiple values (e.g. phoneNumber=12025551234&phoneNumber=12025555678).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier. Repeat the parameter for multiple values (e.g. carrier=att&carrier=verizon).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrierFamily",
            "in": "query",
            "required": false,
            "description": "Filter by the recipient's resolved carrier family (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, P2P, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, the Canada rails' families for Canadian handsets; Standard and IceWireless also appear on Canadian messages sent before those families). Repeat the parameter or pass a comma-separated list for multiple values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written, in 'exact' mode. At either granularity it is then floored to the start of its hour, because the hourly cube is keyed by hour and a mid-hour start would drop that hour's bucket.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. At day granularity, bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written, in 'exact' mode. In 'exact' mode day buckets align to the UTC offset this bound carries, so a client that sends its own midnights gets its own calendar dates back — the full end day is included. At hour granularity, honoured as given.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Time-bucket grain of the byDate rows: day or hour. Omit for day (each byDate row's _id is a YYYY-MM-DD date). hour buckets by hour (each _id is a YYYY-MM-DD HH:MM:SS UTC hour) and is capped to a 7-day span.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "breakdown",
            "in": "query",
            "required": false,
            "description": "carrier or carrierFamily. Adds a byBreakdown time × dimension series to the response: { dimension, rows }, where each row is one byDate bucket (_id, at the requested granularity) for one carrier or carrier family (key) and carries the same counters, sentiment and health fields as a byDate row. Covers the top 50 keys by volume, excluding P2P, and caps the span at 31 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Filter by messaging channel. Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode, p2p (single or comma/array). Filtered on the stored channel column; tenDLC folds the legacy channel-absent bucket in, and p2p is a first-class channel.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cardTotals": {
                      "type": "object",
                      "properties": {
                        "smsQueued": {
                          "type": "integer"
                        },
                        "smsDequeued": {
                          "type": "integer"
                        },
                        "smsSent": {
                          "type": "integer"
                        },
                        "smsDelivered": {
                          "type": "integer"
                        },
                        "smsFailed": {
                          "type": "integer"
                        },
                        "smsInbound": {
                          "type": "integer"
                        },
                        "smsOutboundSegments": {
                          "type": "integer"
                        },
                        "smsInboundSegments": {
                          "type": "integer"
                        },
                        "smsOptOuts": {
                          "type": "integer"
                        },
                        "smsShortlinksSent": {
                          "type": "integer"
                        },
                        "smsUniqueShortlinksClicked": {
                          "type": "integer"
                        },
                        "mmsQueued": {
                          "type": "integer"
                        },
                        "mmsDequeued": {
                          "type": "integer"
                        },
                        "mmsSent": {
                          "type": "integer"
                        },
                        "mmsDelivered": {
                          "type": "integer"
                        },
                        "mmsFailed": {
                          "type": "integer"
                        },
                        "mmsInbound": {
                          "type": "integer"
                        },
                        "mmsOutboundSegments": {
                          "type": "integer"
                        },
                        "mmsInboundSegments": {
                          "type": "integer"
                        },
                        "mmsOptOuts": {
                          "type": "integer"
                        },
                        "mmsShortlinksSent": {
                          "type": "integer"
                        },
                        "mmsUniqueShortlinksClicked": {
                          "type": "integer"
                        },
                        "p2pQueued": {
                          "type": "integer"
                        },
                        "p2pDequeued": {
                          "type": "integer"
                        },
                        "p2pSent": {
                          "type": "integer"
                        },
                        "p2pDelivered": {
                          "type": "integer"
                        },
                        "p2pFailed": {
                          "type": "integer"
                        },
                        "p2pInbound": {
                          "type": "integer"
                        },
                        "p2pOutboundSegments": {
                          "type": "integer"
                        },
                        "p2pInboundSegments": {
                          "type": "integer"
                        },
                        "sentimentScore": {
                          "type": "integer"
                        },
                        "sentimentLabel": {
                          "type": "string"
                        },
                        "sentimentScoredCount": {
                          "type": "integer"
                        },
                        "sentimentPositive": {
                          "type": "integer"
                        },
                        "sentimentNeutral": {
                          "type": "integer"
                        },
                        "sentimentNegative": {
                          "type": "integer"
                        },
                        "smsSentimentScore": {
                          "type": "integer"
                        },
                        "smsSentimentLabel": {
                          "type": "string"
                        },
                        "smsSentimentScoredCount": {
                          "type": "integer"
                        },
                        "smsSentimentPositive": {
                          "type": "integer"
                        },
                        "smsSentimentNeutral": {
                          "type": "integer"
                        },
                        "smsSentimentNegative": {
                          "type": "integer"
                        },
                        "mmsSentimentScore": {
                          "type": "integer"
                        },
                        "mmsSentimentLabel": {
                          "type": "string"
                        },
                        "mmsSentimentScoredCount": {
                          "type": "integer"
                        },
                        "mmsSentimentPositive": {
                          "type": "integer"
                        },
                        "mmsSentimentNeutral": {
                          "type": "integer"
                        },
                        "mmsSentimentNegative": {
                          "type": "integer"
                        },
                        "p2pSentimentScore": {},
                        "p2pSentimentLabel": {},
                        "p2pSentimentScoredCount": {
                          "type": "integer"
                        },
                        "p2pSentimentPositive": {
                          "type": "integer"
                        },
                        "p2pSentimentNeutral": {
                          "type": "integer"
                        },
                        "p2pSentimentNegative": {
                          "type": "integer"
                        },
                        "healthScore": {
                          "type": "integer"
                        },
                        "healthDeliveryRate": {
                          "type": "integer"
                        },
                        "healthOptOutRate": {
                          "type": "number"
                        },
                        "healthDeliveryScore": {
                          "type": "integer"
                        },
                        "healthOptOutScore": {
                          "type": "integer"
                        }
                      }
                    },
                    "byDate": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "smsDelivered": {
                            "type": "integer"
                          },
                          "smsSent": {
                            "type": "integer"
                          },
                          "smsFailed": {
                            "type": "integer"
                          },
                          "smsInbound": {
                            "type": "integer"
                          },
                          "p2pSent": {
                            "type": "integer"
                          },
                          "p2pDelivered": {
                            "type": "integer"
                          },
                          "sentimentScore": {
                            "type": "integer"
                          },
                          "sentimentLabel": {
                            "type": "string"
                          },
                          "sentimentScoredCount": {
                            "type": "integer"
                          },
                          "...": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "byPhoneNumber": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "smsDelivered": {
                            "type": "integer"
                          },
                          "smsSent": {
                            "type": "integer"
                          },
                          "smsFailed": {
                            "type": "integer"
                          },
                          "smsInbound": {
                            "type": "integer"
                          },
                          "sentimentScore": {
                            "type": "integer"
                          },
                          "sentimentLabel": {
                            "type": "string"
                          },
                          "sentimentScoredCount": {
                            "type": "integer"
                          },
                          "...": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "byCarrier": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "smsDelivered": {
                            "type": "integer"
                          },
                          "smsSent": {
                            "type": "integer"
                          },
                          "smsFailed": {
                            "type": "integer"
                          },
                          "smsInbound": {
                            "type": "integer"
                          },
                          "sentimentScore": {
                            "type": "integer"
                          },
                          "sentimentLabel": {
                            "type": "string"
                          },
                          "sentimentScoredCount": {
                            "type": "integer"
                          },
                          "...": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "byBreakdown": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "key": {
                                "type": "string"
                              },
                              "smsDelivered": {
                                "type": "integer"
                              },
                              "smsSent": {
                                "type": "integer"
                              },
                              "smsFailed": {
                                "type": "integer"
                              },
                              "sentimentScore": {
                                "type": "integer"
                              },
                              "healthScore": {
                                "type": "integer"
                              },
                              "...": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "cardTotals": {
                    "smsQueued": 500,
                    "smsDequeued": 500,
                    "smsSent": 480,
                    "smsDelivered": 450,
                    "smsFailed": 20,
                    "smsInbound": 200,
                    "smsOutboundSegments": 550,
                    "smsInboundSegments": 200,
                    "smsOptOuts": 10,
                    "smsShortlinksSent": 480,
                    "smsUniqueShortlinksClicked": 50,
                    "mmsQueued": 100,
                    "mmsDequeued": 100,
                    "mmsSent": 90,
                    "mmsDelivered": 80,
                    "mmsFailed": 10,
                    "mmsInbound": 30,
                    "mmsOutboundSegments": 200,
                    "mmsInboundSegments": 60,
                    "mmsOptOuts": 2,
                    "mmsShortlinksSent": 0,
                    "mmsUniqueShortlinksClicked": 0,
                    "p2pQueued": 200,
                    "p2pDequeued": 200,
                    "p2pSent": 198,
                    "p2pDelivered": 195,
                    "p2pFailed": 3,
                    "p2pInbound": 5,
                    "p2pOutboundSegments": 200,
                    "p2pInboundSegments": 5,
                    "sentimentScore": 18,
                    "sentimentLabel": "neutral",
                    "sentimentScoredCount": 160,
                    "sentimentPositive": 70,
                    "sentimentNeutral": 80,
                    "sentimentNegative": 10,
                    "smsSentimentScore": 15,
                    "smsSentimentLabel": "neutral",
                    "smsSentimentScoredCount": 140,
                    "smsSentimentPositive": 60,
                    "smsSentimentNeutral": 70,
                    "smsSentimentNegative": 10,
                    "mmsSentimentScore": 39,
                    "mmsSentimentLabel": "positive",
                    "mmsSentimentScoredCount": 20,
                    "mmsSentimentPositive": 10,
                    "mmsSentimentNeutral": 10,
                    "mmsSentimentNegative": 0,
                    "p2pSentimentScore": null,
                    "p2pSentimentLabel": null,
                    "p2pSentimentScoredCount": 0,
                    "p2pSentimentPositive": 0,
                    "p2pSentimentNeutral": 0,
                    "p2pSentimentNegative": 0,
                    "healthScore": 9,
                    "healthDeliveryRate": 93,
                    "healthOptOutRate": 2.1,
                    "healthDeliveryScore": 10,
                    "healthOptOutScore": 8
                  },
                  "byDate": [
                    {
                      "_id": "2024-01-15T00:00:00.000Z",
                      "smsDelivered": 45,
                      "smsSent": 48,
                      "smsFailed": 2,
                      "smsInbound": 20,
                      "p2pSent": 30,
                      "p2pDelivered": 28,
                      "sentimentScore": 22,
                      "sentimentLabel": "neutral",
                      "sentimentScoredCount": 70,
                      "...": "..."
                    },
                    {
                      "_id": "2024-01-16T00:00:00.000Z",
                      "smsDelivered": 50,
                      "smsSent": 52,
                      "smsFailed": 1,
                      "smsInbound": 18,
                      "p2pSent": 35,
                      "p2pDelivered": 34,
                      "sentimentScore": 15,
                      "sentimentLabel": "neutral",
                      "sentimentScoredCount": 90,
                      "...": "..."
                    }
                  ],
                  "byPhoneNumber": [
                    {
                      "_id": "12025551234",
                      "smsDelivered": 200,
                      "smsSent": 210,
                      "smsFailed": 8,
                      "smsInbound": 90,
                      "sentimentScore": 28,
                      "sentimentLabel": "positive",
                      "sentimentScoredCount": 55,
                      "...": "..."
                    }
                  ],
                  "byCarrier": [
                    {
                      "_id": "T-Mobile",
                      "smsDelivered": 300,
                      "smsSent": 320,
                      "smsFailed": 12,
                      "smsInbound": 150,
                      "sentimentScore": 12,
                      "sentimentLabel": "neutral",
                      "sentimentScoredCount": 95,
                      "...": "..."
                    }
                  ],
                  "byBreakdown": {
                    "dimension": "carrierFamily",
                    "rows": [
                      {
                        "_id": "2024-01-15",
                        "key": "TMobile",
                        "smsDelivered": 140,
                        "smsSent": 150,
                        "smsFailed": 6,
                        "sentimentScore": 10,
                        "healthScore": 9,
                        "...": "..."
                      },
                      {
                        "_id": "2024-01-15",
                        "key": "Verizon",
                        "smsDelivered": 120,
                        "smsSent": 124,
                        "smsFailed": 2,
                        "sentimentScore": 18,
                        "healthScore": 9.5,
                        "...": "..."
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics/filter-options": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve dropdown filter options (subgroups, brands, campaigns, phone numbers, carriers) for the Analytics page, scoped to a single group.",
        "description": "Retrieve dropdown filter options (subgroups, brands, campaigns, phone numbers, carriers) for the Analytics page, scoped to a single group. Sourced entirely from ClickHouse — each list returns only items that have at least one message in the group's history. Useful for analytics-style UIs where the filter list should reflect data the customer actually has. Each phone number carries its type (TOLL_FREE, SHORT_CODE, ALPHANUMERIC, VIRTUAL_LONG_NUMBER, and older local-number spellings) and country (ISO-2); both are null when unknown. Group numbers by channel with both: TOLL_FREE, SHORT_CODE and ALPHANUMERIC are channels by type, while a US number of any other type is 10DLC and a non-US one is a Virtual Long Code. carriers is a plain array of carrier name strings.",
        "operationId": "message.getAnalyticsFilterOptions",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID whose filter options to load.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subgroups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subgroupId": {
                            "type": "string"
                          },
                          "subgroupName": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "brands": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "brandId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "campaigns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "campaignId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "brandId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subgroupId": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "phoneNumbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "campaignId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "brandId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "country": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "carriers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "subgroups": [
                    {
                      "subgroupId": "SG123456",
                      "subgroupName": "Marketing"
                    }
                  ],
                  "brands": [
                    {
                      "brandId": "BABC1234",
                      "displayName": "Acme Corp",
                      "subgroupId": "SG123456"
                    }
                  ],
                  "campaigns": [
                    {
                      "campaignId": "CABC1234",
                      "brandId": "BABC1234",
                      "subgroupId": "SG123456"
                    }
                  ],
                  "phoneNumbers": [
                    {
                      "phoneNumber": "12025551234",
                      "campaignId": "CABC1234",
                      "brandId": "BABC1234",
                      "subgroupId": "SG123456",
                      "type": "VIRTUAL_LONG_NUMBER",
                      "country": "US"
                    },
                    {
                      "phoneNumber": "447860059129",
                      "campaignId": null,
                      "brandId": null,
                      "subgroupId": "SG123456",
                      "type": "VIRTUAL_LONG_NUMBER",
                      "country": "GB"
                    }
                  ],
                  "carriers": [
                    "AT&T",
                    "T-Mobile",
                    "Verizon"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/analytics/throughput": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Per-minute send throughput for a campaign, brand, or group: peak segments and messages per minute, sending minutes (minutes with at least one SENT), the average over those minutes, and — when a ceiling is given — minutes at or above it; as totals, per time bucket (byDate), per carrier family (byCarrierFamily), and per bucket × carrier family (byBreakdown).",
        "description": "Per-minute send throughput for a campaign, brand, or group: peak segments and messages per minute, sending minutes (minutes with at least one SENT), the average over those minutes, and — when a ceiling is given — minutes at or above it; as totals, per time bucket (byDate), per carrier family (byCarrierFamily), and per bucket × carrier family (byBreakdown). Measured from SENT transitions at campaign × carrier-family grain, the grain carrier ceilings are enforced at, so a peak here is the figure a ceiling is compared against. The per-minute data is retained for 35 days. A failed sub-query renders as an empty series rather than failing the request.",
        "operationId": "message.getAnalyticsThroughput",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID to scope the read to.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Brand scope. Accepts a single value, a repeated key, or a comma-separated list; ignored when campaignId is given. A single ID is verified to exist — an unknown ID returns the empty shape.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Campaign scope; wins over brandId. Accepts a single value, a repeated key, or a comma-separated list. A single ID is verified to exist — an unknown ID returns the empty shape.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Throughput attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Cannot be combined with campaignId (400). An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrierFamily",
            "in": "query",
            "required": false,
            "description": "Carrier-family filter (ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile, Bell, Rogers, Telus, Videotron, SaskTel, Eastlink, Fibernetics, the Canada rails' families for Canadian handsets; Standard and IceWireless also appear on Canadian messages sent before those families). Accepts a single value, a repeated key, or a comma-separated list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. It is bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written, in 'exact' mode, then floored to the start of its hour at either granularity (the hourly cube is keyed by hour).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. At hour granularity, honoured as given; at day granularity, bound per dateBounds: a bare date is always that whole UTC day (inclusive); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written, in 'exact' mode. In 'exact' mode day buckets align to the UTC offset this bound carries, so a client that sends its own midnights gets its own calendar dates back. The span is capped at 35 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Bucket grain of the byDate and byBreakdown rows: hour (default; each _id is a YYYY-MM-DD HH:MM:SS UTC hour; span capped at 7 days) or day (each _id is a YYYY-MM-DD date).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ceiling",
            "in": "query",
            "required": false,
            "description": "Positive integer, segments per minute. When given, every row also reports minutesAtCeiling (sending minutes at or above it); otherwise minutesAtCeiling is null. A ceiling belongs to one carrier, so read it against a carrierFamily filter or the matching byCarrierFamily row. The enforced ceilings come from GET /campaign/throughput-limits.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totals": {
                      "type": "object",
                      "properties": {
                        "segments": {
                          "type": "integer"
                        },
                        "messages": {
                          "type": "integer"
                        },
                        "peakSegmentsPerMinute": {
                          "type": "integer"
                        },
                        "peakMessagesPerMinute": {
                          "type": "integer"
                        },
                        "peakMinute": {
                          "type": "string"
                        },
                        "sendingMinutes": {
                          "type": "integer"
                        },
                        "averageSegmentsPerSendingMinute": {
                          "type": "number"
                        },
                        "minutesAtCeiling": {
                          "type": "integer"
                        }
                      }
                    },
                    "byDate": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "segments": {
                            "type": "integer"
                          },
                          "messages": {
                            "type": "integer"
                          },
                          "peakSegmentsPerMinute": {
                            "type": "integer"
                          },
                          "peakMessagesPerMinute": {
                            "type": "integer"
                          },
                          "peakMinute": {
                            "type": "string"
                          },
                          "sendingMinutes": {
                            "type": "integer"
                          },
                          "averageSegmentsPerSendingMinute": {
                            "type": "integer"
                          },
                          "minutesAtCeiling": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byCarrierFamily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "segments": {
                            "type": "integer"
                          },
                          "messages": {
                            "type": "integer"
                          },
                          "peakSegmentsPerMinute": {
                            "type": "integer"
                          },
                          "peakMessagesPerMinute": {
                            "type": "integer"
                          },
                          "peakMinute": {
                            "type": "string"
                          },
                          "sendingMinutes": {
                            "type": "integer"
                          },
                          "averageSegmentsPerSendingMinute": {
                            "type": "integer"
                          },
                          "minutesAtCeiling": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byBreakdown": {
                      "type": "object",
                      "properties": {
                        "dimension": {
                          "type": "string"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "key": {
                                "type": "string"
                              },
                              "segments": {
                                "type": "integer"
                              },
                              "messages": {
                                "type": "integer"
                              },
                              "peakSegmentsPerMinute": {
                                "type": "integer"
                              },
                              "peakMessagesPerMinute": {
                                "type": "integer"
                              },
                              "peakMinute": {
                                "type": "string"
                              },
                              "sendingMinutes": {
                                "type": "integer"
                              },
                              "averageSegmentsPerSendingMinute": {
                                "type": "number"
                              },
                              "minutesAtCeiling": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "totals": {
                    "segments": 41280,
                    "messages": 34690,
                    "peakSegmentsPerMinute": 2310,
                    "peakMessagesPerMinute": 1941,
                    "peakMinute": "2026-09-10 14:07:00",
                    "sendingMinutes": 46,
                    "averageSegmentsPerSendingMinute": 897.39,
                    "minutesAtCeiling": 3
                  },
                  "byDate": [
                    {
                      "_id": "2026-09-10 14:00:00",
                      "segments": 9840,
                      "messages": 8268,
                      "peakSegmentsPerMinute": 2310,
                      "peakMessagesPerMinute": 1941,
                      "peakMinute": "2026-09-10 14:07:00",
                      "sendingMinutes": 12,
                      "averageSegmentsPerSendingMinute": 820,
                      "minutesAtCeiling": 3
                    }
                  ],
                  "byCarrierFamily": [
                    {
                      "_id": "ATT",
                      "segments": 14030,
                      "messages": 11790,
                      "peakSegmentsPerMinute": 2160,
                      "peakMessagesPerMinute": 1815,
                      "peakMinute": "2026-09-10 14:07:00",
                      "sendingMinutes": 46,
                      "averageSegmentsPerSendingMinute": 305,
                      "minutesAtCeiling": 3
                    },
                    {
                      "_id": "TMobile",
                      "segments": 12360,
                      "messages": 10390,
                      "peakSegmentsPerMinute": 2940,
                      "peakMessagesPerMinute": 2471,
                      "peakMinute": "2026-09-10 14:05:00",
                      "sendingMinutes": 31,
                      "averageSegmentsPerSendingMinute": 398.71,
                      "minutesAtCeiling": 0
                    }
                  ],
                  "byBreakdown": {
                    "dimension": "carrierFamily",
                    "rows": [
                      {
                        "_id": "2026-09-10 14:00:00",
                        "key": "ATT",
                        "segments": 3340,
                        "messages": 2807,
                        "peakSegmentsPerMinute": 2160,
                        "peakMessagesPerMinute": 1815,
                        "peakMinute": "2026-09-10 14:07:00",
                        "sendingMinutes": 12,
                        "averageSegmentsPerSendingMinute": 278.33,
                        "minutesAtCeiling": 3
                      },
                      {
                        "_id": "2026-09-10 14:00:00",
                        "key": "TMobile",
                        "segments": 2950,
                        "messages": 2479,
                        "peakSegmentsPerMinute": 2940,
                        "peakMessagesPerMinute": 2471,
                        "peakMinute": "2026-09-10 14:05:00",
                        "sendingMinutes": 8,
                        "averageSegmentsPerSendingMinute": 368.75,
                        "minutesAtCeiling": 0
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/carrier-id": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Look up the carrier for a phone number.",
        "description": "Look up the carrier for a phone number. Always performs a fresh lookup (not cached). Billed per request. An Australian number on ACMA's list of numbers reserved for TV, film and creative works is refused with a 400 as an invalid number, without a lookup or a charge. Other countries' fiction ranges are looked up and billed as usual.",
        "operationId": "message.lookupCarrierId",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CarrierIdLookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumber": {
                      "type": "string"
                    },
                    "carrier": {
                      "type": "string"
                    },
                    "carrierFamily": {
                      "type": "string"
                    },
                    "carrierRegion": {},
                    "ported": {
                      "type": "boolean"
                    },
                    "type": {
                      "type": "string"
                    },
                    "degradedConfidence": {
                      "type": "boolean"
                    },
                    "cost": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "phoneNumber": "14175551234",
                  "carrier": "T-Mobile US",
                  "carrierFamily": "TMobile",
                  "carrierRegion": null,
                  "ported": false,
                  "type": "MOBILE",
                  "degradedConfidence": false,
                  "cost": 3000
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/delivery-report": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Fetch the latest upstream carrier delivery report for an array of message IDs.",
        "description": "Fetch the latest upstream carrier delivery report for an array of message IDs. Useful for reconciling messages stuck in a non-terminal state (e.g. still SENT). Outbound SMS and MMS messages sent from numbers on the carrier whose delivery logs we read are looked up there (retained for ~48 hours); every other message, including P2P messages and messages sent from numbers on other carriers, returns its stored status with upstreamReportAvailable=false. The request fails with a 500 when the sending numbers can't be read. This is a read-only lookup and does not change message state.",
        "operationId": "message.fetchDeliveryReports",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchDeliveryReportsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "messageId": {
                        "type": "string"
                      },
                      "messageType": {
                        "type": "string"
                      },
                      "storedStatus": {
                        "type": "string"
                      },
                      "upstreamStatus": {
                        "type": "string"
                      },
                      "upstreamReportAvailable": {
                        "type": "boolean"
                      },
                      "carrier": {
                        "type": "string"
                      },
                      "mccMnc": {
                        "type": "string"
                      },
                      "successOrFailureReason": {
                        "type": "string"
                      },
                      "sentAt": {
                        "type": "string"
                      },
                      "doneAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "messageId": "60f7b2a1c9e77c001a2b3c58",
                    "messageType": "SMS",
                    "storedStatus": "SENT",
                    "upstreamStatus": "DELIVERED",
                    "upstreamReportAvailable": true,
                    "carrier": "T-Mobile",
                    "mccMnc": "310260",
                    "successOrFailureReason": "Delivered to handset",
                    "sentAt": "2024-01-15T14:30:02.000Z",
                    "doneAt": "2024-01-15T14:30:05.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/dnc": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve paginated Do Not Contact (opt-out) records.",
        "description": "Retrieve paginated Do Not Contact (opt-out) records. Sourced from the ClickHouse CDC mirror of the donotcontacts collection — eventually consistent with the write path (typically seconds of CDC lag). Each record carries senderPhoneNumber, the first business number that received the opt-out (set once and never changed by a later STOP or a campaign move; the same value as phoneNumber), campaignId (null on subgroup-scoped records, which are how non-US recipients opt out; an RCS opt-out holds the agent ID here), optOutKeyword, the normalized keyword that revoked consent (e.g. 'stop', 'opt out'; a repeat opt-out records the most recent word) — null for opt-outs recorded before keyword capture shipped, since history is not reconstructed — and carrierFamily, the resolved carrier family of the recipient number (Default, ATT, TMobile, Verizon, USCellular, GoogleVoice, ClearSky, Interop, RogueMobile), copied from the inbound message that triggered the opt-out.",
        "operationId": "message.getDncRecords",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by business phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Records per page, max 100 (default: 100).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortField",
            "in": "query",
            "required": false,
            "description": "Field to sort by: createdAt, recipientPhoneNumber, phoneNumber, carrier, messageType (default: createdAt).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "Sort direction: asc or desc (default: desc).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Filter by messaging channel. Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode (single or comma/array). DNC is A2P-only — p2p resolves to no scope. Filtered on the stored channel column; tenDLC folds the legacy channel-absent bucket in.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "required": false,
            "description": "true returns { data, total, page, limit, totalPages, totalExact, partial, countError } instead of the array, where data is the page. total is the number of records (counted in a separate read, so totalExact is false; keep paging while a page is full) the filters match, counted from the same source as the page. It is null, never 0, with countError COUNT_UNAVAILABLE when the count could not run; data is still returned. Omitted or false: the bare array, unchanged.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "recipientPhoneNumber": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "campaignId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "phoneNumber": {
                        "type": "string"
                      },
                      "senderPhoneNumber": {
                        "type": "string"
                      },
                      "carrier": {
                        "type": "string"
                      },
                      "carrierFamily": {
                        "type": "string",
                        "enum": [
                          "Default",
                          "ATT",
                          "TMobile",
                          "Verizon",
                          "USCellular",
                          "GoogleVoice",
                          "ClearSky",
                          "Interop",
                          "RogueMobile",
                          "P2P",
                          "Standard",
                          "IceWireless",
                          "Bell",
                          "Rogers",
                          "Telus",
                          "Videotron",
                          "SaskTel",
                          "Eastlink",
                          "Fibernetics",
                          "EE",
                          "O2",
                          "Vodafone",
                          "Sky",
                          "Lycamobile",
                          "Three"
                        ]
                      },
                      "messageType": {
                        "type": "string",
                        "enum": [
                          "SMS",
                          "MMS",
                          "RCS",
                          "WHATSAPP",
                          "VIBER",
                          "P2P"
                        ]
                      },
                      "optOutKeyword": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5b",
                    "recipientPhoneNumber": "12174129840",
                    "groupId": "G1234567",
                    "subgroupId": "SG123456",
                    "brandId": "B1234567",
                    "campaignId": "C1234567",
                    "phoneNumber": "14173738106",
                    "senderPhoneNumber": "14173738106",
                    "carrier": "Verizon Wireless",
                    "carrierFamily": "Verizon",
                    "messageType": "SMS",
                    "optOutKeyword": "stop",
                    "createdAt": "2024-01-15T14:30:00.000Z",
                    "updatedAt": "2024-01-15T14:30:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/dnc/analytics": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retrieve aggregated Do Not Contact (DNC) opt-out analytics: totals, byDate, byPhoneNumber, bySenderNumber, byCampaign, bySubgroup, byType, byCarrier and byKeyword.",
        "description": "Retrieve aggregated Do Not Contact (DNC) opt-out analytics: totals, byDate, byPhoneNumber, bySenderNumber, byCampaign, bySubgroup, byType, byCarrier and byKeyword. bySenderNumber attributes each opt-out to the first business number that received it, so a number's count is unchanged by later campaign moves and START replies. byCampaign counts campaign-scoped opt-outs only, by the campaign at the time of the STOP; subgroup-scoped opt-outs (non-US recipients) are never attributed to a campaign and appear under bySubgroup instead. byType splits SMS/MMS. Includes a byKeyword breakdown of opt-outs by the normalized keyword that revoked consent. Opt-outs recorded before keyword capture shipped appear as a single optOutKeyword: null bucket ('not recorded'), so byKeyword totals reconcile with totals.total. The distinct keyword set is open-ended (campaigns can register their own opt-out keywords beyond the mandatory floor) — render top-N plus Other, never a fixed list.",
        "operationId": "message.getDncAnalytics",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Filter to traffic attributed to these registrations. Accepts a single value, a repeated key, or a comma-separated list. Hourly analytics only (a 400 in environments without it). Cannot be combined with campaignId (400); a phoneNumber filter takes precedence. An unknown registration is a 404 and one outside the group a 403.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "ISO-2 country of the message's sending number: US, GB or CA (UK is accepted for GB). One value, repeated, or comma-separated. Omitted = every region. Legacy records with no region count as US.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "regionScopes",
            "in": "query",
            "required": false,
            "description": "JSON-encoded array of OR-ed branches { region, channels, brandId?, campaignId?, phoneNumber? }, channels among tenDLC, virtualLongCode, tollFree, shortCode, p2p; entity arrays apply within their branch; [] matches nothing.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full start day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names, in whatever offset it was written ('2026-09-14T00:00:00-04:00' is 04:00Z), in 'exact' mode.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "description": "ISO-8601 date or timestamp. Bound per dateBounds: a bare date is always that whole UTC day (the full end day is included); a timestamp is widened to its whole UTC day in 'day' mode and bound as the instant it names in 'exact' mode, where any byDate buckets also align to the UTC offset this bound carries so a client that sends its own midnights gets its own calendar dates back.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateBounds",
            "in": "query",
            "required": false,
            "description": "Which contract binds startDate and endDate. day: each bound is widened to its whole UTC day and day buckets are UTC dates. exact: a timestamp is bound as the instant it names, a bare date is its whole UTC day, and day buckets align to the UTC offset the end bound carries. Omitted: day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Filter by messaging channel. Allowed values: tenDLC, virtualLongCode, alphanumeric, tollFree, shortCode (single or comma/array). DNC is A2P-only — p2p resolves to no scope. Filtered on the stored channel column; tenDLC folds the legacy channel-absent bucket in.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totals": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "sms": {
                          "type": "integer"
                        },
                        "mms": {
                          "type": "integer"
                        }
                      }
                    },
                    "byDate": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byPhoneNumber": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "bySenderNumber": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "senderPhoneNumber": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byCampaign": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "campaignId": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "bySubgroup": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "subgroupId": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byType": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "messageType": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byCarrier": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "carrier": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byKeyword": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "optOutKeyword": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "sms": {
                            "type": "integer"
                          },
                          "mms": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "totals": {
                    "total": 5,
                    "sms": 3,
                    "mms": 2
                  },
                  "byDate": [
                    {
                      "date": "2024-01-15",
                      "total": 3,
                      "sms": 2,
                      "mms": 1
                    },
                    {
                      "date": "2024-01-16",
                      "total": 2,
                      "sms": 1,
                      "mms": 1
                    }
                  ],
                  "byPhoneNumber": [
                    {
                      "phoneNumber": "12025551234",
                      "total": 3,
                      "sms": 2,
                      "mms": 1
                    },
                    {
                      "phoneNumber": "18435559876",
                      "total": 2,
                      "sms": 1,
                      "mms": 1
                    }
                  ],
                  "bySenderNumber": [
                    {
                      "senderPhoneNumber": "12025551234",
                      "total": 3,
                      "sms": 2,
                      "mms": 1
                    },
                    {
                      "senderPhoneNumber": "18435559876",
                      "total": 2,
                      "sms": 1,
                      "mms": 1
                    }
                  ],
                  "byCampaign": [
                    {
                      "campaignId": "C1234567",
                      "total": 4,
                      "sms": 3,
                      "mms": 1
                    }
                  ],
                  "bySubgroup": [
                    {
                      "subgroupId": "SG123456",
                      "total": 5,
                      "sms": 3,
                      "mms": 2
                    }
                  ],
                  "byType": [
                    {
                      "messageType": "SMS",
                      "total": 3
                    },
                    {
                      "messageType": "MMS",
                      "total": 2
                    }
                  ],
                  "byCarrier": [
                    {
                      "carrier": "T-Mobile",
                      "total": 3,
                      "sms": 2,
                      "mms": 1
                    },
                    {
                      "carrier": "AT&T",
                      "total": 2,
                      "sms": 1,
                      "mms": 1
                    }
                  ],
                  "byKeyword": [
                    {
                      "optOutKeyword": "stop",
                      "total": 3,
                      "sms": 2,
                      "mms": 1
                    },
                    {
                      "optOutKeyword": "unsubscribe",
                      "total": 1,
                      "sms": 1,
                      "mms": 0
                    },
                    {
                      "optOutKeyword": null,
                      "total": 1,
                      "sms": 0,
                      "mms": 1
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/dnc/consent-records": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Export the group's consent ledger, newest first: one append-only record for each opt-out or opt-in a recipient gave, from a STOP or START keyword (SMS, MMS or RCS) or the confirmation of an opt-out link.",
        "description": "Export the group's consent ledger, newest first: one append-only record for each opt-out or opt-in a recipient gave, from a STOP or START keyword (SMS, MMS or RCS) or the confirmation of an opt-out link. The ledger only records; sends are suppressed by the opt-out list, never by the ledger. Each record carries the handset (recipientPhoneNumber), the business number or RCS agent ID that received the instruction (phoneNumber), the scope it was written at (scope.type CAMPAIGN, AGENT or SUBGROUP, and scope.id, the campaign ID, agent ID or subgroup ID), clearedScopes (for an OPT_IN, every { type, id } the START cleared, which includes the subgroup; empty for an OPT_OUT), action (OPT_OUT or OPT_IN), source (KEYWORD or LINK), the normalized keyword ('LINK' for a link), messageType, messageId (the inbound message ID; for a link, the opt-out link's ID), actor.type RECIPIENT, and occurredAt, when the recipient gave the instruction. A redelivered inbound message adds no second record. Records start when RCS became available; earlier opt-outs are on GET /message/dnc only.",
        "operationId": "dnc.readConsentRecords",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "The Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recipientPhoneNumber",
            "in": "query",
            "required": false,
            "description": "One handset, in any spelling (+1 512 555 0100 and 15125550100 match the same records).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp; the earliest occurredAt. A bare date is the start of that UTC day; a timestamp is bound as sent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": false,
            "description": "ISO-8601 date or timestamp; the latest occurredAt. A bare date includes that whole UTC day; a timestamp is bound as sent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Records per page, max 500 (default: 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "groupId": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "recipientPhoneNumber": {
                            "type": "string"
                          },
                          "phoneNumber": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scope": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "CAMPAIGN",
                                  "AGENT",
                                  "SUBGROUP"
                                ]
                              },
                              "id": {
                                "type": "string"
                              }
                            }
                          },
                          "clearedScopes": {
                            "type": "array",
                            "items": {}
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "OPT_OUT",
                              "OPT_IN"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "KEYWORD",
                              "LINK"
                            ]
                          },
                          "keyword": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "messageType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "messageId": {
                            "type": "string"
                          },
                          "actor": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "RECIPIENT"
                                ]
                              }
                            }
                          },
                          "occurredAt": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "groupId": "G1234567",
                      "subgroupId": "SG123456",
                      "recipientPhoneNumber": "15555550100",
                      "phoneNumber": "RCSA7K2M1QZ8RP",
                      "scope": {
                        "type": "AGENT",
                        "id": "RCSA7K2M1QZ8RP"
                      },
                      "clearedScopes": [],
                      "action": "OPT_OUT",
                      "source": "KEYWORD",
                      "keyword": "stop",
                      "messageType": "RCS",
                      "messageId": "6912f0a1c9e77c001a2b3c5b",
                      "actor": {
                        "type": "RECIPIENT"
                      },
                      "occurredAt": "2026-12-01T15:04:05.000Z",
                      "createdAt": "2026-12-01T15:04:06.120Z"
                    },
                    {
                      "groupId": "G1234567",
                      "subgroupId": "SG123456",
                      "recipientPhoneNumber": "12174129840",
                      "phoneNumber": "14173738106",
                      "scope": {
                        "type": "CAMPAIGN",
                        "id": "C1234567"
                      },
                      "clearedScopes": [
                        {
                          "type": "CAMPAIGN",
                          "id": "C1234567"
                        },
                        {
                          "type": "SUBGROUP",
                          "id": "SG123456"
                        }
                      ],
                      "action": "OPT_IN",
                      "source": "KEYWORD",
                      "keyword": "start",
                      "messageType": "SMS",
                      "messageId": "6912e7b4c9e77c001a2b3c4a",
                      "actor": {
                        "type": "RECIPIENT"
                      },
                      "occurredAt": "2026-11-30T18:22:10.000Z",
                      "createdAt": "2026-11-30T18:22:10.940Z"
                    }
                  ],
                  "total": 2,
                  "page": 1,
                  "limit": 100
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/estimate": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Price an SMS or MMS from a Canadian or UK sender before sending it.",
        "description": "Price an SMS or MMS from a Canadian or UK sender before sending it. The sender must be a Ready Canadian number (recipients in Canada or the US and its territories) or a Ready UK sender — a Virtual Long Code or an Alphanumeric Sender ID — with an approved sender registration (United Kingdom mobile recipients only, SMS only; refused with a 400 while UK sending is not enabled for the environment). For an Alphanumeric Sender ID, segments are counted with the 29-character opt-out link (a newline and 'Opt out: sihou.io/o/…') that is appended to every message, so the estimate matches what is sent and billed. Every recipient is priced on its own rail from the cached carrier identity — the estimate never performs a paid lookup — and every amount is in microdollars (1,000,000 = $1.00). A recipient whose carrier is unresolved is priced at the rail's Default ceiling and flagged with fallback: true. Read-only: nothing is queued, reserved or charged.\n\nThe RCS form of the estimate: each leg's cost, and the range from every recipient falling back to every one delivering over RCS. issues lists what would block the send, and warnings what an iPhone draws differently. While the agent has no launched carrier, its traffic is test traffic and the RCS leg costs 0; the fallback leg is still priced. rcsLeg.mediaSurcharge is the carrier's surcharge on media over 5 MB for one recipient, and rcsLeg.cost already holds it for every recipient; rcsLeg.cost is null with the fallback mode sms_only, and issues names a message over the carrier's 100 MB limit (MEDIA_TOO_LARGE) and an external media URL that redirects (MEDIA_REDIRECT). A send blocks that recipient with CONTENT_INVALID. With no carrier to look up, the estimate prices the dearest carrier.",
        "operationId": "message.estimateMessage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "senderPhoneNumber": {
                        "type": "string",
                        "description": "Your Ready sender: a Canadian number or a UK Virtual Long Code (44…), digits only, or a UK Alphanumeric Sender ID as granted (e.g. ACME), whose sender registration is APPROVED."
                      },
                      "recipientPhoneNumbers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "1–100 destination numbers, 10–15 digits each with an optional leading +. A Canadian sender accepts Canada and US/territory numbers; a UK sender accepts United Kingdom mobile numbers only — a landline, a Crown dependency or any other country is refused with a 400."
                      },
                      "messageBody": {
                        "type": "string",
                        "description": "The message text (up to 10,000 characters); segments are counted from it. Must not be empty for SMS; may be empty for MMS."
                      },
                      "messageType": {
                        "type": "string",
                        "description": "SMS or MMS. Default: SMS. A UK sender is SMS only; MMS is refused with a 400."
                      }
                    },
                    "required": [
                      "senderPhoneNumber",
                      "recipientPhoneNumbers",
                      "messageBody"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "channel": {
                        "description": "rcs selects this form of the estimate. Without it, the endpoint takes its SMS and MMS form."
                      },
                      "agentId": {
                        "description": "The sending agent."
                      },
                      "recipients": {
                        "description": "Named recipients, as on POST /message/rcs. Send exactly one of recipients or recipientCount."
                      },
                      "recipientCount": {
                        "description": "How many recipients to price. Their carriers are unknown, so default carrier fees apply. balance.insufficient in the response is true when the wallet cannot fund the dearer leg, counting auto recharge and net pricing."
                      },
                      "templateVersion": {
                        "description": "As on POST /message/rcs."
                      },
                      "contentFormat": {
                        "description": "As on POST /message/rcs."
                      },
                      "trafficType": {
                        "description": "As on POST /message/rcs: required on a MULTI_USE agent, unless a template sets it."
                      },
                      "fallback": {
                        "description": "As on POST /message/rcs, but the sender is optional here: with no fallback.from, the fallback leg is priced on the channel of the agent's linked campaign."
                      }
                    },
                    "required": [
                      "channel",
                      "agentId"
                    ]
                  }
                ]
              },
              "examples": {
                "example1": {
                  "value": {
                    "senderPhoneNumber": "447700900123",
                    "recipientPhoneNumbers": [
                      "+447911123456",
                      "447911123457"
                    ],
                    "messageBody": "Your order has shipped. Reply STOP to opt out.",
                    "messageType": "SMS"
                  }
                },
                "example2": {
                  "value": {
                    "channel": "rcs",
                    "agentId": "RCSA7K2M1QZ8RP",
                    "recipientCount": 1000,
                    "content": {
                      "blocks": [
                        {
                          "id": "b1",
                          "kind": "text",
                          "text": "Your order from {{sender_name}} is ready for pickup."
                        },
                        {
                          "id": "b2",
                          "kind": "suggestions",
                          "suggestions": [
                            {
                              "type": "REPLY",
                              "label": "Thanks",
                              "postbackData": "order_ack"
                            },
                            {
                              "type": "OPEN_URL",
                              "label": "Track package",
                              "postbackData": "track_pkg",
                              "url": "https://www.acme.example/track/A-48213",
                              "application": "BROWSER"
                            }
                          ]
                        }
                      ]
                    },
                    "fallback": {
                      "from": "12025550143"
                    }
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "region": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "messageType": {
                          "type": "string"
                        },
                        "segments": {
                          "type": "integer"
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "phoneNumber": {
                                "type": "string"
                              },
                              "rate": {
                                "type": "integer"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "fallback": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "billingClass": {
                          "type": "string"
                        },
                        "segments": {
                          "type": "integer"
                        },
                        "recipientCount": {
                          "type": "integer"
                        },
                        "rcsLeg": {
                          "type": "object",
                          "properties": {
                            "cost": {
                              "type": "integer"
                            },
                            "rate": {
                              "type": "integer"
                            },
                            "mediaSurcharge": {
                              "type": "integer"
                            }
                          }
                        },
                        "fallbackLeg": {
                          "type": "object",
                          "properties": {
                            "cost": {
                              "type": "integer"
                            },
                            "channel": {
                              "type": "string"
                            },
                            "from": {
                              "type": "string"
                            }
                          }
                        },
                        "totals": {
                          "type": "object",
                          "properties": {
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        },
                        "balance": {
                          "type": "object",
                          "properties": {
                            "available": {
                              "type": "integer"
                            },
                            "after": {
                              "type": "integer"
                            },
                            "insufficient": {
                              "type": "boolean"
                            }
                          }
                        },
                        "issues": {
                          "type": "array",
                          "items": {}
                        },
                        "warnings": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "example1": {
                    "value": {
                      "region": "GB",
                      "currency": "USD",
                      "messageType": "SMS",
                      "segments": 1,
                      "recipients": [
                        {
                          "phoneNumber": "447911123456",
                          "rate": 45000,
                          "amount": 45000,
                          "fallback": false
                        },
                        {
                          "phoneNumber": "447911123457",
                          "rate": 60000,
                          "amount": 60000,
                          "fallback": true
                        }
                      ],
                      "total": 105000
                    }
                  },
                  "example2": {
                    "value": {
                      "billingClass": "RICH",
                      "segments": 1,
                      "recipientCount": 1000,
                      "rcsLeg": {
                        "cost": 6500000,
                        "rate": 6500,
                        "mediaSurcharge": 0
                      },
                      "fallbackLeg": {
                        "cost": 10500000,
                        "channel": "sms",
                        "from": "12025550143"
                      },
                      "totals": {
                        "min": 6500000,
                        "max": 10500000
                      },
                      "balance": {
                        "available": 25000000,
                        "after": 14500000,
                        "insufficient": false
                      },
                      "issues": [],
                      "warnings": []
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/groupMessage": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Queue an outbound Group Message to multiple recipients.",
        "description": "Queue an outbound Group Message to multiple recipients. Accepts binary file uploads and external media URLs. Content blocked by the moderation filter is returned in insertedMessages with status \"FAILED\" and a reason naming the policy (not a 4xx error); no delivery callback fires for those messages. Recipients who have opted out of the sending campaign are handled the same way: they are returned in insertedMessages with status \"FAILED\" and the reason \"Message failed due to recipient number opting out of the sending campaign\", and the request still returns 201 even when every recipient has opted out. Recipients removed by the global Do Not Contact list are reported in dncBlockedNumbers instead and receive no message record. Every response carries requestedRecipientCount, enqueuedCount and failedCount so the outcome can be read without inspecting insertedMessages: enqueuedCount is the number actually accepted for delivery and is 0 when the send was fully blocked, and requestedRecipientCount always equals enqueuedCount + failedCount + dncBlockedNumbers.length + filteredNumbers.length. Because a partially blocked send must still return 201, callers should treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Each FAILED message carries errorCode, a stable machine-readable cause to branch on instead of string-matching successOrFailureReason: a campaign opt-out is errorCode \\\"OUT\\\". errorCode is null on success and on failures that have no assigned code, and it is also included on the FAILED status-callback payload. If the request is made with an API key limited to destination countries and any recipient is in another country, the whole request is rejected with 403 and details.code DESTINATION_COUNTRY_NOT_ALLOWED; nothing is queued or charged. Some toll-free carriers don't support MMS; a send from such a number is refused (400). The sender's brand reports it as `tollFree.supportsMms`. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "message.sendGroupMessage",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "senderPhoneNumber": {
                    "type": "string",
                    "description": "Your active Signal House 10DLC number. A UK Virtual Long Code cannot send MMS: the request is refused with a 400."
                  },
                  "recipientPhoneNumber": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of destination phone numbers."
                  },
                  "messageBody": {
                    "type": "string",
                    "description": "Text content. Defaults to an empty string when omitted."
                  },
                  "statusCallbackUrl": {
                    "type": "string",
                    "description": "A valid URL to receive delivery receipts."
                  },
                  "mediaUrls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of up to 5 valid URLs for media."
                  },
                  "images": {
                    "type": "string",
                    "format": "binary",
                    "description": "Up to 5 file attachments (Max 10MB total). Requires multipart/form-data."
                  },
                  "enableCompression": {
                    "type": "boolean",
                    "description": "Auto-compress images to fit carrier limits."
                  },
                  "enableShortlink": {
                    "type": "boolean",
                    "description": "Automatically shorten URLs."
                  },
                  "filterLandlinesAndInactiveNumbers": {
                    "type": "boolean",
                    "description": "Filter out landline and inactive numbers before sending. When enabled, the carrier ID lookup fee is charged per number: filtered numbers are charged the lookup fee only, delivered numbers are charged the lookup fee plus the message fee. Default: false."
                  }
                },
                "required": [
                  "senderPhoneNumber",
                  "recipientPhoneNumber"
                ]
              },
              "example": {
                "senderPhoneNumber": "12025551234",
                "recipientPhoneNumber": [
                  "14175551234",
                  "14175551235"
                ],
                "messageBody": "Team update: meeting at 3pm.",
                "statusCallbackUrl": "https://example.com/webhooks/message-status",
                "mediaUrls": [
                  "https://example.com/agenda.pdf"
                ],
                "enableCompression": true,
                "enableShortlink": false,
                "filterLandlinesAndInactiveNumbers": false
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "insertedMessages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "senderPhoneNumber": {
                            "type": "string"
                          },
                          "messageType": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "recipientPhoneNumber": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "isGroupMessage": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "insertedMessages": [
                    {
                      "_id": "60f7b2a1c9e77c001a2b3c5a",
                      "senderPhoneNumber": "12025551234",
                      "messageType": "MMS",
                      "direction": "OUTBOUND",
                      "recipientPhoneNumber": "14175551234",
                      "status": "ENQUEUED",
                      "isGroupMessage": true,
                      "createdAt": "2024-01-15T14:30:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/mms": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Queue an outbound MMS message.",
        "description": "Queue an outbound MMS message. Accepts binary file uploads and external media URLs. Content blocked by the moderation filter is returned in insertedMessages with status \"FAILED\" and a reason naming the policy (not a 4xx error); no delivery callback fires for those messages. Recipients who have opted out of the sending campaign are handled the same way: they are returned in insertedMessages with status \"FAILED\" and the reason \"Message failed due to recipient number opting out of the sending campaign\", and the request still returns 201 even when every recipient has opted out. Recipients removed by the global Do Not Contact list are reported in dncBlockedNumbers instead and receive no message record. Every response carries requestedRecipientCount, enqueuedCount and failedCount so the outcome can be read without inspecting insertedMessages: enqueuedCount is the number actually accepted for delivery and is 0 when the send was fully blocked, and requestedRecipientCount always equals enqueuedCount + failedCount + dncBlockedNumbers.length + filteredNumbers.length. Because a partially blocked send must still return 201, callers should treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Each FAILED message carries errorCode, a stable machine-readable cause to branch on instead of string-matching successOrFailureReason: a campaign opt-out is errorCode \\\"OUT\\\". errorCode is null on success and on failures that have no assigned code, and it is also included on the FAILED status-callback payload. If the request is made with an API key limited to destination countries and any recipient is in another country, the whole request is rejected with 403 and details.code DESTINATION_COUNTRY_NOT_ALLOWED; nothing is queued or charged. Some toll-free carriers don't support MMS; a send from such a number is refused (400). The sender's brand reports it as `tollFree.supportsMms`. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "message.sendMMS",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "senderPhoneNumber": {
                    "type": "string",
                    "description": "Your active Signal House 5-6 digit Short Code or 10+ digit phone number. A UK Virtual Long Code cannot send MMS: the request is refused with a 400."
                  },
                  "recipientPhoneNumber": {
                    "anyOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Destination phone number(s). When senderPhoneNumber is a Short Code, exactly one recipient is allowed and it must be a +1 (US/Canada) number; a bare 10-digit number is treated as +1. Any other country code is rejected with a 400 before the message is queued."
                  },
                  "messageBody": {
                    "type": "string",
                    "description": "Text content. Defaults to an empty string when omitted."
                  },
                  "statusCallbackUrl": {
                    "type": "string",
                    "description": "A valid URL to receive delivery receipts."
                  },
                  "mediaUrls": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of up to 5 valid URLs for media."
                  },
                  "images": {
                    "type": "string",
                    "format": "binary",
                    "description": "Up to 5 file attachments (Max 10MB total). Requires multipart/form-data."
                  },
                  "enableCompression": {
                    "type": "boolean",
                    "description": "Auto-compress images to fit carrier limits. Default: false."
                  },
                  "enableShortlink": {
                    "type": "boolean",
                    "description": "Automatically shorten URLs. Default: false."
                  },
                  "filterLandlinesAndInactiveNumbers": {
                    "type": "boolean",
                    "description": "Filter out landline and inactive numbers before sending. When enabled, the carrier ID lookup fee is charged per number: filtered numbers are charged the lookup fee only, delivered numbers are charged the lookup fee plus the message fee. Default: false."
                  }
                },
                "required": [
                  "senderPhoneNumber",
                  "recipientPhoneNumber"
                ]
              },
              "example": {
                "senderPhoneNumber": "12025551234",
                "recipientPhoneNumber": [
                  "14175551234"
                ],
                "messageBody": "Check out this image!",
                "statusCallbackUrl": "https://example.com/webhooks/message-status",
                "mediaUrls": [
                  "https://example.com/photo.jpg"
                ],
                "enableCompression": true,
                "enableShortlink": false,
                "filterLandlinesAndInactiveNumbers": false
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "insertedMessages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "senderPhoneNumber": {
                            "type": "string"
                          },
                          "messageType": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "recipientPhoneNumber": {
                            "type": "string"
                          },
                          "messageBody": {
                            "type": "string"
                          },
                          "segmentCount": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "insertedMessages": [
                    {
                      "_id": "60f7b2a1c9e77c001a2b3c59",
                      "senderPhoneNumber": "12025551234",
                      "messageType": "MMS",
                      "direction": "OUTBOUND",
                      "recipientPhoneNumber": "14175551234",
                      "messageBody": "Check out this image!",
                      "segmentCount": 1,
                      "status": "ENQUEUED",
                      "createdAt": "2024-01-15T14:30:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/p2p": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Retired: P2P messaging is no longer available.",
        "description": "Retired: P2P messaging is no longer available. Every call now answers 410 Gone with the error P2P messaging is no longer available, and nothing is sent or charged. Use POST /message/sms instead. Before it was retired, this accepted an outbound P2P send and queued it for asynchronous fan-out. The request validates, authorizes, drops recipients who previously replied STOP, reserves funds for the remaining recipients, and persists a batch record, then returns immediately. Recipient messages are created and sent by a background worker. Poll GET /message/p2p/batches/:batchId for status. The response includes skippedOptOutCount (recipients dropped because they had opted out); if every recipient was opted out, no batch is created and batchId is null. Requires the p2pEnabled feature flag on the group. If the request is made with an API key limited to destination countries and any recipient is in another country, the whole request is rejected with 403 and details.code DESTINATION_COUNTRY_NOT_ALLOWED; nothing is queued or charged.",
        "operationId": "message.sendP2P",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendP2PRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batchId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "recipientCount": {
                      "type": "integer"
                    },
                    "insertedMessages": {
                      "type": "array",
                      "items": {}
                    },
                    "insertedMessageCount": {
                      "type": "integer"
                    },
                    "skippedOptOutCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "batchId": "60f7b2a1c9e77c001a2b3c5b",
                  "status": "ACCEPTED",
                  "recipientCount": 1,
                  "insertedMessages": [],
                  "insertedMessageCount": 1,
                  "skippedOptOutCount": 0
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/p2p/batches/{batchId}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Retired: P2P messaging is no longer available.",
        "description": "Retired: P2P messaging is no longer available. Every call now answers 410 Gone. Before it was retired, this returned the status of an asynchronous P2P batch created by POST /message/p2p. The recipient phone number list is omitted from the response. Status values: ACCEPTED, EXPANDING, ENQUEUING, EXPANDED, EXPANSION_FAILED. Returns an empty array if the batch is not found.",
        "operationId": "message.readP2PBatch",
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The P2P batch ID returned by POST /message/p2p."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "batchId": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "recipientCount": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string"
                      },
                      "statusHistory": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string"
                            },
                            "timestamp": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "insertedCount": {
                        "type": "integer"
                      },
                      "enqueuedCount": {
                        "type": "integer"
                      },
                      "error": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5b",
                    "batchId": "60f7b2a1c9e77c001a2b3c5b",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "recipientCount": 1,
                    "status": "EXPANDED",
                    "statusHistory": [
                      {
                        "status": "ACCEPTED",
                        "timestamp": "2024-01-15T14:30:00.000Z"
                      },
                      {
                        "status": "EXPANDING",
                        "timestamp": "2024-01-15T14:30:01.000Z"
                      },
                      {
                        "status": "ENQUEUING",
                        "timestamp": "2024-01-15T14:30:01.000Z"
                      },
                      {
                        "status": "EXPANDED",
                        "timestamp": "2024-01-15T14:30:02.000Z"
                      }
                    ],
                    "insertedCount": 1,
                    "enqueuedCount": 1,
                    "error": null,
                    "createdAt": "2024-01-15T14:30:00.000Z",
                    "updatedAt": "2024-01-15T14:30:02.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/rcs": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Queue an RCS message from an agent, with inline content or a published template.",
        "description": "Queue an RCS message from an agent, with inline content or a published template. A check that stops one recipient returns it as BLOCKED, with blockReason, and sends to the rest; only a request-level problem fails the call. Nothing is charged until delivery. A recipient who cannot take RCS gets the SMS or MMS fallback, billed as an ordinary message. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.\n\nThe same endpoint with a template: name templateId and give each recipient its variables. The sending agent is chosen on each send, not on the template. A recipient with no value for a variable, where an empty value or only spaces counts as none, gets what the variable's missingPolicy says (see Templates). It is BLOCKED with VARIABLE_MISSING when the policy is block, when the variable is required with no default and no policy, or when a drop leaves nothing to send. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "message.sendRcs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "description": "The sending agent (RCSA…). It must be in testing or launched. Before any carrier launches, the agent reaches its approved testers only."
                  },
                  "recipients": {
                    "description": "1 to 100 recipients, each { phoneNumber, variables?, clientMessageId?, metadata? }. variables holds the template values for that recipient. clientMessageId is your own id: it returns on every event, and a repeat sends again. To retry a request safely, send an Idempotency-Key header. metadata (up to 20 string values of up to 500 characters) returns on every event. A reply, a tap, an opt-out and an SMS reply to the fallback number carry both from the message they answer. A simulated delivery error number (19999990000 to 19999990359) makes the whole request a simulation, as on SMS: the response is { simulated: true, webhooks } and nothing is stored, sent or charged."
                  },
                  "content": {
                    "description": "Inline content.v1 blocks. Send exactly one of content or templateId. Inline content declares no variables, so a placeholder other than {{sender_name}} is refused."
                  },
                  "contentFormat": {
                    "description": "content.v1 (the default) or google.rcs, which the API converts to content.v1."
                  },
                  "templateId": {
                    "description": "A published template. Templates belong to the group, so any of its agents can send one. An archived template answers 409 TEMPLATE_ARCHIVED."
                  },
                  "templateVersion": {
                    "description": "A published version; defaults to the current one. The version is pinned at enqueue."
                  },
                  "trafficType": {
                    "description": "AUTHENTICATION, TRANSACTION, SERVICEREQUEST, ACKNOWLEDGEMENT or PROMOTION. Required on a MULTI_USE agent, unless a template sets it, and must suit the agent's use case."
                  },
                  "ttlSeconds": {
                    "description": "Time to live, inside the traffic type's range. Send at most one of ttlSeconds or expireTime. Defaults: AUTHENTICATION 30 (15 to 300), TRANSACTION and SERVICEREQUEST 900 (60 to 86400), ACKNOWLEDGEMENT 300 (60 to 3600), PROMOTION 14400 (600 to 172800)."
                  },
                  "expireTime": {
                    "description": "ISO 8601 instant the message expires, inside the same range."
                  },
                  "fallback": {
                    "description": "{ mode?, channel?, from?, content?, validitySeconds? }. mode: auto (the default), rcs_only or sms_only. channel: auto, sms or mms. from: a Ready number on the agent's linked Active campaign, of any registration type; defaults to the template's, then the agent's defaultFallback. content: { text, mediaUrls? }; omitted, the template's fallback is used, otherwise one is generated from the RCS content. A recipient whose fallback has no text to send is blocked with CONTENT_INVALID. validitySeconds: how long the provider tries the fallback; it applies to an SMS leg sent through Infobip, and MMS, Twilio and Sinch legs ignore it."
                  },
                  "statusCallbackUrl": {
                    "description": "A URL that receives this message's events, each as one flat object: { event, timestamp, ...metaData }. Each post is signed with your group's oldest Global webhook's secret, and is unsigned when the group has no Global webhook. See Webhook Signing."
                  },
                  "enableShortlink": {
                    "description": "Shorten links on the fallback leg. RCS links are not shortened; a tap reports through SUGGESTION_RESPONSE."
                  },
                  "isTest": {
                    "description": "Mark the send as a test. Every recipient must be an approved tester of the agent."
                  },
                  "simulate": {
                    "description": "not_capable, ttl_expired, delivered or read: fake the RCS outcome with no carrier call, for approved testers only. A fallback it triggers is a real, billed SMS. See Simulated Delivery Errors."
                  }
                },
                "required": [
                  "agentId",
                  "recipients"
                ]
              },
              "examples": {
                "example1": {
                  "value": {
                    "agentId": "RCSA7K2M1QZ8RP",
                    "trafficType": "TRANSACTION",
                    "recipients": [
                      {
                        "phoneNumber": "12025550187",
                        "clientMessageId": "ord-48213",
                        "metadata": {
                          "orderId": "A-48213"
                        }
                      },
                      {
                        "phoneNumber": "12025550189"
                      }
                    ],
                    "content": {
                      "blocks": [
                        {
                          "id": "b1",
                          "kind": "text",
                          "text": "Your order from {{sender_name}} is ready for pickup."
                        },
                        {
                          "id": "b2",
                          "kind": "suggestions",
                          "suggestions": [
                            {
                              "type": "REPLY",
                              "label": "Thanks",
                              "postbackData": "order_ack"
                            },
                            {
                              "type": "OPEN_URL",
                              "label": "Track package",
                              "postbackData": "track_pkg",
                              "url": "https://www.acme.example/track/A-48213",
                              "application": "BROWSER"
                            }
                          ]
                        }
                      ]
                    },
                    "fallback": {
                      "mode": "auto",
                      "channel": "sms",
                      "from": "12025550143",
                      "content": {
                        "text": "Your order is ready for pickup: https://www.acme.example/track/A-48213"
                      }
                    }
                  }
                },
                "example2": {
                  "value": {
                    "agentId": "RCSA7K2M1QZ8RP",
                    "templateId": "TPL0000123",
                    "templateVersion": 3,
                    "recipients": [
                      {
                        "phoneNumber": "12025550187",
                        "variables": {
                          "order_number": "A-48213"
                        }
                      },
                      {
                        "phoneNumber": "12025550188",
                        "variables": {
                          "order_number": "A-48214"
                        }
                      }
                    ]
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requested": {
                      "type": "integer"
                    },
                    "enqueued": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "bulkId": {
                      "type": "string"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "messageId": {
                            "type": "string"
                          },
                          "clientMessageId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "blockReason": {},
                          "reason": {},
                          "issues": {
                            "type": "array",
                            "items": {}
                          },
                          "predictedChannel": {
                            "type": "string"
                          },
                          "billingClass": {
                            "type": "string"
                          },
                          "segments": {
                            "type": "integer"
                          },
                          "estimatedCostMicros": {
                            "type": "integer"
                          },
                          "carrier": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "requested": 2,
                  "enqueued": 1,
                  "failed": 1,
                  "bulkId": "6f1d2c4e-1b7a-4f6e-9c1d-2f7a4e0b8a11",
                  "messages": [
                    {
                      "phoneNumber": "12025550187",
                      "messageId": "6912f0a1c4e8a73d9b2e4f10",
                      "clientMessageId": "ord-48213",
                      "status": "QUEUED",
                      "blockReason": null,
                      "reason": null,
                      "issues": [],
                      "predictedChannel": "rcs",
                      "billingClass": "RICH",
                      "segments": 1,
                      "estimatedCostMicros": 10800,
                      "carrier": "T-Mobile"
                    },
                    {
                      "phoneNumber": "12025550189",
                      "messageId": "6912f0a1c4e8a73d9b2e4f13",
                      "status": "BLOCKED",
                      "blockReason": "OPTED_OUT",
                      "reason": "The recipient has opted out",
                      "issues": [],
                      "predictedChannel": null,
                      "billingClass": null,
                      "segments": 0,
                      "estimatedCostMicros": 0,
                      "carrier": null
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/rcs/batch": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Send to up to 10,000 recipients in the background, with the body of POST /message/rcs.",
        "description": "Send to up to 10,000 recipients in the background, with the body of POST /message/rcs. The request runs that route's request checks at once, so a bad template, traffic type, time to live or fallback sender answers 400 and nothing is queued, then answers 202 with the batch's bulkId. The recipients are queued in chunks of 100, and each chunk goes through every check of POST /message/rcs, so each recipient is checked, blocked and charged as on that route. Each chunk holds its own funds: the recipients of a chunk the wallet cannot cover are BLOCKED with INSUFFICIENT_FUNDS, and the other chunks still send. A chunk refused after the batch was accepted blocks its recipients with SEND_REFUSED, and one that keeps failing blocks them with SEND_FAILED. Every message carries the bulkId: follow the batch with GET /message?bulkId= and the per-message webhooks. Send an Idempotency-Key header so a retried request sends no recipient twice. A template send uses the version current when the batch is accepted. ttlSeconds counts from when each chunk is sent. The request body is capped at 5 MB, about 500 bytes per recipient at 10,000 recipients, and each chunk of 100 recipients with the request must fit in 254 KB, or the request answers 400 with BATCH_CHUNK_TOO_LARGE. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "message.sendRcsBatch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "description": "The sending agent (RCSA…). It must be in testing or launched. Before any carrier launches, the agent reaches its approved testers only."
                  },
                  "recipients": {
                    "description": "1 to 10,000 recipients, each { phoneNumber, variables?, clientMessageId?, metadata? }. variables holds the template values for that recipient. clientMessageId is your own id: it returns on every event, and a repeat sends again. To retry a request safely, send an Idempotency-Key header. metadata (up to 20 string values of up to 500 characters) returns on every event. A reply, a tap, an opt-out and an SMS reply to the fallback number carry both from the message they answer. A simulated delivery error number (19999990000 to 19999990359) makes the whole request a simulation, as on SMS: the response is { simulated: true, webhooks } and nothing is stored, sent or charged."
                  },
                  "content": {
                    "description": "Inline content.v1 blocks. Send exactly one of content or templateId. Inline content declares no variables, so a placeholder other than {{sender_name}} is refused."
                  },
                  "contentFormat": {
                    "description": "content.v1 (the default) or google.rcs, which the API converts to content.v1."
                  },
                  "templateId": {
                    "description": "A published template. Templates belong to the group, so any of its agents can send one. An archived template answers 409 TEMPLATE_ARCHIVED."
                  },
                  "templateVersion": {
                    "description": "A published version; defaults to the current one. The version is pinned at enqueue."
                  },
                  "trafficType": {
                    "description": "AUTHENTICATION, TRANSACTION, SERVICEREQUEST, ACKNOWLEDGEMENT or PROMOTION. Required on a MULTI_USE agent, unless a template sets it, and must suit the agent's use case."
                  },
                  "ttlSeconds": {
                    "description": "Time to live, inside the traffic type's range. Send at most one of ttlSeconds or expireTime. Defaults: AUTHENTICATION 30 (15 to 300), TRANSACTION and SERVICEREQUEST 900 (60 to 86400), ACKNOWLEDGEMENT 300 (60 to 3600), PROMOTION 14400 (600 to 172800)."
                  },
                  "expireTime": {
                    "description": "ISO 8601 instant the message expires, inside the same range."
                  },
                  "fallback": {
                    "description": "{ mode?, channel?, from?, content?, validitySeconds? }. mode: auto (the default), rcs_only or sms_only. channel: auto, sms or mms. from: a Ready number on the agent's linked Active campaign, of any registration type; defaults to the template's, then the agent's defaultFallback. content: { text, mediaUrls? }; omitted, the template's fallback is used, otherwise one is generated from the RCS content. A recipient whose fallback has no text to send is blocked with CONTENT_INVALID. validitySeconds: how long the provider tries the fallback; it applies to an SMS leg sent through Infobip, and MMS, Twilio and Sinch legs ignore it."
                  },
                  "statusCallbackUrl": {
                    "description": "A URL that receives this message's events, each as one flat object: { event, timestamp, ...metaData }. Each post is signed with your group's oldest Global webhook's secret, and is unsigned when the group has no Global webhook. See Webhook Signing."
                  },
                  "enableShortlink": {
                    "description": "Shorten links on the fallback leg. RCS links are not shortened; a tap reports through SUGGESTION_RESPONSE."
                  },
                  "isTest": {
                    "description": "Mark the send as a test. Every recipient must be an approved tester of the agent."
                  },
                  "simulate": {
                    "description": "not_capable, ttl_expired, delivered or read: fake the RCS outcome with no carrier call, for approved testers only. A fallback it triggers is a real, billed SMS. See Simulated Delivery Errors."
                  }
                },
                "required": [
                  "agentId",
                  "recipients"
                ]
              },
              "example": {
                "agentId": "RCSA7K2M1QZ8RP",
                "templateId": "TPL0000123",
                "trafficType": "TRANSACTION",
                "recipients": [
                  {
                    "phoneNumber": "12025550187",
                    "variables": {
                      "order_number": "A-48213"
                    }
                  },
                  {
                    "phoneNumber": "12025550188",
                    "variables": {
                      "order_number": "A-48214"
                    }
                  }
                ],
                "statusCallbackUrl": "https://www.acme.example/rcs-status"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bulkId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "recipientCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "bulkId": "b8f2c3d4-0e1f-4a5b-9c6d-7e8f9a0b1c2d",
                  "status": "ACCEPTED",
                  "recipientCount": 2
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/rcs/simulate-inbound": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Fake a reply or tap from an approved tester, with no handset or carrier.",
        "description": "Fake a reply or tap from an approved tester, with no handset or carrier. The event runs the real inbound handlers and fires the real webhooks, so a test exercises your handler end to end. Rows are marked isTest, nothing is charged, and any automatic reply is simulated too. The effects are real otherwise: a simulated STOP opts the tester out of this agent until a simulated START.",
        "operationId": "message.simulateRcsInbound",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateRcsInboundRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "messageId": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "status": "QUEUED",
                  "messageId": "sim-3f1c9a52-7b1e-4c1a-9f7e-2f9d6b1c0a11"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/rcs/validate": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Run the checks of POST /message/rcs on the same body, and stop before funds are held.",
        "description": "Run the checks of POST /message/rcs on the same body, and stop before funds are held. Nothing is written. valid is true only with no errors: each blocked recipient adds one, and INSUFFICIENT_FUNDS reports a wallet that cannot cover the send. warnings lists what looks different on an iPhone, and never blocks. segments is null for Rich Media, and a leg the fallback policy forbids costs null. unsupportedFiles lists the media of a message over the 100 MB limit. An external media URL that answers with a redirect adds a MEDIA_REDIRECT error. A destination the API key may not reach answers 403, as on the send.",
        "operationId": "message.validateRcs",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "description": "The sending agent (RCSA…). It must be in testing or launched. Before any carrier launches, the agent reaches its approved testers only."
                  },
                  "recipients": {
                    "description": "1 to 100 recipients, each { phoneNumber, variables?, clientMessageId?, metadata? }. variables holds the template values for that recipient. clientMessageId is your own id: it returns on every event, and a repeat sends again. To retry a request safely, send an Idempotency-Key header. metadata (up to 20 string values of up to 500 characters) returns on every event. A reply, a tap, an opt-out and an SMS reply to the fallback number carry both from the message they answer. A simulated delivery error number (19999990000 to 19999990359) makes the whole request a simulation, as on SMS: the response is { simulated: true, webhooks } and nothing is stored, sent or charged."
                  },
                  "content": {
                    "description": "Inline content.v1 blocks. Send exactly one of content or templateId. Inline content declares no variables, so a placeholder other than {{sender_name}} is refused."
                  },
                  "contentFormat": {
                    "description": "content.v1 (the default) or google.rcs, which the API converts to content.v1."
                  },
                  "templateId": {
                    "description": "A published template. Templates belong to the group, so any of its agents can send one. An archived template answers 409 TEMPLATE_ARCHIVED."
                  },
                  "templateVersion": {
                    "description": "A published version; defaults to the current one. The version is pinned at enqueue."
                  },
                  "trafficType": {
                    "description": "AUTHENTICATION, TRANSACTION, SERVICEREQUEST, ACKNOWLEDGEMENT or PROMOTION. Required on a MULTI_USE agent, unless a template sets it, and must suit the agent's use case."
                  },
                  "ttlSeconds": {
                    "description": "Time to live, inside the traffic type's range. Send at most one of ttlSeconds or expireTime. Defaults: AUTHENTICATION 30 (15 to 300), TRANSACTION and SERVICEREQUEST 900 (60 to 86400), ACKNOWLEDGEMENT 300 (60 to 3600), PROMOTION 14400 (600 to 172800)."
                  },
                  "expireTime": {
                    "description": "ISO 8601 instant the message expires, inside the same range."
                  },
                  "fallback": {
                    "description": "{ mode?, channel?, from?, content?, validitySeconds? }. mode: auto (the default), rcs_only or sms_only. channel: auto, sms or mms. from: a Ready number on the agent's linked Active campaign, of any registration type; defaults to the template's, then the agent's defaultFallback. content: { text, mediaUrls? }; omitted, the template's fallback is used, otherwise one is generated from the RCS content. A recipient whose fallback has no text to send is blocked with CONTENT_INVALID. validitySeconds: how long the provider tries the fallback; it applies to an SMS leg sent through Infobip, and MMS, Twilio and Sinch legs ignore it."
                  },
                  "statusCallbackUrl": {
                    "description": "A URL that receives this message's events, each as one flat object: { event, timestamp, ...metaData }. Each post is signed with your group's oldest Global webhook's secret, and is unsigned when the group has no Global webhook. See Webhook Signing."
                  },
                  "enableShortlink": {
                    "description": "Shorten links on the fallback leg. RCS links are not shortened; a tap reports through SUGGESTION_RESPONSE."
                  },
                  "isTest": {
                    "description": "Mark the send as a test. Every recipient must be an approved tester of the agent."
                  },
                  "simulate": {
                    "description": "not_capable, ttl_expired, delivered or read: fake the RCS outcome with no carrier call, for approved testers only. A fallback it triggers is a real, billed SMS. See Simulated Delivery Errors."
                  }
                },
                "required": [
                  "agentId",
                  "recipients"
                ]
              },
              "example": {
                "agentId": "RCSA7K2M1QZ8RP",
                "trafficType": "TRANSACTION",
                "recipients": [
                  {
                    "phoneNumber": "12025550187",
                    "clientMessageId": "ord-48213",
                    "metadata": {
                      "orderId": "A-48213"
                    }
                  },
                  {
                    "phoneNumber": "12025550189"
                  }
                ],
                "content": {
                  "blocks": [
                    {
                      "id": "b1",
                      "kind": "text",
                      "text": "Your order from {{sender_name}} is ready for pickup."
                    },
                    {
                      "id": "b2",
                      "kind": "suggestions",
                      "suggestions": [
                        {
                          "type": "REPLY",
                          "label": "Thanks",
                          "postbackData": "order_ack"
                        },
                        {
                          "type": "OPEN_URL",
                          "label": "Track package",
                          "postbackData": "track_pkg",
                          "url": "https://www.acme.example/track/A-48213",
                          "application": "BROWSER"
                        }
                      ]
                    }
                  ]
                },
                "fallback": {
                  "mode": "auto",
                  "channel": "sms",
                  "from": "12025550143",
                  "content": {
                    "text": "Your order is ready for pickup: https://www.acme.example/track/A-48213"
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {}
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "blockId": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "billingClass": {
                      "type": "string"
                    },
                    "segments": {
                      "type": "integer"
                    },
                    "estimatedCostMicros": {
                      "type": "object",
                      "properties": {
                        "rcs": {
                          "type": "integer"
                        },
                        "fallback": {
                          "type": "integer"
                        }
                      }
                    },
                    "unsupportedFiles": {
                      "type": "array",
                      "items": {}
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "blockReason": {},
                          "reason": {},
                          "issues": {
                            "type": "array",
                            "items": {}
                          },
                          "predictedChannel": {
                            "type": "string"
                          },
                          "billingClass": {
                            "type": "string"
                          },
                          "segments": {
                            "type": "integer"
                          },
                          "estimatedCostMicros": {
                            "type": "integer"
                          },
                          "carrier": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "valid": true,
                  "errors": [],
                  "warnings": [
                    {
                      "severity": "warning",
                      "code": "IOS_CHIPS_COLLAPSE",
                      "path": "content.blocks",
                      "message": "More than two suggested actions collapse into an Options menu on iPhone.",
                      "blockId": "s1"
                    }
                  ],
                  "billingClass": "RICH",
                  "segments": 1,
                  "estimatedCostMicros": {
                    "rcs": 10800,
                    "fallback": 10500
                  },
                  "unsupportedFiles": [],
                  "recipients": [
                    {
                      "phoneNumber": "12025550187",
                      "status": "OK",
                      "blockReason": null,
                      "reason": null,
                      "issues": [],
                      "predictedChannel": "rcs",
                      "billingClass": "RICH",
                      "segments": 1,
                      "estimatedCostMicros": 10800,
                      "carrier": "T-Mobile"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/sms": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Queue an outbound SMS message.",
        "description": "Queue an outbound SMS message. Content blocked by the moderation filter is returned in insertedMessages with status \"FAILED\" and a reason naming the policy (not a 4xx error); no delivery callback fires for those messages. Recipients who have opted out of the sending campaign are handled the same way: they are returned in insertedMessages with status \"FAILED\" and the reason \"Message failed due to recipient number opting out of the sending campaign\", and the request still returns 201 even when every recipient has opted out. Recipients removed by the global Do Not Contact list are reported in dncBlockedNumbers instead and receive no message record. Every response carries requestedRecipientCount, enqueuedCount and failedCount so the outcome can be read without inspecting insertedMessages: enqueuedCount is the number actually accepted for delivery and is 0 when the send was fully blocked, and requestedRecipientCount always equals enqueuedCount + failedCount + dncBlockedNumbers.length + filteredNumbers.length. Because a partially blocked send must still return 201, callers should treat enqueuedCount, not the HTTP status, as the signal that a message was accepted. Each FAILED message carries errorCode, a stable machine-readable cause to branch on instead of string-matching successOrFailureReason: a campaign opt-out is errorCode \\\"OUT\\\". errorCode is null on success and on failures that have no assigned code, and it is also included on the FAILED status-callback payload. If the request is made with an API key limited to destination countries and any recipient is in another country, the whole request is rejected with 403 and details.code DESTINATION_COUNTRY_NOT_ALLOWED; nothing is queued or charged. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, per-connection caps apply: at most 10 recipients per call, 50 messages per hour and an estimated $25 a day, to US and Canada recipients only. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "message.sendSMS",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendSMSRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "insertedMessages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "senderPhoneNumber": {
                            "type": "string"
                          },
                          "messageType": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "recipientPhoneNumber": {
                            "type": "string"
                          },
                          "messageBody": {
                            "type": "string"
                          },
                          "segmentCount": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "enableShortlink": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "insertedMessages": [
                    {
                      "_id": "60f7b2a1c9e77c001a2b3c58",
                      "senderPhoneNumber": "12025551234",
                      "messageType": "SMS",
                      "direction": "OUTBOUND",
                      "recipientPhoneNumber": "14175551234",
                      "messageBody": "Hello from Signal House API! Visit https://signalhouse.io",
                      "segmentCount": 1,
                      "status": "ENQUEUED",
                      "enableShortlink": true,
                      "createdAt": "2024-01-15T14:30:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/{id}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Read one message of any type.",
        "description": "Read one message of any type. On an RCS message, phoneNumber and senderPhoneNumber hold the agent's ID, and the fallback leg links through fallbackMessageId and parentMessageId. An outbound RCS message and its fallback leg also carry costBreakdown, with one entry in legs per leg; either message's read returns both. billed is true once the ledger holds a net charge, and baseMicros and carrierMicros then say what was charged, a carrier media surcharge included in carrierMicros. Until then they say what the leg was rated at. rated is true on an RCS leg, which is rated when queued, and false on a fallback leg, which is priced as an ordinary SMS or MMS. A tap is charged on its own and is not in the leg. costBreakdown is null if it could not be read. A settled RCS message also carries carrierFeeMicros, the carrier pass-through and media surcharge it was charged, as GET /message returns it. An inbound message carries inReplyToMessageId, the message it answers. A reply chip or button names its message, so that link is exact; any other reply links to the newest message your number or agent sent that handset in the 7 days before it, while that message was sent, delivered or read and was not a STOP or HELP auto-reply. It is absent when there is no such message, on P2P replies, and on replies stored before the link was switched on. If that message has a parentMessageId, it was an RCS fallback, and the parent is the RCS message you sent.",
        "operationId": "message.readMessageById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message's ID. Works for every message type. An unknown ID answers 404."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "phoneNumber": {
                      "type": "string"
                    },
                    "senderPhoneNumber": {
                      "type": "string"
                    },
                    "recipientPhoneNumber": {
                      "type": "string"
                    },
                    "messageType": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "deliveredChannel": {
                      "type": "string"
                    },
                    "billingClass": {
                      "type": "string"
                    },
                    "segmentCount": {
                      "type": "integer"
                    },
                    "trafficType": {
                      "type": "string"
                    },
                    "isTest": {
                      "type": "boolean"
                    },
                    "ratedCostMicros": {
                      "type": "integer"
                    },
                    "carrierFeeMicros": {
                      "type": "integer"
                    },
                    "costBreakdown": {
                      "type": "object",
                      "properties": {
                        "legs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "messageId": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "billed": {
                                "type": "boolean"
                              },
                              "billingClass": {
                                "type": "string"
                              },
                              "segments": {
                                "type": "integer"
                              },
                              "baseMicros": {
                                "type": "integer"
                              },
                              "carrierMicros": {
                                "type": "integer"
                              },
                              "rated": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    },
                    "statusHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "_id": "6912f0a1c4e8a73d9b2e4f10",
                  "groupId": "G0000001",
                  "subgroupId": "S0000001",
                  "phoneNumber": "RCSA7K2M1QZ8RP",
                  "senderPhoneNumber": "RCSA7K2M1QZ8RP",
                  "recipientPhoneNumber": "12025550187",
                  "messageType": "RCS",
                  "channel": "rcs",
                  "direction": "OUTBOUND",
                  "status": "READ",
                  "deliveredChannel": "rcs",
                  "billingClass": "RICH",
                  "segmentCount": 1,
                  "trafficType": "TRANSACTION",
                  "isTest": false,
                  "ratedCostMicros": 11500,
                  "carrierFeeMicros": 5000,
                  "costBreakdown": {
                    "legs": [
                      {
                        "messageId": "6912f0a1c4e8a73d9b2e4f10",
                        "channel": "rcs",
                        "billed": true,
                        "billingClass": "RICH",
                        "segments": 1,
                        "baseMicros": 6500,
                        "carrierMicros": 5000,
                        "rated": true
                      }
                    ]
                  },
                  "statusHistory": [
                    {
                      "status": "ENQUEUED",
                      "timestamp": "2026-11-10T15:00:00.120Z"
                    },
                    {
                      "status": "SENT",
                      "timestamp": "2026-11-10T15:00:00.940Z"
                    },
                    {
                      "status": "DELIVERED",
                      "timestamp": "2026-11-10T15:00:03.300Z",
                      "occurredAt": "2026-11-10T15:00:02.800Z"
                    },
                    {
                      "status": "READ",
                      "timestamp": "2026-11-10T15:02:11.000Z",
                      "occurredAt": "2026-11-10T15:02:10.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/message/{id}/interactions": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "List the taps on one RCS message, oldest first: reply chips and action buttons.",
        "description": "List the taps on one RCS message, oldest first: reply chips and action buttons. A message nobody tapped answers an empty list. Reachable only where RCS is enabled.",
        "operationId": "message.readMessageInteractions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The message's ID. An unknown ID answers 404."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "actionType": {
                            "type": "string",
                            "enum": [
                              "REPLY",
                              "OPEN_URL",
                              "DIAL",
                              "VIEW_LOCATION",
                              "SHARE_LOCATION",
                              "CALENDAR",
                              "UNKNOWN"
                            ]
                          },
                          "buttonId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "postbackData": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "occurredAt": {
                            "type": "string"
                          },
                          "ratedCostMicros": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "results": [
                    {
                      "actionType": "OPEN_URL",
                      "buttonId": "1.m.1",
                      "label": "Track package",
                      "postbackData": "track_pkg",
                      "occurredAt": "2026-11-10T15:03:05.000Z",
                      "ratedCostMicros": 2500
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/notification": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "Retrieve notifications with optional filtering and pagination.",
        "description": "Retrieve notifications with optional filtering and pagination.",
        "operationId": "notification.readNotifications",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific Notification ObjectId.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: READ or UNREAD.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "eventTypes",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of event types to filter by.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page, max 100 (default: 10).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "eventType": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "message": {
                        "type": "object",
                        "properties": {
                          "brandId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "PENDING_CREATION",
                              "PENDING_APPROVAL",
                              "UNVERIFIED",
                              "VERIFIED",
                              "VETTED_VERIFIED",
                              "PENDING_DELETE",
                              "DELETED",
                              "DCA_PENDING",
                              "DCA_ACTIVE",
                              "DCA_REJECTED",
                              "DCA_PENDING_2FA",
                              "DCA_PENDING_APPEAL",
                              "SHORT_CODE_REJECTED",
                              null
                            ]
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5b",
                    "groupId": "G1234567",
                    "eventType": "BRAND_CREATION_SUCCESSFUL",
                    "status": "UNREAD",
                    "message": {
                      "brandId": "B1234567",
                      "displayName": "Acme Corp",
                      "status": "VERIFIED"
                    },
                    "createdAt": "2024-01-15T12:05:00.000Z",
                    "updatedAt": "2024-01-15T12:05:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "signalhouse_api",
          "signalhouse_admin",
          "signalhouse_user",
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/notification/status": {
      "put": {
        "tags": [
          "Notifications"
        ],
        "summary": "Bulk update the status of one or more notifications.",
        "description": "Bulk update the status of one or more notifications.",
        "operationId": "notification.updateNotificationStatus",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of Notification ObjectIds to update."
                  },
                  "status": {
                    "type": "string",
                    "description": "New status: READ or UNREAD."
                  }
                },
                "required": [
                  "ids",
                  "status"
                ]
              },
              "example": {
                "ids": [
                  "60f7b2a1c9e77c001a2b3c4d"
                ],
                "status": "READ"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "modifiedCount": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "modifiedCount": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "signalhouse_api",
          "signalhouse_admin",
          "signalhouse_user",
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/notification/{id}": {
      "delete": {
        "tags": [
          "Notifications"
        ],
        "summary": "Delete a single notification.",
        "description": "Delete a single notification.",
        "operationId": "notification.deleteNotification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Notification ObjectId to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "eventType": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "object",
                      "properties": {
                        "brandId": {
                          "type": "string"
                        },
                        "displayName": {
                          "type": "string"
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "PENDING_CREATION",
                            "PENDING_APPROVAL",
                            "UNVERIFIED",
                            "VERIFIED",
                            "VETTED_VERIFIED",
                            "PENDING_DELETE",
                            "DELETED",
                            "DCA_PENDING",
                            "DCA_ACTIVE",
                            "DCA_REJECTED",
                            "DCA_PENDING_2FA",
                            "DCA_PENDING_APPEAL",
                            "SHORT_CODE_REJECTED",
                            null
                          ]
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c4d",
                  "groupId": "G1234567",
                  "eventType": "BRAND_CREATION_SUCCESSFUL",
                  "status": "UNREAD",
                  "message": {
                    "brandId": "B1234567",
                    "displayName": "Acme Corp",
                    "status": "VERIFIED"
                  },
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "signalhouse_api",
          "signalhouse_admin",
          "signalhouse_user",
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Retrieve owned phone numbers with optional filtering.",
        "description": "Retrieve owned phone numbers with optional filtering. Customer roles must supply at least one filter parameter (phoneNumber, campaignId, brandId, subgroupId, or groupId). An unfiltered call is restricted to Signal House internal roles and will return 403 for all other roles.",
        "operationId": "number.readNumber",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by specific phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "registrationId",
            "in": "query",
            "required": false,
            "description": "Only numbers provisioned under this registration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currentTollFreeCarrier",
            "in": "query",
            "required": false,
            "description": "With groupId or subgroupId: when true, return only toll-free numbers that a new toll-free campaign in that group can use (those on the group's current toll-free carrier).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "released",
            "in": "query",
            "required": false,
            "description": "With subgroupId or groupId: when true, return only its released numbers (status RELEASED) instead of its active ones. Without it, group and subgroup lists leave released numbers out. Ignored on every other read.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "With campaignId, brandId, subgroupId or groupId: free text finds part of the phone number or its friendly name. A term made of digits and phone punctuation matches the number's digits, so `(512) 555` finds 15125550100. `field:` names phoneNumber or friendlyName. Repeat the param to send several values; every value must match. Each value is free text, or `field:term` to search one field. Each term is 3 to 100 characters, with at most 5 values; a shorter term returns 400. Works with the scoping filters above.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "campaignId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "registrationId": {},
                      "registrationStatus": {},
                      "phoneNumber": {
                        "type": "string"
                      },
                      "friendlyName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "capabilities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "shared": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "PENDING",
                          "IN_PROGRESS",
                          "READY",
                          "DEACTIVATED",
                          "RELEASED",
                          "PENDING_RELEASE"
                        ]
                      },
                      "nextBillingDate": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "leaseTermMonths": {},
                      "shortCodeLeaseType": {},
                      "leaseEndDate": {},
                      "sentiment": {
                        "type": "object",
                        "properties": {
                          "sevenDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "label": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scoredCount": {
                                "type": "integer"
                              },
                              "positive": {
                                "type": "integer"
                              },
                              "neutral": {
                                "type": "integer"
                              },
                              "negative": {
                                "type": "integer"
                              }
                            }
                          },
                          "thirtyDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "label": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "scoredCount": {
                                "type": "integer"
                              },
                              "positive": {
                                "type": "integer"
                              },
                              "neutral": {
                                "type": "integer"
                              },
                              "negative": {
                                "type": "integer"
                              }
                            }
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "health": {
                        "type": "object",
                        "properties": {
                          "sevenDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "optOutRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "optOutScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "messagesSent": {
                                "type": "integer"
                              },
                              "messagesDelivered": {
                                "type": "integer"
                              },
                              "messagesFailed": {
                                "type": "integer"
                              },
                              "optOuts": {
                                "type": "integer"
                              }
                            }
                          },
                          "thirtyDay": {
                            "type": "object",
                            "properties": {
                              "score": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "deliveryRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "optOutRate": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "deliveryScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "optOutScore": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "messagesSent": {
                                "type": "integer"
                              },
                              "messagesDelivered": {
                                "type": "integer"
                              },
                              "messagesFailed": {
                                "type": "integer"
                              },
                              "optOuts": {
                                "type": "integer"
                              }
                            }
                          },
                          "updatedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5c",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "campaignId": "C1234567",
                    "registrationId": null,
                    "registrationStatus": null,
                    "phoneNumber": "14175551234",
                    "friendlyName": "Customer Support Line",
                    "country": "US",
                    "type": "VIRTUAL_LONG_NUMBER",
                    "capabilities": [
                      "SMS",
                      "MMS"
                    ],
                    "shared": false,
                    "status": "READY",
                    "nextBillingDate": "2024-02-15T12:00:00.000Z",
                    "leaseTermMonths": null,
                    "shortCodeLeaseType": null,
                    "leaseEndDate": null,
                    "sentiment": {
                      "sevenDay": {
                        "score": 42,
                        "label": "positive",
                        "scoredCount": 128,
                        "positive": 96,
                        "neutral": 20,
                        "negative": 12
                      },
                      "thirtyDay": {
                        "score": 18,
                        "label": "neutral",
                        "scoredCount": 512,
                        "positive": 300,
                        "neutral": 150,
                        "negative": 62
                      },
                      "updatedAt": "2024-01-16T09:50:00.000Z"
                    },
                    "health": {
                      "sevenDay": {
                        "score": 9.5,
                        "deliveryRate": 94.2,
                        "optOutRate": 1.1,
                        "deliveryScore": 10,
                        "optOutScore": 9,
                        "messagesSent": 1240,
                        "messagesDelivered": 1168,
                        "messagesFailed": 31,
                        "optOuts": 14
                      },
                      "thirtyDay": {
                        "score": 9,
                        "deliveryRate": 91.8,
                        "optOutRate": 1.6,
                        "deliveryScore": 9,
                        "optOutScore": 8,
                        "messagesSent": 5310,
                        "messagesDelivered": 4875,
                        "messagesFailed": 210,
                        "optOuts": 85
                      },
                      "updatedAt": "2024-01-16T09:50:00.000Z"
                    },
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Purchase one or more available numbers and assign them to a subgroup.",
        "description": "Purchase one or more available numbers and assign them to a subgroup. Each number is queued and processed independently; per-number success or failure is delivered via NUMBER_PURCHASE_SUCCESSFUL or NUMBER_PURCHASE_FAILED webhooks. Every US and Canadian number must be able to take voice calls: before anything is reserved or charged, each number is checked with the connectivity provider, and one that can't take voice, or is no longer offered, fails with NUMBER_PURCHASE_FAILED and is not charged. Include 1 followed by the 10-digit number (e.g. 14175551234); a bare 10-digit number can pass validation but is not normalized and can fail during fulfillment. There is no mock or test flag for number purchase - every purchase is billed, including numbers bought under a mock brand. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, at most 1 new number may be purchased per day per connection, Short Code, Toll-Free and long-code purchases together (port-ins excluded). A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "number.purchaseNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Number purchase request has been queued successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Numbers"
        ],
        "summary": "Release purchased numbers back to the provider.",
        "description": "Release purchased numbers back to the provider. A UK Virtual Long Code number also moves from its registration's data.phoneNumbers to data.releasedNumbers, and keeps its registrationId.",
        "operationId": "number.deleteNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Number deletion has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/assign/{campaignId}": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Assign numbers to an active campaign.",
        "description": "Assign numbers to an active campaign. Numbers that are not found, already RELEASED, already assigned to a different campaign, on a mismatched DCA, or on an Infobip Toll-Free campaign that is not yet ACTIVE are skipped individually rather than failing the whole request. A 10DLC campaign without a number pool is also limited to 49 assigned numbers; if the remaining (valid) numbers would exceed that limit, numbers are queued only up to the remaining capacity and the rest are skipped too. Toll-Free and Short Code campaigns, and 10DLC campaigns with a number pool, are not subject to the 49-number limit. A Toll-Free campaign whose brand reports tollFree.maxNumbersPerCampaign as 1 holds one number: a request that would give it a second is refused with a 400, nothing is queued and no webhook fires. Every skipped number fires a NUMBER_ASSIGNMENT_FAILED webhook with the specific reason. A request in which none of the numbers match a stored number record is refused with a 400 before the campaign is checked, and no webhook fires. If every number that was found is still skipped — whether from the checks above or because none fit the campaign's remaining 49-number capacity — the request is also refused with a 400 instead of returning 202 with an empty queued array, so a caller can't mistake an all-skipped request for success; the error response's details carries the same { queued: [], skipped } breakdown a partial success would have returned, and each skipped number still fires its NUMBER_ASSIGNMENT_FAILED webhook with its specific reason before the request fails. For an Infobip Toll-Free campaign that is not yet ACTIVE (and not PENDING_DELETE or EXPIRED, which refuse the whole request with a 400 before any number is checked), every number not already skipped for another reason is skipped for this one, with one NUMBER_ASSIGNMENT_FAILED event listing only those numbers in identifier (numbers skipped for other reasons get a separate event per reason) and the reason campaign {campaignId} is an Infobip Toll-Free campaign that is not yet ACTIVE (status: {status}). This reason counts toward the all-skipped check above: if every eligible number in the request is skipped for it — the common case, since a request is normally sent to one specific not-yet-active Toll-Free campaign — the request is refused with a 400 and { queued: [], skipped }, the same as any other all-skipped request, not 202. The check runs again when a number that did queue (because another number in the same request was valid, or the campaign was still ACTIVE at enqueue time) actually executes: if the campaign has stopped being ACTIVE by then, the numbers that were returned in queued are not assigned, and one NUMBER_ASSIGNMENT_FAILED event lists them with the reason campaign is an Infobip Toll-Free campaign that is not yet ACTIVE (status: {status}). If the campaign has reached PENDING_DELETE or EXPIRED by then, the failure reason is the campaign's terminal state instead.",
        "operationId": "number.assignNumbersToCampaign",
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Campaign ID to attach to."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignNumbersToCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    },
                    "queued": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "Message": "19 number(s) queued for assignment to campaign C1234567. 11 number(s) skipped.",
                  "queued": [
                    "12345678901"
                  ],
                  "skipped": [
                    "12345678999"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/available": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Search available US 10DLC numbers.",
        "description": "Search available US 10DLC numbers. Every US and Canadian number offered can take voice calls, whatever capability filters are sent: a number that can't is never offered and can't be bought. City filters are applied before the result limit using the group's selected provider. Filtered catalog discovery has a 20-second deadline and returns HTTP 503 when incomplete. Narrow the location, area code or NXX, or retry later. Infobip samples may be cached for 15 seconds. numberCount is optional and omitted when the total is unknown, including these filtered searches; the page length is not the total.",
        "operationId": "number.readNumbersForPurchase",
        "parameters": [
          {
            "name": "smsEnabled",
            "in": "query",
            "required": false,
            "description": "Filter by SMS capability.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "mmsEnabled",
            "in": "query",
            "required": false,
            "description": "Filter by MMS capability.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "voiceEnabled",
            "in": "query",
            "required": false,
            "description": "Filter by voice capability. US and Canadian numbers are always voice-capable, so it only narrows other countries.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "2-letter country code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "2-letter state or province code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "Case-insensitive city prefix (1–100 characters). Requires country US and state.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "npa",
            "in": "query",
            "required": false,
            "description": "3-digit area code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nxx",
            "in": "query",
            "required": false,
            "description": "3-digit central office code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Search by phone number pattern.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results to return.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "string"
                          },
                          "country": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "npa": {
                            "type": "string"
                          },
                          "nxx": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "numbers": [
                    {
                      "number": "14175559876",
                      "country": "US",
                      "type": "LONG_CODE",
                      "capabilities": [
                        "SMS",
                        "VOICE",
                        "MMS"
                      ],
                      "npa": "417",
                      "nxx": "555"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/deactivate": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Deactivate one or more phone numbers.",
        "description": "Deactivate one or more phone numbers. Numbers must be in READY status. Deactivated numbers cannot send or receive messages but remain assigned to their subgroup and campaign.",
        "operationId": "number.deactivateNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "phoneNumber": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "friendlyName": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "phoneNumber": "14175551234",
                    "status": "DEACTIVATED",
                    "friendlyName": "Main Line",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/health": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Return the portal-parity phone number health score (1–10) for an owned number.",
        "description": "Return the portal-parity phone number health score (1–10) for an owned number. The score is the average of delivery-rate and opt-out-rate sub-scores, computed from message analytics over rolling 7-day and 30-day windows — the same values shown in the portal Numbers table. Requires message traffic in each window; when no messages were sent, score is null and hasData is false.",
        "operationId": "number.readNumberHealth",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "query",
            "required": true,
            "description": "Owned phone number to score (11 digits, no + prefix).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumber": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "sevenDay": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "deliveryRate": {
                          "type": "number"
                        },
                        "optOutRate": {
                          "type": "number"
                        },
                        "deliveryScore": {
                          "type": "integer"
                        },
                        "optOutScore": {
                          "type": "integer"
                        },
                        "hasData": {
                          "type": "boolean"
                        }
                      }
                    },
                    "thirtyDay": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "number"
                        },
                        "deliveryRate": {
                          "type": "integer"
                        },
                        "optOutRate": {
                          "type": "number"
                        },
                        "deliveryScore": {
                          "type": "integer"
                        },
                        "optOutScore": {
                          "type": "integer"
                        },
                        "hasData": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "phoneNumber": "14175551234",
                  "groupId": "G1234567",
                  "sevenDay": {
                    "score": 8.5,
                    "deliveryRate": 91.2,
                    "optOutRate": 1.1,
                    "deliveryScore": 9,
                    "optOutScore": 8,
                    "hasData": true
                  },
                  "thirtyDay": {
                    "score": 7.5,
                    "deliveryRate": 85,
                    "optOutRate": 2.2,
                    "deliveryScore": 8,
                    "optOutScore": 7,
                    "hasData": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/lookup": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Search NPA/NXX lookup data to find available area codes and central office codes.",
        "description": "Search NPA/NXX lookup data to find available area codes and central office codes. At least one of country, state, city, npa, or nxx is required. Results are limited to 1,000 for country-only queries. Response shape depends on query params: (1) Location queries (country/state/city without npa/nxx) return { uniqueNPA: string[], uniqueNXX: string[]|null } — uniqueNXX is only populated when city is provided. (2) NPA/NXX queries return an array of { npa, nxx, city, state, country } objects. Country may scope NPA/NXX queries (for example, country=US&npa=512); state and city cannot be combined with NPA/NXX.",
        "operationId": "number.searchNpaNxx",
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "2-letter country code (e.g., US). At least one of country, state, city, npa, or nxx must be provided.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "2-letter state code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "description": "City name (prefix match, case-insensitive). When city is provided, both country and state are required or the request will be rejected with a 400 error.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "npa",
            "in": "query",
            "required": false,
            "description": "1-3 digit area code. Returns an array of NPA/NXX objects. May include country, but not state or city.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nxx",
            "in": "query",
            "required": false,
            "description": "1-3 digit central office code. Returns an array of NPA/NXX objects. May include country, but not state or city.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uniqueNPA": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "uniqueNXX": {}
                  }
                },
                "example": {
                  "uniqueNPA": [
                    "417",
                    "816"
                  ],
                  "uniqueNXX": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/lookup/location": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Batch lookup location data for NPA/NXX pairs.",
        "description": "Batch lookup location data for NPA/NXX pairs.",
        "operationId": "number.lookupLocations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookupLocationsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "npa": {
                        "type": "string"
                      },
                      "nxx": {
                        "type": "string"
                      },
                      "city": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "npa": "417",
                    "nxx": "555",
                    "city": "Springfield",
                    "state": "MO"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/migrate": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Migrate a phone number (or all numbers in a campaign/group) from v1 to v2.",
        "description": "Migrate a phone number (or all numbers in a campaign/group) from v1 to v2. This is a permanent, irreversible operation that updates the Infobip configuration so inbound SMS/MMS webhooks are routed to v2. Priority: phoneNumber > campaignId > groupId. Some toll-free numbers were never on v1, so they have nothing to migrate: one sent as phoneNumber is refused with a 400 and nothing is queued, and a campaign or group migration leaves them out.",
        "operationId": "number.migrateNumberTov2",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MigrateNumberTov2Request"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "1 number(s) queued for migration to v2"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/portin": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Submit a port-in request for one or more phone numbers from another provider.",
        "description": "Submit a port-in request for one or more phone numbers from another provider. This creates a port-in request record that is processed manually by Signal House staff.",
        "operationId": "number.portInNumber",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "portingRequestType": {
                    "type": "string",
                    "description": "\"Business\" or \"Personal\"."
                  },
                  "businessName": {
                    "type": "string",
                    "description": "Required when portingRequestType is \"Business\"."
                  },
                  "portingService": {
                    "type": "string",
                    "description": "\"Messaging Service\" or \"Entire Service\"."
                  },
                  "ownersName": {
                    "type": "string",
                    "description": "Name as it appears on the bill."
                  },
                  "ownersEmail": {
                    "type": "string",
                    "description": "Owner's email address."
                  },
                  "authorizedPersonsName": {
                    "type": "string",
                    "description": "Authorized person's name."
                  },
                  "phoneNumber": {
                    "type": "string",
                    "description": "Contact phone number if different than owner."
                  },
                  "ownersStreetAddress": {
                    "type": "string",
                    "description": "Owner's street address."
                  },
                  "ownersExtendedAddress": {
                    "type": "string",
                    "description": "Address line 2."
                  },
                  "ownersCountry": {
                    "type": "string",
                    "description": "Owner's country."
                  },
                  "ownersState": {
                    "type": "string",
                    "description": "Owner's state."
                  },
                  "ownersCity": {
                    "type": "string",
                    "description": "Owner's city."
                  },
                  "ownersPostalCode": {
                    "type": "string",
                    "description": "Owner's postal code."
                  },
                  "serviceAddress": {
                    "type": "string",
                    "description": "Service address."
                  },
                  "serviceExtendedAddress": {
                    "type": "string",
                    "description": "Service address line 2."
                  },
                  "serviceCountry": {
                    "type": "string",
                    "description": "Service country."
                  },
                  "serviceState": {
                    "type": "string",
                    "description": "Service state."
                  },
                  "serviceCity": {
                    "type": "string",
                    "description": "Service city."
                  },
                  "servicePostalCode": {
                    "type": "string",
                    "description": "Service postal code."
                  },
                  "phoneNumberToBePorted": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of phone numbers to port, in E.164 format with the country code (for example +14155551234). The leading + is optional and a bare 10-digit number is read as US/Canada. Each number is stored and returned as E.164 digits without the + (14155551234), and duplicates are removed. A value that is not a valid phone number is refused with a 400. Numbers from a country that requires a sender registration (for example the UK) cannot be ported in and are refused with a 400; obtain them through a registration instead."
                  },
                  "cellNumberOrLandline": {
                    "type": "string",
                    "description": "\"Cell\" or \"Landline/VOIP\"."
                  },
                  "accountNumber": {
                    "type": "string",
                    "description": "Required when cellNumberOrLandline is \"Cell\"."
                  },
                  "pinOrPasscode": {
                    "type": "string",
                    "description": "Required when portingService is \"Entire Service\"."
                  },
                  "billingUrl": {
                    "type": "string",
                    "description": "Base64 data URL of the billing statement PDF. Required when portingService is \"Entire Service\". Maximum 5 MB raw file size."
                  },
                  "groupId": {
                    "type": "string",
                    "description": "Group ID."
                  },
                  "subGroupId": {
                    "type": "string",
                    "description": "Subgroup ID."
                  },
                  "brandId": {
                    "type": "string",
                    "description": "Brand ID."
                  },
                  "campaignId": {
                    "type": "string",
                    "description": "Campaign ID."
                  },
                  "comments": {
                    "type": "string",
                    "description": "Additional comments."
                  },
                  "signatureUrl": {
                    "type": "string",
                    "description": "Base64 data URL of signature image."
                  }
                },
                "required": [
                  "portingRequestType",
                  "portingService",
                  "ownersName",
                  "ownersEmail",
                  "authorizedPersonsName",
                  "ownersStreetAddress",
                  "ownersCountry",
                  "ownersState",
                  "ownersCity",
                  "ownersPostalCode",
                  "serviceAddress",
                  "serviceCountry",
                  "serviceState",
                  "serviceCity",
                  "servicePostalCode",
                  "phoneNumberToBePorted",
                  "cellNumberOrLandline",
                  "groupId",
                  "signatureUrl"
                ]
              },
              "example": {
                "portingRequestType": "Business",
                "businessName": "Acme Corp",
                "portingService": "Messaging Service",
                "ownersName": "John Doe",
                "ownersEmail": "john@acme.com",
                "authorizedPersonsName": "John Doe",
                "ownersStreetAddress": "123 Main St",
                "ownersCountry": "US",
                "ownersState": "CA",
                "ownersCity": "San Francisco",
                "ownersPostalCode": "94105",
                "serviceAddress": "123 Main St",
                "serviceCountry": "US",
                "serviceState": "CA",
                "serviceCity": "San Francisco",
                "servicePostalCode": "94105",
                "phoneNumberToBePorted": [
                  "14155551234"
                ],
                "cellNumberOrLandline": "Landline/VOIP",
                "groupId": "G1234567",
                "signatureUrl": "data:image/png;base64,..."
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "portingRequestType": {
                      "type": "string",
                      "enum": [
                        "Business",
                        "Personal"
                      ]
                    },
                    "businessName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "portingService": {
                      "type": "string",
                      "enum": [
                        "Messaging Service",
                        "Entire Service"
                      ]
                    },
                    "ownersName": {
                      "type": "string"
                    },
                    "ownersEmail": {
                      "type": "string"
                    },
                    "authorizedPersonsName": {
                      "type": "string"
                    },
                    "phoneNumberToBePorted": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cellNumberOrLandline": {
                      "type": "string",
                      "enum": [
                        "Cell",
                        "Landline/VOIP"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "IN_PROGRESS",
                        "ON_HOLD",
                        "REJECTED",
                        "SUCCESS"
                      ]
                    },
                    "statusHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5d",
                  "groupId": "G1234567",
                  "userId": "60f7b2a1c9e77c001a2b3c61",
                  "portingRequestType": "Business",
                  "businessName": "Acme Corporation LLC",
                  "portingService": "Entire Service",
                  "ownersName": "John Doe",
                  "ownersEmail": "john@acme.com",
                  "authorizedPersonsName": "John Doe",
                  "phoneNumberToBePorted": [
                    "14155551234"
                  ],
                  "cellNumberOrLandline": "Landline/VOIP",
                  "status": "PENDING",
                  "statusHistory": [
                    {
                      "status": "PENDING",
                      "description": "Initial status",
                      "date": "2024-01-15T12:00:00.000Z"
                    }
                  ],
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Retrieve port-in requests.",
        "description": "Retrieve port-in requests. Signal House staff can view all requests; regular users see only their group's requests. Supports filtering by groupId, phoneNumber, and status.",
        "operationId": "number.readPortInRequests",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: PENDING, IN_PROGRESS, ON_HOLD, REJECTED, SUCCESS. When ON_HOLD, the response includes an onHoldReason field (e.g. DOCUMENTATION_MISMATCH, ACCOUNT_INFO_INCORRECT, CARRIER_REJECTED, PENDING_CUSTOMER_ACTION, OTHER) set by Signal House staff — Infobip exposes no porting-status API or webhook, so this is never synced automatically.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default: 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Items per page (default: 20, max: 1000).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "excludeDocuments",
            "in": "query",
            "required": false,
            "description": "Set to true to leave signatureUrl and billingUrl out of each request. They hold the inline LOA signature and billing statement, which can be several MB each; fetch one request with GET /number/portin/:id when you need them. Default: false.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "portingRequestType": {
                            "type": "string"
                          },
                          "businessName": {
                            "type": "string"
                          },
                          "ownersName": {
                            "type": "string"
                          },
                          "phoneNumberToBePorted": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "status": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "_id": "60f7b2a1c9e77c001a2b3c5d",
                      "groupId": "G1234567",
                      "portingRequestType": "Business",
                      "businessName": "Acme Corp",
                      "ownersName": "John Doe",
                      "phoneNumberToBePorted": [
                        "14155551234"
                      ],
                      "status": "PENDING",
                      "createdAt": "2024-01-15T12:00:00.000Z",
                      "updatedAt": "2024-01-15T12:00:00.000Z"
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 20,
                  "totalPages": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/portin/{id}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Retrieve a single port-in request by its ID.",
        "description": "Retrieve a single port-in request by its ID. Signal House staff can view any request; regular users can only view requests belonging to their group.",
        "operationId": "number.readPortInRequestById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The _id of the port-in request."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "portingRequestType": {
                      "type": "string"
                    },
                    "businessName": {
                      "type": "string"
                    },
                    "ownersName": {
                      "type": "string"
                    },
                    "ownersEmail": {
                      "type": "string"
                    },
                    "phoneNumberToBePorted": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cellNumberOrLandline": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "statusHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5d",
                  "groupId": "G1234567",
                  "portingRequestType": "Business",
                  "businessName": "Acme Corp",
                  "ownersName": "John Doe",
                  "ownersEmail": "john@acme.com",
                  "phoneNumberToBePorted": [
                    "14155551234"
                  ],
                  "cellNumberOrLandline": "Landline/VOIP",
                  "status": "PENDING",
                  "statusHistory": [
                    {
                      "status": "PENDING",
                      "description": "Initial status",
                      "date": "2024-01-15T12:00:00.000Z"
                    }
                  ],
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/reactivate": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Reactivate one or more previously deactivated phone numbers.",
        "description": "Reactivate one or more previously deactivated phone numbers. Numbers must be in DEACTIVATED status. Reactivated numbers return to PENDING or IN_PROGRESS status depending on their campaign assignment.",
        "operationId": "number.reactivateNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "phoneNumber": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "friendlyName": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "phoneNumber": "14175551234",
                    "status": "PENDING",
                    "friendlyName": "Main Line",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/short-code": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Request a Short Code for an existing Short Code campaign.",
        "description": "Request a Short Code for an existing Short Code campaign. Send the complete JSON request payload in the acquisitionData multipart field. Requires the shortCodeEnabled feature flag and a matching subgroup, brand, and campaign. RANDOM and VANITY create a pending acquisition request for Signal House staff fulfillment and reserve the group's shortCodeActivation plus shortCodeMmsEnablement fees on the wallet (the request fails with 402 when the available balance cannot cover them); the total is returned as reservedAmount and released (and any charged fees refunded) if the campaign is cancelled first. A placeholder number (phoneNumber 'SC-PENDING-<requestId>', status PENDING, type SHORT_CODE) is created immediately and appears in GET /number until staff issue the code, when the same record takes the real code. At issue the fees are charged first as separate 'Short Code Activation' and 'Short Code MMS Enablement' transactions (referenceId <campaignId>:<requestId>:activation and :mms, never charged twice), then the number is issued with a nextBillingDate; it is charged shortCodeLeaseMonthly (RANDOM) or shortCodeVanityLeaseMonthly (VANITY) each month until its lease end date, and messaging is suspended (never released) if renewals repeatedly fail. NUMBER_PURCHASE_SUCCESSFUL / NUMBER_PURCHASE_FAILED webhooks fire like other number purchases. EXTERNAL_LEASE requires a private receipt, charges the same activation and MMS enablement fees immediately, then creates and assigns the customer-owned Short Code number in PENDING status and links its receipt artifact (a failure after the charge refunds it); it becomes READY when the campaign becomes ACTIVE and is never charged a monthly lease. All issued Short Codes have an immutable, non-renewable lease end date and are deactivated when that lease ends. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, a Short Code request counts as 1 new number against the per-connection limit of 1 per day, shared with Toll-Free and long-code purchases. A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is stored or reserved, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "number.requestShortCodeAcquisition",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "acquisitionData": {
                    "type": "string",
                    "contentMediaType": "application/json",
                    "description": "The complete JSON acquisition payload in a multipart field named acquisitionData. The nested fields below belong in this JSON value.",
                    "properties": {
                      "subgroupId": {
                        "type": "string",
                        "description": "Owning subgroup ID; must match the brand and campaign."
                      },
                      "brandId": {
                        "type": "string",
                        "description": "Existing Short Code brand ID; must match the campaign."
                      },
                      "campaignId": {
                        "type": "string",
                        "description": "Existing Short Code campaign ID."
                      },
                      "requestType": {
                        "type": "string",
                        "description": "RANDOM, VANITY, or EXTERNAL_LEASE."
                      },
                      "leaseTermMonths": {
                        "type": "number",
                        "description": "Required for RANDOM and VANITY: 3, 6, or 12. Not used for EXTERNAL_LEASE."
                      },
                      "requestedVanityCode": {
                        "type": "string",
                        "description": "Required only for VANITY: desired five- or six-digit code."
                      },
                      "actualCode": {
                        "type": "string",
                        "description": "Required for EXTERNAL_LEASE: customer-owned five- or six-digit Short Code."
                      },
                      "orderId": {
                        "type": "string",
                        "description": "Required for EXTERNAL_LEASE: Registry order ID."
                      },
                      "leaseEndDate": {
                        "type": "string",
                        "description": "Required for EXTERNAL_LEASE: future ISO 8601 lease end date. A date-only value (YYYY-MM-DD) expires at 23:59:59 UTC on that date."
                      }
                    },
                    "required": [
                      "subgroupId",
                      "brandId",
                      "campaignId",
                      "requestType"
                    ]
                  },
                  "leaseReceipt": {
                    "type": "string",
                    "format": "binary",
                    "description": "Required for EXTERNAL_LEASE: PNG, JPEG, or PDF receipt; maximum 10MB."
                  }
                },
                "required": [
                  "acquisitionData"
                ]
              },
              "example": {
                "subgroupId": "S1234567",
                "brandId": "B1234567",
                "campaignId": "C1234567",
                "requestType": "VANITY",
                "requestedVanityCode": "54321",
                "leaseTermMonths": 12
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "FULFILLED",
                        "CANCELLED"
                      ]
                    },
                    "requestType": {
                      "type": "string",
                      "enum": [
                        "RANDOM",
                        "VANITY",
                        "EXTERNAL_LEASE"
                      ]
                    },
                    "leaseTermMonths": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "reservedAmount": {
                      "type": "integer"
                    },
                    "reservedActivationAmount": {
                      "type": "integer"
                    },
                    "reservedMmsEnablementAmount": {
                      "type": "integer"
                    },
                    "chargedAmount": {},
                    "lastError": {}
                  }
                },
                "example": {
                  "requestId": "SCAR123456",
                  "status": "PENDING",
                  "requestType": "VANITY",
                  "leaseTermMonths": 12,
                  "reservedAmount": 1500000000,
                  "reservedActivationAmount": 1000000000,
                  "reservedMmsEnablementAmount": 500000000,
                  "chargedAmount": null,
                  "lastError": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/toll-free": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Purchase one or more Toll-Free numbers and assign them to a subgroup.",
        "description": "Purchase one or more Toll-Free numbers and assign them to a subgroup. Numbers are provisioned asynchronously via the connectivity provider's resource-request flow; per-number success or failure is delivered via NUMBER_PURCHASE_SUCCESSFUL or NUMBER_PURCHASE_FAILED webhooks. Toll-Free numbers cannot be hand-picked — request a quantity instead. They are ordered with SMS and voice, and each number's capabilities are recorded as the provider reports them. Requires the tollFreeEnabled feature flag on the group. For an OAuth connector token, or a request with the X-SignalHouse-Origin: mcp header, at most 1 new number may be purchased per day per connection, Short Code, Toll-Free and long-code purchases together (port-ins excluded). A breach is refused with 429 and details.code CONNECTOR_CAP_EXCEEDED, nothing is queued or charged, and a Retry-After header says when the window resets. See Error Handling.",
        "operationId": "number.purchaseTollFreeNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseTollFreeNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "orderId": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Toll-free number purchase request has been queued successfully",
                  "orderId": "TFNO7K3M9QXR2V"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/toll-free/order/{orderId}": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Report the outcome of a Toll-Free number purchase by the orderId returned from POST /number/toll-free.",
        "description": "Report the outcome of a Toll-Free number purchase by the orderId returned from POST /number/toll-free. Each requested number is reported as ready, provisioning, or failed (with a reason), so a client can poll until the order is fully settled. The provisioned phone numbers for the order are returned in numbers (empty until each number is provisioned, filling in as the order completes), so a client can act on exactly that order's numbers. An orderId polled before the order's records exist returns all-zero counts (still provisioning).",
        "operationId": "number.readTollFreeOrderStatus",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The order id returned by POST /number/toll-free."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "string"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "ready": {
                          "type": "integer"
                        },
                        "provisioning": {
                          "type": "integer"
                        },
                        "failed": {
                          "type": "integer"
                        }
                      }
                    },
                    "failures": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "numbers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "orderId": "TFNO7K3M9QXR2V",
                  "counts": {
                    "ready": 1,
                    "provisioning": 0,
                    "failed": 1
                  },
                  "failures": [
                    {
                      "reason": "Number not eligible for the requested use case."
                    }
                  ],
                  "numbers": [
                    "18005551234"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/transfer": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Transfer an unassigned phone number to a new subgroup.",
        "description": "Transfer an unassigned phone number to a new subgroup. Some groups verify each subgroup's business separately: a platform whose subgroups are separate businesses, set up by Signal House. In those groups a toll-free number held in its subgroup's own carrier account can't move to another subgroup: the request is refused with a 400 that names the number, and no number is moved.",
        "operationId": "number.transferPhoneNumbers",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferUnassignedNumbersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {},
                      "campaignId": {},
                      "phoneNumber": {
                        "type": "string"
                      },
                      "friendlyName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "country": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "capabilities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "shared": {
                        "type": "boolean"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "PENDING",
                          "IN_PROGRESS",
                          "READY",
                          "DEACTIVATED",
                          "RELEASED",
                          "PENDING_RELEASE"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c66",
                    "groupId": "G1234567",
                    "subgroupId": "S7654321",
                    "brandId": null,
                    "campaignId": null,
                    "phoneNumber": "14175551234",
                    "friendlyName": "Customer Support Line",
                    "country": "US",
                    "type": "VIRTUAL_LONG_NUMBER",
                    "capabilities": [
                      "SMS",
                      "MMS",
                      "VOICE"
                    ],
                    "shared": false,
                    "status": "READY",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-16T14:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/unassign": {
      "post": {
        "tags": [
          "Numbers"
        ],
        "summary": "Unassign numbers from their active campaigns.",
        "description": "Unassign numbers from their active campaigns.",
        "operationId": "number.unassignNumbersFromCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnassignNumbersFromCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "Message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "Message": "Number unassignment from campaigns has been queued successfully."
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/{phoneNumber}": {
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Update details for a specific phone number.",
        "description": "Update details for a specific phone number. An OAuth connector token granted specific scopes also needs the messaging scope to set primaryInboundWebhookUrl or secondaryInboundWebhookUrl, and gets a 403 without it; clearing them needs only numbers.",
        "operationId": "number.updateNumber",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNumberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "phoneNumber": {
                      "type": "string"
                    },
                    "friendlyName": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5c",
                  "phoneNumber": "14175551234",
                  "friendlyName": "Customer Support Line",
                  "status": "READY",
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/number/{phoneNumber}/cnam": {
      "get": {
        "tags": [
          "Numbers"
        ],
        "summary": "Read a number's outbound caller name (CNAM): the name US carriers show for calls from it.",
        "description": "Read a number's outbound caller name (CNAM): the name US carriers show for calls from it. Returns the name, whether it was set on the number (MANUAL), comes from the brand's caller name (BRAND, see PUT /brand/cnam/:brandId) or from the subgroup's auto-apply (AUTO), the brand it comes from, and whether the number can have one. Caller names are available for US and Canadian local numbers.",
        "operationId": "number.readNumberCnam",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number (E.164, leading + optional)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumber": {
                      "type": "string"
                    },
                    "cnam": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "brandId": {
                          "type": "string"
                        },
                        "brandFrom": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "reason": {},
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "autoApply": {
                      "type": "boolean"
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "ineligibleReason": {}
                  }
                },
                "example": {
                  "phoneNumber": "14175551234",
                  "cnam": {
                    "name": "Signal House",
                    "source": "AUTO",
                    "brandId": "B1A2C3D",
                    "brandFrom": "CAMPAIGN",
                    "status": "ACTIVE",
                    "reason": null,
                    "updatedAt": "2026-10-21T18:00:00.000Z"
                  },
                  "autoApply": true,
                  "eligible": true,
                  "ineligibleReason": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Numbers"
        ],
        "summary": "Set a number's caller name.",
        "description": "Set a number's caller name. The name must come from the registered name of the number's brand, with characters only removed (“Signal House, LLC” can become “Signal House” or “Sig Hou”, not “Signal House Team”). The brand is the number's campaign brand; for a number with no campaign, pass brandId (a verified brand in the number's subgroup) or the subgroup's default caller-ID brand is used. A name set here overrides the brand's caller name and auto-apply. Carriers can take a few days to start showing a new name. Returns 400 if the name or brand isn't allowed or the number can't have a caller name.",
        "operationId": "number.setNumberCnam",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number (E.164, leading + optional)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetNumberCnamRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumber": {
                      "type": "string"
                    },
                    "cnam": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        },
                        "brandId": {
                          "type": "string"
                        },
                        "brandFrom": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "reason": {},
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "autoApply": {
                      "type": "boolean"
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "ineligibleReason": {}
                  }
                },
                "example": {
                  "phoneNumber": "14175551234",
                  "cnam": {
                    "name": "Signal House",
                    "source": "MANUAL",
                    "brandId": "B1A2C3D",
                    "brandFrom": "CAMPAIGN",
                    "status": "ACTIVE",
                    "reason": null,
                    "updatedAt": "2026-10-21T18:00:00.000Z"
                  },
                  "autoApply": false,
                  "eligible": true,
                  "ineligibleReason": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Numbers"
        ],
        "summary": "Remove a number's own caller name.",
        "description": "Remove a number's own caller name. The number goes back to its brand's caller name if the brand has one, else to the automatic name if its subgroup has caller name auto-apply on; otherwise it has no caller name.",
        "operationId": "number.deleteNumberCnam",
        "parameters": [
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The phone number (E.164, leading + optional)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "phoneNumber": {
                      "type": "string"
                    },
                    "cnam": {},
                    "autoApply": {
                      "type": "boolean"
                    },
                    "eligible": {
                      "type": "boolean"
                    },
                    "ineligibleReason": {}
                  }
                },
                "example": {
                  "phoneNumber": "14175551234",
                  "cnam": null,
                  "autoApply": false,
                  "eligible": true,
                  "ineligibleReason": null
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/oauth/authorize": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Start an authorization.",
        "description": "Start an authorization. This is a browser navigation: send the user here with a PKCE S256 challenge, and Signal House redirects them back with a single-use code.",
        "operationId": "oauth.authorize",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "description": "Must be code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "description": "The client_id returned by registration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "Must exactly match one of the URIs you registered. It is compared as a whole string, not by prefix.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "description": "Base64url SHA-256 digest of your code verifier, 43 to 128 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "description": "Must be S256. The plain method is not accepted.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Opaque value returned unchanged on the redirect. Use it for CSRF protection. Maximum 512 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Space-separated scopes to request. Maximum 500 characters. Omit it, or send none of the values listed under Token scope, to request full access. Unknown values are ignored.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/oauth/connections": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "List the applications the signed-in user has connected.",
        "description": "List the applications the signed-in user has connected.",
        "operationId": "oauth.readConnections",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/oauth/connections/revoke": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Disconnect an application from the signed-in user's account and revoke every grant the user gave it.",
        "description": "Disconnect an application from the signed-in user's account and revoke every grant the user gave it.",
        "operationId": "oauth.disconnect",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/oauth/consent": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Record the signed-in user's decision on a pending authorization.",
        "description": "Record the signed-in user's decision on a pending authorization. Signal House's own approval screen calls this; an OAuth client does not.",
        "operationId": "oauth.consent",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizeConsentRequest"
              }
            }
          }
        }
      }
    },
    "/oauth/consent-request": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Read a pending authorization for the signed-in user.",
        "description": "Read a pending authorization for the signed-in user. Signal House's own approval screen calls this with the user's session token; an OAuth client does not.",
        "operationId": "oauth.readConsentRequest",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/oauth/register": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Dynamic client registration (RFC 7591).",
        "description": "Dynamic client registration (RFC 7591). Register your application once and keep the returned client_id. No client secret is issued.",
        "operationId": "oauth.registerClient",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterClientRequest"
              }
            }
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Token revocation (RFC 7009).",
        "description": "Token revocation (RFC 7009). Surrender a refresh token when your application no longer needs access; the whole chain is revoked.",
        "operationId": "oauth.revoke",
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The refresh token to revoke."
                  },
                  "client_id": {
                    "type": "string",
                    "description": "The client_id the token was issued to."
                  }
                },
                "required": [
                  "token",
                  "client_id"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": []
      }
    },
    "/oauth/token": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Exchange an authorization code for tokens, or a refresh token for a new pair.",
        "description": "Exchange an authorization code for tokens, or a refresh token for a new pair. Accepts application/x-www-form-urlencoded or JSON.",
        "operationId": "oauth.token",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequestRequest"
              }
            }
          }
        }
      }
    },
    "/rcs/agent": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Create an agent draft on a brand of any registration type, optionally with its campaign.",
        "description": "Create an agent draft on a brand of any registration type, optionally with its campaign. The draft may be incomplete; completeness is checked at submit. A brand or campaign id that belongs to a group you cannot view is answered as not found (404), the same as an unknown id. Send an Idempotency-Key header to retry safely.",
        "operationId": "registration.createAgent",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "description": "The brand, of any registration type (10DLC, toll-free or short code): its carrier brand ID, the provisional UUID, or its _id. It must be in your group and not deleted. The agent joins the brand's subgroup."
                  },
                  "campaignId": {
                    "description": "A campaign of that brand: its campaign ID or _id. It must not be rejected, expired or deleted. Optional on a draft; required before submit."
                  },
                  "agent": {
                    "description": "Profile: name (max 40), description (max 100), color (hex, default #6868ab; it must contrast at least 4.5:1 with white text), logoUrl and heroUrl (PNG or JPEG of exactly 224 × 224 under 50 KB and 1440 × 448 under 200 KB; an image not on our media host is fetched and checked at submit), phone (E.164), website, email, privacyPolicyUrl, termsUrl, and the captions phoneLabel, websiteLabel and emailLabel (max 40 each, plain text with no links or markup; blank defaults to Call, Website and Email at submit). URLs must be HTTPS. Required in full before submit, and kept complete once the agent exists at the carrier partner."
                  },
                  "consent": {
                    "description": "Launch text: optInDetails, optInUrl, optInResponse, optOutDetails, optOutResponse, helpResponse, campaignDescription, messageExamples (1–6), estimatedMonthlyVolume (UP_TO_10K, 10K_100K, 100K_500K, 500K_1M, 1M_PLUS), launchVideoUrl. Every field is required before the launch request, not before submit: the carrier partner's launch form requires each one, including the opt-in URL and the demonstration video, which is recorded during testing. optInDetails, optInResponse, optOutDetails, optOutResponse, helpResponse and campaignDescription are each at most 1,000 characters, the partner's cap. The partner takes messageExamples as one answer, so they must total 5 to 1,000 characters at the launch request. Blank fields fill from the linked campaign (messageFlow, optinMessage, optoutMessage, helpMessage, description, sample1–5) when it is linked. Copied text is shortened to fit these limits, and only the whole samples that fit are kept."
                  },
                  "contact": {
                    "description": "The individual at your company the carrier partner's reviewers may contact about the launch: firstName, lastName, role (3–75), email (an individual's business address; shared mailboxes such as support@ are refused) and mobile (E.164). Required in full before the launch request."
                  },
                  "useCase": {
                    "description": "OTP, TRANSACTIONAL, PROMOTIONAL or MULTI_USE. Required before submit."
                  },
                  "billingCategory": {
                    "description": "NON_CONVERSATIONAL (default) or CONVERSATIONAL. A non-conversational agent is billed per message. A conversational agent is billed per interactive session: 4 messages in 24 hours, at least 2 from the person and 1 from the agent, start a session that covers every message for 24 hours. Its messages are charged as they happen. Each day, two rows reprice the sessions that closed the day before: an RCS Session Adjustment for the Signal House session fee, and an RCS Session Carrier Adjustment for the carrier's session rate, passed through at cost. Locked once a launch has been requested."
                  },
                  "defaultFallback": {
                    "description": "{ mode (auto, rcs_only, sms_only, none), channel (auto, sms, mms), from }. from must be a number assigned to the linked campaign."
                  },
                  "excludedCarriers": {
                    "description": "[] (default) or [\"T_MOBILE\"] to skip the T-Mobile launch. The value is the carrier partner's carrier name. Once T-Mobile has launched the agent, an edit that changes this list gets a 409."
                  },
                  "autofill": {
                    "description": "Where the fields you prefilled came from, keyed by field path (agent.*, consent.* or contact.*, for example consent.optInDetails): { source (brand, campaign or landing), sourceId, at, edited }. Signal House adds its own markers for the fields it fills from the linked campaign or the brand's landing page. On an update, autofill replaces the stored markers; leave it out to keep them, and a stored marker turns edited: true once its field's value changes. A marker on a blank field is dropped."
                  },
                  "testers": {
                    "description": "Up to 200 distinct US numbers to invite as testers. Once the agent is IN_TESTING, each number you add is invited at the carrier partner (up to 20 a day) and testerInvites reports the invitation's status; a number you remove here is marked REMOVED within a minute, and DELETE /rcs/agent/:agentId/testers/:phoneNumber removes one at once. A number that does not accept within 24 hours is EXPIRED and stays so until you resend its invitation. Saving only testers does not resubmit the agent to the carrier partner."
                  }
                },
                "required": [
                  "brandId"
                ]
              },
              "example": {
                "brandId": "B1A2C3D",
                "campaignId": "C4E5F6G",
                "agent": {
                  "name": "Acme Alerts",
                  "description": "Order and delivery alerts from Acme",
                  "color": "#6868ab",
                  "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                  "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                  "phone": "+18005550142",
                  "phoneLabel": "Call",
                  "website": "https://www.acme.example",
                  "websiteLabel": "Website",
                  "email": "support@acme.example",
                  "emailLabel": "Email",
                  "privacyPolicyUrl": "https://www.acme.example/privacy",
                  "termsUrl": "https://www.acme.example/terms"
                },
                "consent": {
                  "estimatedMonthlyVolume": "UP_TO_10K"
                },
                "contact": {
                  "firstName": "Ada",
                  "lastName": "Lovelace",
                  "role": "Marketing lead",
                  "email": "ada.lovelace@acme.example",
                  "mobile": "+15125550101"
                },
                "useCase": "TRANSACTIONAL",
                "defaultFallback": {
                  "from": "15125550100"
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {},
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {}
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "DRAFT",
                  "registrationStatus": "DRAFT",
                  "stage": null,
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "get": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "List agents, newest first.",
        "description": "List agents, newest first. brandId and campaignId return the agents linked to that brand or campaign.",
        "operationId": "registration.listAgents",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Group to list. Omitted lists every group you can view.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Only agents in this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "DRAFT, PENDING_REVIEW, REJECTED, AGENT_CREATING, ARCHIVE_PENDING or ARCHIVED; one value or a comma-separated list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Only agents linked to this brand (carrier brand ID, provisional UUID or _id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Only agents linked to this campaign (campaign ID or _id).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (default 25, maximum 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "agentId": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "registrationStatus": {
                            "type": "string"
                          },
                          "stage": {},
                          "brandId": {
                            "type": "string"
                          },
                          "brandRef": {
                            "type": "string"
                          },
                          "campaignId": {
                            "type": "string"
                          },
                          "campaignRef": {
                            "type": "string"
                          },
                          "links": {
                            "type": "object",
                            "properties": {
                              "brand": {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string"
                                  },
                                  "brandRef": {
                                    "type": "string"
                                  },
                                  "brandId": {
                                    "type": "string"
                                  },
                                  "displayName": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": [
                                      "string",
                                      "null"
                                    ],
                                    "enum": [
                                      "PENDING_CREATION",
                                      "PENDING_APPROVAL",
                                      "UNVERIFIED",
                                      "VERIFIED",
                                      "VETTED_VERIFIED",
                                      "PENDING_DELETE",
                                      "DELETED",
                                      "DCA_PENDING",
                                      "DCA_ACTIVE",
                                      "DCA_REJECTED",
                                      "DCA_PENDING_2FA",
                                      "DCA_PENDING_APPEAL",
                                      "SHORT_CODE_REJECTED",
                                      null
                                    ]
                                  }
                                }
                              },
                              "campaign": {
                                "type": "object",
                                "properties": {
                                  "state": {
                                    "type": "string"
                                  },
                                  "campaignRef": {
                                    "type": "string"
                                  },
                                  "campaignId": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          },
                          "agent": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "description": {
                                "type": "string"
                              },
                              "color": {
                                "type": "string"
                              },
                              "logoUrl": {
                                "type": "string"
                              },
                              "heroUrl": {
                                "type": "string"
                              },
                              "phone": {
                                "type": "string"
                              },
                              "phoneLabel": {
                                "type": "string"
                              },
                              "website": {
                                "type": "string"
                              },
                              "websiteLabel": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "emailLabel": {
                                "type": "string"
                              },
                              "privacyPolicyUrl": {
                                "type": "string"
                              },
                              "termsUrl": {
                                "type": "string"
                              }
                            }
                          },
                          "consent": {
                            "type": "object",
                            "properties": {
                              "optInDetails": {
                                "type": "string"
                              },
                              "optInUrl": {
                                "type": "string"
                              },
                              "optInResponse": {
                                "type": "string"
                              },
                              "optOutDetails": {
                                "type": "string"
                              },
                              "optOutResponse": {
                                "type": "string"
                              },
                              "helpResponse": {
                                "type": "string"
                              },
                              "campaignDescription": {
                                "type": "string"
                              },
                              "messageExamples": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "estimatedMonthlyVolume": {
                                "type": "string"
                              },
                              "launchVideoUrl": {
                                "type": "string"
                              }
                            }
                          },
                          "contact": {
                            "type": "object",
                            "properties": {
                              "firstName": {
                                "type": "string"
                              },
                              "lastName": {
                                "type": "string"
                              },
                              "role": {
                                "type": "string"
                              },
                              "email": {
                                "type": "string"
                              },
                              "mobile": {
                                "type": "string"
                              }
                            }
                          },
                          "useCase": {
                            "type": "string"
                          },
                          "billingCategory": {
                            "type": "string"
                          },
                          "defaultFallback": {
                            "type": "object",
                            "properties": {
                              "mode": {
                                "type": "string"
                              },
                              "channel": {
                                "type": "string"
                              },
                              "from": {
                                "type": "string"
                              }
                            }
                          },
                          "excludedCarriers": {
                            "type": "array",
                            "items": {}
                          },
                          "testers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "testerInvites": {
                            "type": "array",
                            "items": {}
                          },
                          "carriers": {
                            "type": "array",
                            "items": {}
                          },
                          "launchRequestFeedback": {
                            "type": "array",
                            "items": {}
                          },
                          "carrierUpdate": {},
                          "autofill": {
                            "type": "object",
                            "properties": {
                              "consent.optInDetails": {
                                "type": "object",
                                "properties": {
                                  "source": {
                                    "type": "string"
                                  },
                                  "sourceId": {
                                    "type": "string"
                                  },
                                  "at": {
                                    "type": "string"
                                  },
                                  "edited": {
                                    "type": "boolean"
                                  }
                                }
                              }
                            }
                          },
                          "launchable": {
                            "type": "boolean"
                          },
                          "launchFees": {
                            "type": "object",
                            "properties": {
                              "rows": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "key": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "amount": {
                                      "type": "integer"
                                    },
                                    "due": {
                                      "type": "boolean"
                                    }
                                  }
                                }
                              },
                              "total": {
                                "type": "integer"
                              }
                            }
                          },
                          "googleAgentId": {},
                          "review": {
                            "type": "object",
                            "properties": {
                              "decision": {},
                              "reviewedAt": {},
                              "reason": {}
                            }
                          },
                          "redlineDiff": {},
                          "submittedAt": {},
                          "approvedAt": {},
                          "history": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string"
                                },
                                "stage": {},
                                "actor": {
                                  "type": "string"
                                },
                                "actorType": {
                                  "type": "string"
                                },
                                "timestamp": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "agentId": "RCSA7K2M1QZ8RP",
                      "groupId": "G1234567",
                      "subgroupId": "S1234567",
                      "status": "DRAFT",
                      "registrationStatus": "DRAFT",
                      "stage": null,
                      "brandId": "B1A2C3D",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "campaignId": "C4E5F6G",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "links": {
                        "brand": {
                          "state": "OK",
                          "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                          "brandId": "B1A2C3D",
                          "displayName": "Acme",
                          "status": "VERIFIED"
                        },
                        "campaign": {
                          "state": "OK",
                          "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                          "campaignId": "C4E5F6G",
                          "status": "ACTIVE"
                        }
                      },
                      "agent": {
                        "name": "Acme Alerts",
                        "description": "Order and delivery alerts from Acme",
                        "color": "#6868ab",
                        "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                        "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                        "phone": "+18005550142",
                        "phoneLabel": "Call",
                        "website": "https://www.acme.example",
                        "websiteLabel": "Website",
                        "email": "support@acme.example",
                        "emailLabel": "Email",
                        "privacyPolicyUrl": "https://www.acme.example/privacy",
                        "termsUrl": "https://www.acme.example/terms"
                      },
                      "consent": {
                        "optInDetails": "Customers tick a box at checkout to get order alerts.",
                        "optInUrl": "https://www.acme.example/alerts",
                        "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                        "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                        "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                        "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                        "campaignDescription": "Order confirmations and delivery updates from Acme.",
                        "messageExamples": [
                          "Acme: your order A-48213 has shipped.",
                          "Acme: your order A-48213 arrives today."
                        ],
                        "estimatedMonthlyVolume": "UP_TO_10K",
                        "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                      },
                      "contact": {
                        "firstName": "Ada",
                        "lastName": "Lovelace",
                        "role": "Marketing lead",
                        "email": "ada.lovelace@acme.example",
                        "mobile": "+15125550101"
                      },
                      "useCase": "TRANSACTIONAL",
                      "billingCategory": "NON_CONVERSATIONAL",
                      "defaultFallback": {
                        "mode": "auto",
                        "channel": "auto",
                        "from": "15125550100"
                      },
                      "excludedCarriers": [],
                      "testers": [
                        "15125559876"
                      ],
                      "testerInvites": [],
                      "carriers": [],
                      "launchRequestFeedback": [],
                      "carrierUpdate": null,
                      "autofill": {
                        "consent.optInDetails": {
                          "source": "campaign",
                          "sourceId": "C4E5F6G",
                          "at": "2026-10-21T15:00:00.000Z",
                          "edited": false
                        }
                      },
                      "launchable": false,
                      "launchFees": {
                        "rows": [
                          {
                            "key": "rcsVetting",
                            "label": "RCS vet",
                            "amount": 100000000,
                            "due": true
                          }
                        ],
                        "total": 100000000
                      },
                      "googleAgentId": null,
                      "review": {
                        "decision": null,
                        "reviewedAt": null,
                        "reason": null
                      },
                      "redlineDiff": null,
                      "submittedAt": null,
                      "approvedAt": null,
                      "history": [
                        {
                          "status": "DRAFT",
                          "stage": null,
                          "actor": "60f7b2a1c9e77c001a2b3c4d",
                          "actorType": "user",
                          "timestamp": "2026-10-21T15:00:00.000Z"
                        }
                      ],
                      "createdAt": "2026-10-21T15:00:00.000Z",
                      "updatedAt": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 25
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}": {
      "get": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Get one agent with the live state of its brand and campaign links.",
        "description": "Get one agent with the live state of its brand and campaign links. An unknown id is a 404; another group's agent is refused.",
        "operationId": "registration.getAgent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "invitedAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "carriers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "carrier": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "rejectionReason": {},
                          "feedback": {},
                          "updatedAt": {
                            "type": "string"
                          },
                          "submittedAt": {
                            "type": "string"
                          },
                          "rejectionReasons": {
                            "type": "array",
                            "items": {}
                          }
                        }
                      }
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {
                      "type": "string"
                    },
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {
                      "type": "string"
                    },
                    "approvedAt": {
                      "type": "string"
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "PARTIALLY_LAUNCHED",
                  "registrationStatus": "APPROVED",
                  "stage": "LAUNCHED_PARTIAL_SUCCESS",
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [
                    {
                      "phoneNumber": "15125559876",
                      "status": "APPROVED",
                      "invitedAt": "2026-10-23T15:00:00.000Z",
                      "updatedAt": "2026-10-23T16:10:00.000Z"
                    }
                  ],
                  "carriers": [
                    {
                      "carrier": "AEGIS_BRAND_VERIFICATION",
                      "status": "COMPLETED",
                      "rejectionReason": null,
                      "feedback": null,
                      "updatedAt": "2026-10-27T15:00:00.000Z",
                      "submittedAt": "2026-10-26T15:00:00.000Z",
                      "rejectionReasons": []
                    },
                    {
                      "carrier": "ATT",
                      "status": "COMPLETED",
                      "rejectionReason": null,
                      "feedback": null,
                      "updatedAt": "2026-10-30T15:00:00.000Z",
                      "submittedAt": "2026-10-27T15:00:00.000Z",
                      "rejectionReasons": []
                    },
                    {
                      "carrier": "VERIZON",
                      "status": "IN_PROGRESS",
                      "rejectionReason": null,
                      "feedback": null,
                      "updatedAt": "2026-10-28T15:00:00.000Z",
                      "submittedAt": "2026-10-27T15:00:00.000Z",
                      "rejectionReasons": []
                    },
                    {
                      "carrier": "T_MOBILE",
                      "status": "PENDING",
                      "rejectionReason": null,
                      "feedback": null,
                      "updatedAt": "2026-10-28T15:00:00.000Z",
                      "submittedAt": "2026-10-28T15:00:00.000Z",
                      "rejectionReasons": []
                    }
                  ],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": "acme_ab12cd_agent",
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": "2026-10-21T15:10:00.000Z",
                  "approvedAt": "2026-10-30T15:00:00.000Z",
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Edit an agent while it may change: DRAFT, REJECTED, ACTION_REQUIRED, CARRIER_REJECTED, or IN_TESTING, whose change is pushed to the carrier partner.",
        "description": "Edit an agent while it may change: DRAFT, REJECTED, ACTION_REQUIRED, CARRIER_REJECTED, or IN_TESTING, whose change is pushed to the carrier partner. agent, consent and contact merge field by field; every other key replaces. Any other status is a 409, as is changing brandId once the agent exists at the partner (sending the current brand's ID back is not a change), billingCategory once a launch was requested, or agent or useCase while the carriers review a launch (stage PENDING_LAUNCH or a launched stage; consent and contact can still change). The profile must stay complete once the agent exists at the partner (400 REGISTRATION_INCOMPLETE). After a carrier rejected a launch other carriers took (PARTIALLY_LAUNCHED with a REJECTED carrier), only consent and contact may change (409 for anything else), and nothing is pushed to the partner: send them with POST /registration/:registrationId/carrier-update. While that update is REQUESTED, edits return 409; editing opens again after staff mark it SENT.",
        "operationId": "registration.updateAgent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandId": {
                    "description": "Relink to another brand in the agent's subgroup. Locked (409) once the agent exists at the carrier partner; the current brand's ID, in any of its forms, is accepted as no change."
                  },
                  "campaignId": {
                    "description": "Link or relink a campaign of the linked brand, or null to unlink."
                  },
                  "agent": {
                    "description": "Profile: name (max 40), description (max 100), color (hex, default #6868ab; it must contrast at least 4.5:1 with white text), logoUrl and heroUrl (PNG or JPEG of exactly 224 × 224 under 50 KB and 1440 × 448 under 200 KB; an image not on our media host is fetched and checked at submit), phone (E.164), website, email, privacyPolicyUrl, termsUrl, and the captions phoneLabel, websiteLabel and emailLabel (max 40 each, plain text with no links or markup; blank defaults to Call, Website and Email at submit). URLs must be HTTPS. Required in full before submit, and kept complete once the agent exists at the carrier partner."
                  },
                  "consent": {
                    "description": "Launch text: optInDetails, optInUrl, optInResponse, optOutDetails, optOutResponse, helpResponse, campaignDescription, messageExamples (1–6), estimatedMonthlyVolume (UP_TO_10K, 10K_100K, 100K_500K, 500K_1M, 1M_PLUS), launchVideoUrl. Every field is required before the launch request, not before submit: the carrier partner's launch form requires each one, including the opt-in URL and the demonstration video, which is recorded during testing. optInDetails, optInResponse, optOutDetails, optOutResponse, helpResponse and campaignDescription are each at most 1,000 characters, the partner's cap. The partner takes messageExamples as one answer, so they must total 5 to 1,000 characters at the launch request. Blank fields fill from the linked campaign (messageFlow, optinMessage, optoutMessage, helpMessage, description, sample1–5) when it is linked. Copied text is shortened to fit these limits, and only the whole samples that fit are kept."
                  },
                  "contact": {
                    "description": "The individual at your company the carrier partner's reviewers may contact about the launch: firstName, lastName, role (3–75), email (an individual's business address; shared mailboxes such as support@ are refused) and mobile (E.164). Required in full before the launch request."
                  },
                  "useCase": {
                    "description": "OTP, TRANSACTIONAL, PROMOTIONAL or MULTI_USE. Required before submit."
                  },
                  "billingCategory": {
                    "description": "NON_CONVERSATIONAL (default) or CONVERSATIONAL. A non-conversational agent is billed per message. A conversational agent is billed per interactive session: 4 messages in 24 hours, at least 2 from the person and 1 from the agent, start a session that covers every message for 24 hours. Its messages are charged as they happen. Each day, two rows reprice the sessions that closed the day before: an RCS Session Adjustment for the Signal House session fee, and an RCS Session Carrier Adjustment for the carrier's session rate, passed through at cost. Locked once a launch has been requested."
                  },
                  "defaultFallback": {
                    "description": "{ mode (auto, rcs_only, sms_only, none), channel (auto, sms, mms), from }. from must be a number assigned to the linked campaign."
                  },
                  "excludedCarriers": {
                    "description": "[] (default) or [\"T_MOBILE\"] to skip the T-Mobile launch. The value is the carrier partner's carrier name. Once T-Mobile has launched the agent, an edit that changes this list gets a 409."
                  },
                  "autofill": {
                    "description": "Where the fields you prefilled came from, keyed by field path (agent.*, consent.* or contact.*, for example consent.optInDetails): { source (brand, campaign or landing), sourceId, at, edited }. Signal House adds its own markers for the fields it fills from the linked campaign or the brand's landing page. On an update, autofill replaces the stored markers; leave it out to keep them, and a stored marker turns edited: true once its field's value changes. A marker on a blank field is dropped."
                  },
                  "testers": {
                    "description": "Up to 200 distinct US numbers to invite as testers. Once the agent is IN_TESTING, each number you add is invited at the carrier partner (up to 20 a day) and testerInvites reports the invitation's status; a number you remove here is marked REMOVED within a minute, and DELETE /rcs/agent/:agentId/testers/:phoneNumber removes one at once. A number that does not accept within 24 hours is EXPIRED and stays so until you resend its invitation. Saving only testers does not resubmit the agent to the carrier partner."
                  }
                }
              },
              "example": {
                "campaignId": "C4E5F6G",
                "agent": {
                  "description": "Order and delivery alerts from Acme"
                },
                "testers": [
                  "15125559876"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {},
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {}
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "DRAFT",
                  "registrationStatus": "DRAFT",
                  "stage": null,
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/archive": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Archive the agent.",
        "description": "Archive the agent. This cannot be undone. An agent the carrier partner has not created yet is ARCHIVED at once. One it created stops sending at once and returns ARCHIVE_PENDING: Signal House asks the partner to cancel it, including any launch under review, and moves it to ARCHIVED when the partner confirms. Archiving an agent that is already ARCHIVE_PENDING, or while it is being submitted, answers 409. Launch fees already filed with the carriers are not refunded.",
        "operationId": "registration.archiveAgent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {}
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "ARCHIVE_PENDING",
                  "registrationStatus": "PENDING_DELETE",
                  "stage": "LAUNCHED",
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/asset": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Host the agent's logo or hero image and set its URL on the draft.",
        "description": "Host the agent's logo or hero image and set its URL on the draft. Send multipart/form-data. Images of any other size are refused, and so is any image while the carriers review a launch (409).",
        "operationId": "registration.uploadAgentAsset",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "description": "logo (224 × 224 px, 50 KB or smaller) or hero (1440 × 448 px, 200 KB or smaller)."
                  },
                  "file": {
                    "type": "string",
                    "description": "One PNG or JPEG of exactly that size. The type is read from the file's bytes."
                  }
                },
                "required": [
                  "kind",
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {},
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {}
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "DRAFT",
                  "registrationStatus": "DRAFT",
                  "stage": null,
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/entry-points": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Make the links that start a chat with the agent: an sms: deep link in Google's format, and a short link that redirects to it, for a website, an email or a printed QR code.",
        "description": "Make the links that start a chat with the agent: an sms: deep link in Google's format, and a short link that redirects to it, for a website, an email or a printed QR code. The same agent and body return the same short link; a new body or a new default fallback number makes a new one. The links reach the agent's approved testers until a carrier launches it, and every handset on a launched carrier after that. Before Google has created the agent, the request answers 409 with code GOOGLE_AGENT_PENDING. An agent of another group answers 403.",
        "operationId": "registration.createEntryPoints",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "description": "The message the chat opens with, prefilled in the handset's message box: 1 to 1,000 characters."
                  }
                }
              },
              "example": {
                "body": "Hi"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "googleAgentId": {
                      "type": "string"
                    },
                    "deepLink": {
                      "type": "string"
                    },
                    "shortLink": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "googleAgentId": "acme_ab12cd_agent",
                  "deepLink": "sms:+15125550100?service_id=acme_ab12cd_agent%40rbm.goog&body=Hi",
                  "shortLink": "https://sihou.io/0000A3F"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/submit": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Submit the draft: create the agent at the carrier partner, with no review first.",
        "description": "Submit the draft: create the agent at the carrier partner, with no review first. It needs the full profile, a useCase and a billingCategory; a failed check is a 400 whose details carry { code: REGISTRATION_INCOMPLETE, errors, warnings }. The agent becomes AGENT_CREATING, then IN_TESTING when the partner reports it ready. A second submit, or one on an agent the partner already holds, is a 409; the launch is requested with POST /registration/:registrationId/launch.",
        "operationId": "registration.submitAgent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {},
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {}
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {
                      "type": "string"
                    },
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "AGENT_CREATING",
                  "registrationStatus": "SUBMITTING",
                  "stage": null,
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": "2026-10-21T15:10:00.000Z",
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/testers/{phoneNumber}": {
      "delete": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Remove a tester at once: the agent stops sending to the number straight away, and its invitation reads REMOVED.",
        "description": "Remove a tester at once: the agent stops sending to the number straight away, and its invitation reads REMOVED. Allowed at any point before the agent is archived, including during Signal House review and after launch. The carrier partner has no way to withdraw an invitation, so the handset may keep the invitation it already has. The number must be a tester on the agent (404); an archived agent answers 409. Fires RCS_TESTER_STATUS_UPDATED. Returns the agent.",
        "operationId": "registration.removeTester",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          },
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tester's US number, with or without the +. A + in the path must be URL-encoded as %2B."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {}
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "invitedAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "IN_TESTING",
                  "registrationStatus": "PENDING_PROVIDER",
                  "stage": "READY_FOR_TESTING",
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [],
                  "testerInvites": [
                    {
                      "phoneNumber": "15125559876",
                      "status": "REMOVED",
                      "invitedAt": "2026-10-23T15:00:00.000Z",
                      "updatedAt": "2026-10-23T16:10:00.000Z"
                    }
                  ],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/testers/{phoneNumber}/resend": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Resend a tester's expired invitation, which starts a new 24 hours for the tester to accept it.",
        "description": "Resend a tester's expired invitation, which starts a new 24 hours for the tester to accept it. Allowed while the agent can be edited. The number must be a tester on the agent (404) and its invitation must be EXPIRED (409). Up to 20 invitations go out a day (429). Returns the agent.",
        "operationId": "registration.resendTesterInvite",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          },
          {
            "name": "phoneNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The tester's US number, with or without the +. A + in the path must be URL-encoded as %2B."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "agentId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "registrationStatus": {
                      "type": "string"
                    },
                    "stage": {
                      "type": "string"
                    },
                    "brandId": {
                      "type": "string"
                    },
                    "brandRef": {
                      "type": "string"
                    },
                    "campaignId": {
                      "type": "string"
                    },
                    "campaignRef": {
                      "type": "string"
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string"
                        },
                        "logoUrl": {
                          "type": "string"
                        },
                        "heroUrl": {
                          "type": "string"
                        },
                        "phone": {
                          "type": "string"
                        },
                        "phoneLabel": {
                          "type": "string"
                        },
                        "website": {
                          "type": "string"
                        },
                        "websiteLabel": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "emailLabel": {
                          "type": "string"
                        },
                        "privacyPolicyUrl": {
                          "type": "string"
                        },
                        "termsUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "consent": {
                      "type": "object",
                      "properties": {
                        "optInDetails": {
                          "type": "string"
                        },
                        "optInUrl": {
                          "type": "string"
                        },
                        "optInResponse": {
                          "type": "string"
                        },
                        "optOutDetails": {
                          "type": "string"
                        },
                        "optOutResponse": {
                          "type": "string"
                        },
                        "helpResponse": {
                          "type": "string"
                        },
                        "campaignDescription": {
                          "type": "string"
                        },
                        "messageExamples": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "estimatedMonthlyVolume": {
                          "type": "string"
                        },
                        "launchVideoUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "contact": {
                      "type": "object",
                      "properties": {
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "mobile": {
                          "type": "string"
                        }
                      }
                    },
                    "useCase": {
                      "type": "string"
                    },
                    "billingCategory": {
                      "type": "string"
                    },
                    "defaultFallback": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      }
                    },
                    "excludedCarriers": {
                      "type": "array",
                      "items": {}
                    },
                    "testers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "testerInvites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "invitedAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "carriers": {
                      "type": "array",
                      "items": {}
                    },
                    "launchRequestFeedback": {
                      "type": "array",
                      "items": {}
                    },
                    "carrierUpdate": {},
                    "autofill": {
                      "type": "object",
                      "properties": {
                        "consent.optInDetails": {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "sourceId": {
                              "type": "string"
                            },
                            "at": {
                              "type": "string"
                            },
                            "edited": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "launchFees": {
                      "type": "object",
                      "properties": {
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "integer"
                              },
                              "due": {
                                "type": "boolean"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "googleAgentId": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "redlineDiff": {},
                    "submittedAt": {},
                    "approvedAt": {},
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "timestamp": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "agentId": "RCSA7K2M1QZ8RP",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "status": "IN_TESTING",
                  "registrationStatus": "PENDING_PROVIDER",
                  "stage": "READY_FOR_TESTING",
                  "brandId": "B1A2C3D",
                  "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                  "campaignId": "C4E5F6G",
                  "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  },
                  "agent": {
                    "name": "Acme Alerts",
                    "description": "Order and delivery alerts from Acme",
                    "color": "#6868ab",
                    "logoUrl": "https://media.signalhouse.io/rcs-agents/5b1e0c7a-2f7d-4f5e-9a51-6f3c1c2d9e10.png",
                    "heroUrl": "https://media.signalhouse.io/rcs-agents/0d0c3a3e-8b9e-4b7e-9b14-2f9f3c1b7a55.png",
                    "phone": "+18005550142",
                    "phoneLabel": "Call",
                    "website": "https://www.acme.example",
                    "websiteLabel": "Website",
                    "email": "support@acme.example",
                    "emailLabel": "Email",
                    "privacyPolicyUrl": "https://www.acme.example/privacy",
                    "termsUrl": "https://www.acme.example/terms"
                  },
                  "consent": {
                    "optInDetails": "Customers tick a box at checkout to get order alerts.",
                    "optInUrl": "https://www.acme.example/alerts",
                    "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                    "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                    "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                    "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                    "campaignDescription": "Order confirmations and delivery updates from Acme.",
                    "messageExamples": [
                      "Acme: your order A-48213 has shipped.",
                      "Acme: your order A-48213 arrives today."
                    ],
                    "estimatedMonthlyVolume": "UP_TO_10K",
                    "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                  },
                  "contact": {
                    "firstName": "Ada",
                    "lastName": "Lovelace",
                    "role": "Marketing lead",
                    "email": "ada.lovelace@acme.example",
                    "mobile": "+15125550101"
                  },
                  "useCase": "TRANSACTIONAL",
                  "billingCategory": "NON_CONVERSATIONAL",
                  "defaultFallback": {
                    "mode": "auto",
                    "channel": "auto",
                    "from": "15125550100"
                  },
                  "excludedCarriers": [],
                  "testers": [
                    "15125559876"
                  ],
                  "testerInvites": [
                    {
                      "phoneNumber": "15125559876",
                      "status": "PENDING",
                      "invitedAt": "2026-10-23T15:00:00.000Z",
                      "updatedAt": "2026-10-23T16:10:00.000Z"
                    }
                  ],
                  "carriers": [],
                  "launchRequestFeedback": [],
                  "carrierUpdate": null,
                  "autofill": {
                    "consent.optInDetails": {
                      "source": "campaign",
                      "sourceId": "C4E5F6G",
                      "at": "2026-10-21T15:00:00.000Z",
                      "edited": false
                    }
                  },
                  "launchable": false,
                  "launchFees": {
                    "rows": [
                      {
                        "key": "rcsVetting",
                        "label": "RCS vet",
                        "amount": 100000000,
                        "due": true
                      }
                    ],
                    "total": 100000000
                  },
                  "googleAgentId": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "redlineDiff": null,
                  "submittedAt": null,
                  "approvedAt": null,
                  "history": [
                    {
                      "status": "DRAFT",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-21T15:00:00.000Z"
                    }
                  ],
                  "createdAt": "2026-10-21T15:00:00.000Z",
                  "updatedAt": "2026-10-21T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/agent/{agentId}/validate": {
      "post": {
        "tags": [
          "RCS Agents"
        ],
        "summary": "Check the agent against the next gate on its path and the live state of its links, without writing anything: before it exists at the carrier partner, what creating it needs; after that, what the launch request needs.",
        "description": "Check the agent against the next gate on its path and the live state of its links, without writing anything: before it exists at the carrier partner, what creating it needs; after that, what the launch request needs. The launch check also loads the website, privacy policy, terms and opt-in links, following up to five redirects, so it can take a few seconds; it needs STOP in consent.optOutDetails and HELP in consent.helpResponse, and the launch text must pass the carriers' copy rules: the opt-in response names the brand, the message frequency, HELP, the rate disclosure and STOP; the HELP response names the brand and a support email, phone or website; the opt-out response names the brand and confirms no more messages will come; each message example names the brand, has the rate disclosure when it has a link, and uses no public link shortener. A copy-rule error carries the carrier partner's key as its code.",
        "operationId": "registration.validateAgent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Agent ID (RCSA + 10 characters). It is also the agent's registrationId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "valid": false,
                  "errors": [
                    {
                      "field": "consent.launchVideoUrl",
                      "reason": "Add the sender launch video URL"
                    },
                    {
                      "field": "contact.firstName",
                      "reason": "Add the contact's first name"
                    },
                    {
                      "field": "consent.optInResponse",
                      "code": "OPT_IN_MSG_RATE_DISCL_MISSING",
                      "reason": "Add the rate disclosure to the opt-in response, for example \"Msg & data rates may apply\": the carriers refuse a launch without it"
                    }
                  ],
                  "warnings": [
                    {
                      "field": "defaultFallback.from",
                      "reason": "No fallback number: recipients without RCS will not get an SMS unless a send names one"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/rcs/capabilities": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Report which numbers can receive RCS from an agent, and why.",
        "description": "Report which numbers can receive RCS from an agent, and why. An agent of another group is refused. Answers are cached for 24 hours per agent and number.",
        "operationId": "message.readRcsCapabilities",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RcsCapabilitiesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "phoneNumber": {
                            "type": "string"
                          },
                          "capability": {
                            "type": "string"
                          },
                          "rcsEnabled": {
                            "type": "boolean"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "features": {
                            "type": "array",
                            "items": {}
                          },
                          "carrier": {
                            "type": "string"
                          },
                          "checkedAt": {
                            "type": "string"
                          },
                          "cached": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "results": [
                    {
                      "phoneNumber": "12025550187",
                      "capability": "ENABLED",
                      "rcsEnabled": true,
                      "reason": "CAPABLE",
                      "features": [],
                      "carrier": "Verizon Wireless",
                      "checkedAt": "2026-11-10T14:58:02.000Z",
                      "cached": true
                    },
                    {
                      "phoneNumber": "12025550188",
                      "capability": "UNREACHABLE",
                      "rcsEnabled": false,
                      "reason": "NOT_CAPABLE",
                      "features": [],
                      "carrier": "AT&T",
                      "checkedAt": "2026-11-10T15:03:09.000Z",
                      "cached": false
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration": {
      "post": {
        "tags": [
          "Registrations"
        ],
        "summary": "Submit a registration owned by one of your active subgroups.",
        "description": "Submit a registration owned by one of your active subgroups. The body is strict — unknown fields are rejected — and data must match the shape the type declares for the region; the VIRTUAL_LONG_CODE fields and the United Kingdom ALPHANUMERIC_SENDER_ID fields are listed below. An ALPHANUMERIC_SENDER_ID whose requested sender name is already held is refused with a 409. capabilities must be exactly one of the bundles the catalog lists for the type. To make a retry safe, send an Idempotency-Key header (see Idempotent Requests): an identical retry with the same key replays the first response instead of creating a second registration. A clientRequestId sent by an older SDK is ignored. The registration is created in SIGNAL_HOUSE_REVIEW and returned with a 201. Refused with a 400 when the type is not currently available in the region or for the account's provider, when the subgroup is not active, or when data.quantity falls outside the type's range.",
        "operationId": "registration.createRegistration",
        "parameters": [
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "- data.requestedSenderId (ALPHANUMERIC_SENDER_ID) (String): The sender name: 3–11 letters, digits, spaces, dots or hyphens, starting and ending with a letter or digit, with at least one letter. A name already held is refused with a 409.\n- data.trafficOrigin (ALPHANUMERIC_SENDER_ID) (String): LOCAL (company headquartered in the UK) or INTERNATIONAL (headquartered outside the UK).\n- data.trafficType (ALPHANUMERIC_SENDER_ID) (String): TRANSACTIONAL (triggered by a user action or system event, e.g. one-time passcodes and order updates) or PROMOTIONAL (marketing).\n- data.companyName (ALPHANUMERIC_SENDER_ID) (String): The company behind the sender, 2–65 characters.\n- data.companyCountry (ALPHANUMERIC_SENDER_ID) (String): The company's country as its English name (e.g. United Kingdom), 2–60 characters.\n- data.companyWebsite (ALPHANUMERIC_SENDER_ID) (String): The company website — an http:// or https:// URL.\n- data.industry (ALPHANUMERIC_SENDER_ID) (String): The company's industry, 1–60 characters.\n- data.senderRelationship (ALPHANUMERIC_SENDER_ID) (String): How the sender name relates to the company, up to 65 characters. Required when requestedSenderId differs from companyName ignoring case and spaces; otherwise omit it or send null.\n- data.messageExample (ALPHANUMERIC_SENDER_ID) (String): An example message, 1–2,000 characters.\n- data.quantity / data.phoneNumbers / data.releasedNumbers (ALPHANUMERIC_SENDER_ID) (Mixed): Read-only: quantity is always 1, phoneNumbers holds the granted sender (e.g. [\"ACME\"]) once APPROVED, and releasedNumbers lists a released sender as { phoneNumber, releasedAt }. phoneNumbers and releasedNumbers are refused on create with a 400.",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "region": {
                    "type": "string",
                    "description": "ISO-2 country code, in any case. UK, GBR and United Kingdom (any case) are accepted as spellings of GB."
                  },
                  "type": {
                    "type": "string",
                    "description": "The registration type, as listed by the catalog (for example VIRTUAL_LONG_CODE)."
                  },
                  "subgroupId": {
                    "type": "string",
                    "description": "An active subgroup in your active group. It will own the registration and any numbers it yields."
                  },
                  "capabilities": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "One of the type's bundles, e.g. [\"SMS\"] or [\"SMS\", \"VOICE\"] for a UK Virtual Long Code. 1–3 of SMS, MMS, VOICE; no value may repeat. Stored sorted."
                  },
                  "data": {
                    "type": "object",
                    "description": "The type's data, shaped by type and region. Strict: unknown fields are rejected. The VIRTUAL_LONG_CODE fields follow, then the ALPHANUMERIC_SENDER_ID (United Kingdom) fields.",
                    "properties": {
                      "quantity": {
                        "type": "number",
                        "description": "Integer within the type's quantity range (1–100 for a UK Virtual Long Code): how many numbers to provision under this registration."
                      },
                      "useCases": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "1–10 descriptions of how the numbers will be used, each 1–2,000 characters."
                      },
                      "phoneNumbers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Read-only: the numbers the registration currently holds. Refused on create with a 400; it is returned empty until the registration is APPROVED. A released number moves to data.releasedNumbers."
                      },
                      "releasedNumbers": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        },
                        "description": "Read-only: numbers the registration provisioned that have since been released, each { phoneNumber, releasedAt }. Refused on create with a 400."
                      },
                      "voice": {
                        "type": "object",
                        "description": "The voice dossier the carrier requires. Required exactly when capabilities include VOICE, and must be omitted (or null) otherwise. Strict: unknown fields are rejected. Its fields follow.",
                        "properties": {
                          "companyName": {
                            "type": "string",
                            "description": "Legal company name (1–2,000 characters)."
                          },
                          "companyPhone": {
                            "type": "string",
                            "description": "Company phone number: 7–30 characters of digits, spaces, parentheses and hyphens, with an optional leading +."
                          },
                          "companyWebsite": {
                            "type": "string",
                            "description": "Company website — an http:// or https:// URL."
                          },
                          "companyEmail": {
                            "type": "string",
                            "description": "Company contact email address."
                          },
                          "address": {
                            "type": "object",
                            "description": "{ line1, line2?, city, postalCode, country }. line1, city and postalCode are 1–2,000 characters; line2 is optional (up to 200); country is an upper-case ISO-2 code. Strict: unknown fields are rejected."
                          },
                          "companyDescription": {
                            "type": "string",
                            "description": "What the company does (1–2,000 characters)."
                          },
                          "campaignName": {
                            "type": "string",
                            "description": "Name of the calling campaign (1–2,000 characters)."
                          },
                          "campaignDescription": {
                            "type": "string",
                            "description": "What the calls are for (1–2,000 characters)."
                          },
                          "optInMethods": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "1–3 of WEB, KEYWORD, VERBAL."
                          },
                          "optOutKeywords": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Exactly STOP and UNSUBSCRIBE, once each, in any order."
                          },
                          "callTypes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "1–3 of LANDLINE, LOCAL, INTERNATIONAL."
                          },
                          "callsPerDay": {
                            "type": "number",
                            "description": "Integer 1–5."
                          },
                          "callDurationMinutes": {
                            "type": "number",
                            "description": "An integer from 1 to 10, or one of 15, 30, 45, 60."
                          },
                          "termsUrl": {
                            "type": "string",
                            "description": "Terms of service — an http:// or https:// URL."
                          }
                        },
                        "required": [
                          "companyName",
                          "companyPhone",
                          "companyWebsite",
                          "companyEmail",
                          "address",
                          "companyDescription",
                          "campaignName",
                          "campaignDescription",
                          "optInMethods",
                          "optOutKeywords",
                          "callTypes",
                          "callsPerDay",
                          "callDurationMinutes",
                          "termsUrl"
                        ]
                      }
                    },
                    "required": [
                      "quantity",
                      "useCases"
                    ]
                  },
                  "complianceScanId": {
                    "type": "string",
                    "description": "Optional id of a website compliance scan run before submitting (at most 64 characters). Stored for registration attribution and never sent to a registrar or carrier."
                  }
                },
                "required": [
                  "region",
                  "type",
                  "subgroupId",
                  "capabilities",
                  "data"
                ]
              },
              "example": {
                "region": "GB",
                "type": "VIRTUAL_LONG_CODE",
                "subgroupId": "S1234567",
                "capabilities": [
                  "SMS",
                  "VOICE"
                ],
                "data": {
                  "quantity": 2,
                  "useCases": [
                    "Order and delivery notifications",
                    "Appointment reminders"
                  ],
                  "voice": {
                    "companyName": "Acme Ltd",
                    "companyPhone": "+44 20 7946 0958",
                    "companyWebsite": "https://www.acme.example",
                    "companyEmail": "compliance@acme.example",
                    "address": {
                      "line1": "1 Example Street",
                      "line2": "Floor 2",
                      "city": "London",
                      "postalCode": "EC1A 1BB",
                      "country": "GB"
                    },
                    "companyDescription": "Online retailer of home goods.",
                    "campaignName": "Delivery updates",
                    "campaignDescription": "Calls to confirm delivery slots with customers who placed an order.",
                    "optInMethods": [
                      "WEB",
                      "VERBAL"
                    ],
                    "optOutKeywords": [
                      "STOP",
                      "UNSUBSCRIBE"
                    ],
                    "callTypes": [
                      "LOCAL"
                    ],
                    "callsPerDay": 1,
                    "callDurationMinutes": 5,
                    "termsUrl": "https://www.acme.example/terms"
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "identity",
                        "program",
                        "sender"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "tenDLC",
                        "tollFree",
                        "shortCode",
                        "virtualLongCode",
                        "alphanumeric",
                        "rcs"
                      ]
                    },
                    "parentRegistrationId": {},
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "stage": {},
                    "capabilities": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "submittedAt": {},
                    "approvedAt": {},
                    "expiresAt": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {},
                        "reviewedAt": {},
                        "reason": {}
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "quantity": {
                          "type": "integer"
                        },
                        "useCases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "releasedNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "voice": {
                          "type": "object",
                          "properties": {
                            "companyName": {
                              "type": "string"
                            },
                            "companyPhone": {
                              "type": "string"
                            },
                            "companyWebsite": {
                              "type": "string"
                            },
                            "companyEmail": {
                              "type": "string"
                            },
                            "address": {
                              "type": "object",
                              "properties": {
                                "line1": {
                                  "type": "string"
                                },
                                "line2": {
                                  "type": "string"
                                },
                                "city": {
                                  "type": "string"
                                },
                                "postalCode": {
                                  "type": "string"
                                },
                                "country": {
                                  "type": "string"
                                }
                              }
                            },
                            "companyDescription": {
                              "type": "string"
                            },
                            "campaignName": {
                              "type": "string"
                            },
                            "campaignDescription": {
                              "type": "string"
                            },
                            "optInMethods": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "optOutKeywords": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "callTypes": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "callsPerDay": {
                              "type": "integer"
                            },
                            "callDurationMinutes": {
                              "type": "integer"
                            },
                            "termsUrl": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "staff",
                              "system",
                              "provider"
                            ]
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "reason": {}
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "registrationId": "GB7M2Q9X4K3D",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "region": "GB",
                  "type": "VIRTUAL_LONG_CODE",
                  "kind": "sender",
                  "channel": "virtualLongCode",
                  "parentRegistrationId": null,
                  "status": "SIGNAL_HOUSE_REVIEW",
                  "stage": null,
                  "capabilities": [
                    "SMS",
                    "VOICE"
                  ],
                  "submittedAt": null,
                  "approvedAt": null,
                  "expiresAt": null,
                  "review": {
                    "decision": null,
                    "reviewedAt": null,
                    "reason": null
                  },
                  "data": {
                    "quantity": 2,
                    "useCases": [
                      "Order and delivery notifications",
                      "Appointment reminders"
                    ],
                    "phoneNumbers": [],
                    "releasedNumbers": [],
                    "voice": {
                      "companyName": "Acme Ltd",
                      "companyPhone": "+44 20 7946 0958",
                      "companyWebsite": "https://www.acme.example",
                      "companyEmail": "compliance@acme.example",
                      "address": {
                        "line1": "1 Example Street",
                        "line2": "Floor 2",
                        "city": "London",
                        "postalCode": "EC1A 1BB",
                        "country": "GB"
                      },
                      "companyDescription": "Online retailer of home goods.",
                      "campaignName": "Delivery updates",
                      "campaignDescription": "Calls to confirm delivery slots with customers who placed an order.",
                      "optInMethods": [
                        "WEB",
                        "VERBAL"
                      ],
                      "optOutKeywords": [
                        "STOP",
                        "UNSUBSCRIBE"
                      ],
                      "callTypes": [
                        "LOCAL"
                      ],
                      "callsPerDay": 1,
                      "callDurationMinutes": 5,
                      "termsUrl": "https://www.acme.example/terms"
                    }
                  },
                  "history": [
                    {
                      "status": "SIGNAL_HOUSE_REVIEW",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c58",
                      "actorType": "user",
                      "timestamp": "2026-08-01T09:00:00.000Z",
                      "reason": null
                    }
                  ],
                  "createdAt": "2026-08-01T09:00:00.000Z",
                  "updatedAt": "2026-08-01T09:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "get": {
        "tags": [
          "Registrations"
        ],
        "summary": "List registrations, newest first.",
        "description": "List registrations, newest first. A customer sees the registrations of the groups they can view; groupId narrows the list to one of them. Signal House staff see every registration unless they name a group. Every filter is optional and they combine.",
        "operationId": "registration.readRegistrations",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Only registrations of this group. Must be a group you can view.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Only registrations owned by this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Only registrations in these jurisdictions (ISO-2, any case; UK, GBR and United Kingdom are accepted for GB). One value, a repeated key, or a comma-separated list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only registrations of this type (for example VIRTUAL_LONG_CODE).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Only registrations of this kind: identity, program or sender.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only registrations in these statuses (values from the status table above). One value, a repeated key, or a comma-separated list.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "parentRegistrationId",
            "in": "query",
            "required": false,
            "description": "Only registrations filed under this parent registration.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Only registrations holding this phone number (10–15 digits, leading + optional).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Only RCS agents linked to this 10DLC brand: its carrier brand ID, provisional UUID or _id. With a type other than RCS_AGENT, the page is empty.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Only RCS agents linked to this 10DLC campaign: its campaign ID or _id. With a type other than RCS_AGENT, the page is empty.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "Sort field: createdAt, subgroupId, registrationId, region or status. Default: createdAt.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "asc or desc. Default: desc.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number. Default: 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Registrations per page, 1–100. Default: 25.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "registrationId": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "region": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "TEN_DLC_BRAND",
                              "TEN_DLC_CAMPAIGN",
                              "TOLL_FREE_BRAND",
                              "TOLL_FREE_CAMPAIGN",
                              "SHORT_CODE_BRAND",
                              "SHORT_CODE_PROGRAM",
                              "SHORT_CODE_LEASE",
                              "VIRTUAL_LONG_CODE",
                              "ALPHANUMERIC_SENDER_ID",
                              "RCS_AGENT"
                            ]
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "identity",
                              "program",
                              "sender"
                            ]
                          },
                          "channel": {
                            "type": "string",
                            "enum": [
                              "tenDLC",
                              "tollFree",
                              "shortCode",
                              "virtualLongCode",
                              "alphanumeric",
                              "rcs"
                            ]
                          },
                          "parentRegistrationId": {},
                          "status": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "SIGNAL_HOUSE_REVIEW",
                              "SIGNAL_HOUSE_APPROVED",
                              "SIGNAL_HOUSE_REJECTED",
                              "SUBMITTING",
                              "PENDING_PROVIDER",
                              "NEEDS_INFORMATION",
                              "PAYMENT_REQUIRED",
                              "APPROVED",
                              "REJECTED",
                              "CANCELLED",
                              "PENDING_DELETE",
                              "DELETED",
                              "EXPIRED",
                              "RECONCILIATION_REQUIRED"
                            ]
                          },
                          "stage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "capabilities": {
                            "type": [
                              "array",
                              "null"
                            ],
                            "items": {
                              "type": "string"
                            }
                          },
                          "submittedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "approvedAt": {},
                          "expiresAt": {},
                          "review": {
                            "type": "object",
                            "properties": {
                              "decision": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reviewedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reason": {}
                            }
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "quantity": {
                                "type": "integer"
                              },
                              "useCases": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "phoneNumbers": {
                                "type": "array",
                                "items": {}
                              },
                              "releasedNumbers": {
                                "type": "array",
                                "items": {}
                              },
                              "voice": {}
                            }
                          },
                          "history": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string"
                                },
                                "stage": {},
                                "actor": {
                                  "type": "string"
                                },
                                "actorType": {
                                  "type": "string",
                                  "enum": [
                                    "user",
                                    "staff",
                                    "system",
                                    "provider"
                                  ]
                                },
                                "timestamp": {
                                  "type": "string"
                                },
                                "reason": {}
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "registrationId": "GB7M2Q9X4K3D",
                      "groupId": "G1234567",
                      "subgroupId": "S1234567",
                      "region": "GB",
                      "type": "VIRTUAL_LONG_CODE",
                      "kind": "sender",
                      "channel": "virtualLongCode",
                      "parentRegistrationId": null,
                      "status": "PENDING_PROVIDER",
                      "stage": "IN_REVIEW",
                      "capabilities": [
                        "SMS"
                      ],
                      "submittedAt": "2026-08-02T15:21:00.000Z",
                      "approvedAt": null,
                      "expiresAt": null,
                      "review": {
                        "decision": "APPROVE",
                        "reviewedAt": "2026-08-02T15:20:00.000Z",
                        "reason": null
                      },
                      "data": {
                        "quantity": 2,
                        "useCases": [
                          "Order and delivery notifications"
                        ],
                        "phoneNumbers": [],
                        "releasedNumbers": [],
                        "voice": null
                      },
                      "history": [
                        {
                          "status": "SIGNAL_HOUSE_REVIEW",
                          "stage": null,
                          "actor": "60f7b2a1c9e77c001a2b3c58",
                          "actorType": "user",
                          "timestamp": "2026-08-01T09:00:00.000Z",
                          "reason": null
                        },
                        {
                          "status": "SIGNAL_HOUSE_APPROVED",
                          "stage": null,
                          "actor": "60f7b2a1c9e77c001a2b3c99",
                          "actorType": "staff",
                          "timestamp": "2026-08-02T15:20:00.000Z",
                          "reason": null
                        },
                        {
                          "status": "SUBMITTING",
                          "stage": null,
                          "actor": "SYSTEM",
                          "actorType": "system",
                          "timestamp": "2026-08-02T15:21:00.000Z",
                          "reason": null
                        },
                        {
                          "status": "PENDING_PROVIDER",
                          "stage": "IN_REVIEW",
                          "actor": "SYSTEM",
                          "actorType": "provider",
                          "timestamp": "2026-08-02T15:21:30.000Z",
                          "reason": null
                        }
                      ],
                      "createdAt": "2026-08-01T09:00:00.000Z",
                      "updatedAt": "2026-08-02T15:21:30.000Z"
                    }
                  ],
                  "totalCount": 1,
                  "page": 1,
                  "limit": 25
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/catalog": {
      "get": {
        "tags": [
          "Registrations"
        ],
        "summary": "Return the registration types a region offers and whether each can be acquired right now.",
        "description": "Return the registration types a region offers and whether each can be acquired right now. region is resolved to its jurisdiction (a US territory resolves to US); an unlisted country returns jurisdiction null, sendingRequiresRegistration true, registeredThrough 'registration', provisioning 'purchase' and no types, because no number from it can send. sendingRequiresRegistration says whether a number in that region needs an approved registration before it may send; provisioning is 'registration' when numbers are obtained through a registration order and 'purchase' when they are bought directly from the Numbers API. Each type row carries its kind and channel, the capability bundles it supports, its quantity range, the type it requires as a parent (or null), and available — true only when the type is open for the region and every bundle has a price. registeredThrough names where registration happens: 'registration' (this API), 'brandsAndCampaigns' (the US, whose 10DLC, Toll-Free and Short Code registrations use the Brands and Campaigns APIs; its types are not listed here) or null when the region needs none (Canada). This endpoint never refuses a closed type; it reports it as unavailable.",
        "operationId": "registration.readCatalog",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "ISO-2 country code, in any case. UK, GBR and United Kingdom (any case) are accepted as spellings of GB.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "region": {
                      "type": "string"
                    },
                    "jurisdiction": {
                      "type": "string"
                    },
                    "sendingRequiresRegistration": {
                      "type": "boolean"
                    },
                    "registeredThrough": {
                      "type": "string"
                    },
                    "provisioning": {
                      "type": "string"
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "channel": {
                            "type": "string"
                          },
                          "bundles": {
                            "type": "array",
                            "items": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "quantity": {
                            "type": "object",
                            "properties": {
                              "min": {
                                "type": "integer"
                              },
                              "max": {
                                "type": "integer"
                              }
                            }
                          },
                          "requiresParent": {},
                          "available": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "region": "GB",
                  "jurisdiction": "GB",
                  "sendingRequiresRegistration": true,
                  "registeredThrough": "registration",
                  "provisioning": "registration",
                  "types": [
                    {
                      "type": "VIRTUAL_LONG_CODE",
                      "kind": "sender",
                      "channel": "virtualLongCode",
                      "bundles": [
                        [
                          "SMS"
                        ],
                        [
                          "SMS",
                          "VOICE"
                        ]
                      ],
                      "quantity": {
                        "min": 1,
                        "max": 100
                      },
                      "requiresParent": null,
                      "available": true
                    },
                    {
                      "type": "ALPHANUMERIC_SENDER_ID",
                      "kind": "sender",
                      "channel": "alphanumeric",
                      "bundles": [
                        [
                          "SMS"
                        ]
                      ],
                      "quantity": {
                        "min": 1,
                        "max": 1
                      },
                      "requiresParent": null,
                      "available": true
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/quotes": {
      "get": {
        "tags": [
          "Registrations"
        ],
        "summary": "Return the group's setup and monthly prices for each capability bundle of a type, for the requested quantity.",
        "description": "Return the group's setup and monthly prices for each capability bundle of a type, for the requested quantity. Prices come from the group's effective fee schedule (a negotiated price, or the rate-card price when the fee field is null), so a quote is exactly what allocation and renewal will charge. All amounts are integer microdollars (1,000,000 = $1.00): setupAmount and monthlyAmount are per number, totalSetupAmount and totalMonthlyAmount are for the whole quantity. etaDays is the provider's typical lead time from approval, or null when it is unknown. Refused with a 400 when the type is not currently available in the region, or when a bundle has no price.",
        "operationId": "registration.readQuotes",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": true,
            "description": "ISO-2 country code, in any case. UK, GBR and United Kingdom (any case) are accepted as spellings of GB.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "The registration type to price, as listed by the catalog (for example VIRTUAL_LONG_CODE).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "required": false,
            "description": "Numbers to price, 1–100. Default: 1.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Group to quote. Signal House staff only; a customer is always quoted their active group.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "capabilities": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "setupAmount": {
                            "type": "integer"
                          },
                          "monthlyAmount": {
                            "type": "integer"
                          },
                          "totalSetupAmount": {
                            "type": "integer"
                          },
                          "totalMonthlyAmount": {
                            "type": "integer"
                          },
                          "etaDays": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "capabilities": [
                        "SMS"
                      ],
                      "quantity": 2,
                      "currency": "USD",
                      "setupAmount": 6000000,
                      "monthlyAmount": 6000000,
                      "totalSetupAmount": 12000000,
                      "totalMonthlyAmount": 12000000,
                      "etaDays": 20
                    },
                    {
                      "capabilities": [
                        "SMS",
                        "VOICE"
                      ],
                      "quantity": 2,
                      "currency": "USD",
                      "setupAmount": 30000000,
                      "monthlyAmount": 30000000,
                      "totalSetupAmount": 60000000,
                      "totalMonthlyAmount": 60000000,
                      "etaDays": 15
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/{registrationId}": {
      "get": {
        "tags": [
          "Registrations"
        ],
        "summary": "Retrieve one registration with its full status history.",
        "description": "Retrieve one registration with its full status history. The registration must belong to a group you can view; otherwise the request is refused, and an unknown id is a 404.",
        "operationId": "registration.readRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id returned by POST /registration: the region plus 10 characters, e.g. GB7M2Q9X4K3D, or RCSA plus 10 characters for an RCS agent (older records use a \"REG\" prefix)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "identity",
                        "program",
                        "sender"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "tenDLC",
                        "tollFree",
                        "shortCode",
                        "virtualLongCode",
                        "alphanumeric",
                        "rcs"
                      ]
                    },
                    "parentRegistrationId": {},
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "stage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "capabilities": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "submittedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "approvedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {},
                    "review": {
                      "type": "object",
                      "properties": {
                        "decision": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reviewedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "reason": {}
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "quantity": {
                          "type": "integer"
                        },
                        "useCases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "releasedNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "voice": {}
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "staff",
                              "system",
                              "provider"
                            ]
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "reason": {}
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "registrationId": "GB7M2Q9X4K3D",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "region": "GB",
                  "type": "VIRTUAL_LONG_CODE",
                  "kind": "sender",
                  "channel": "virtualLongCode",
                  "parentRegistrationId": null,
                  "status": "APPROVED",
                  "stage": "COMPLETED",
                  "capabilities": [
                    "SMS"
                  ],
                  "submittedAt": "2026-08-02T15:21:00.000Z",
                  "approvedAt": "2026-08-20T10:00:00.000Z",
                  "expiresAt": null,
                  "review": {
                    "decision": "APPROVE",
                    "reviewedAt": "2026-08-02T15:20:00.000Z",
                    "reason": null
                  },
                  "data": {
                    "quantity": 2,
                    "useCases": [
                      "Order and delivery notifications"
                    ],
                    "phoneNumbers": [
                      "447700900123",
                      "447700900124"
                    ],
                    "releasedNumbers": [],
                    "voice": null
                  },
                  "history": [
                    {
                      "status": "SIGNAL_HOUSE_REVIEW",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c58",
                      "actorType": "user",
                      "timestamp": "2026-08-01T09:00:00.000Z",
                      "reason": null
                    },
                    {
                      "status": "SIGNAL_HOUSE_APPROVED",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c99",
                      "actorType": "staff",
                      "timestamp": "2026-08-02T15:20:00.000Z",
                      "reason": null
                    },
                    {
                      "status": "SUBMITTING",
                      "stage": null,
                      "actor": "SYSTEM",
                      "actorType": "system",
                      "timestamp": "2026-08-02T15:21:00.000Z",
                      "reason": null
                    },
                    {
                      "status": "PENDING_PROVIDER",
                      "stage": "IN_REVIEW",
                      "actor": "SYSTEM",
                      "actorType": "provider",
                      "timestamp": "2026-08-02T15:21:30.000Z",
                      "reason": null
                    },
                    {
                      "status": "APPROVED",
                      "stage": "COMPLETED",
                      "actor": "SYSTEM",
                      "actorType": "system",
                      "timestamp": "2026-08-20T10:00:00.000Z",
                      "reason": null
                    }
                  ],
                  "createdAt": "2026-08-01T09:00:00.000Z",
                  "updatedAt": "2026-08-20T10:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Registrations"
        ],
        "summary": "Cancel a registration.",
        "description": "Cancel a registration. Allowed from SIGNAL_HOUSE_REVIEW, SIGNAL_HOUSE_APPROVED, PENDING_PROVIDER, NEEDS_INFORMATION, PAYMENT_REQUIRED and APPROVED, and for a type that keeps drafts (RCS_AGENT) also from DRAFT and SIGNAL_HOUSE_REJECTED; any other status is a 409, including SUBMITTING and RECONCILIATION_REQUIRED, whose carrier outcome is not yet known. The carrier order is settled first: an order awaiting an update is cancelled with the carrier, and an order the carrier is still processing is a 409 with nothing changed, so retry once it completes or the carrier asks for an update. The registration then stops polling its carrier order. With no numbers allocated it moves to CANCELLED. With numbers allocated it moves to PENDING_DELETE, the numbers stop sending at once and are released back to the carrier (as DELETE /number would), and it moves to DELETED once the last one is released. An RCS_AGENT the carrier partner has created holds no numbers but still moves to PENDING_DELETE: it stops sending at once, Signal House asks the partner to cancel it, and it moves to DELETED when the partner confirms; a second cancel while it waits is a 409. Releasing numbers also requires your active group to own the registration, and the group must not be under compliance review. The registration must belong to a group you can view; an unknown id is a 404.",
        "operationId": "registration.cancelRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "capabilities": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "quantity": {
                          "type": "integer"
                        },
                        "useCases": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "releasedNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "voice": {}
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {},
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "staff",
                              "system",
                              "provider"
                            ]
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "reason": {}
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "registrationId": "GB7M2Q9X4K3D",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "region": "GB",
                  "type": "VIRTUAL_LONG_CODE",
                  "status": "CANCELLED",
                  "capabilities": [
                    "SMS"
                  ],
                  "data": {
                    "quantity": 2,
                    "useCases": [
                      "Marketing"
                    ],
                    "phoneNumbers": [],
                    "releasedNumbers": [],
                    "voice": null
                  },
                  "history": [
                    {
                      "status": "SIGNAL_HOUSE_REVIEW",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c58",
                      "actorType": "user",
                      "timestamp": "2026-08-01T09:00:00.000Z",
                      "reason": null
                    },
                    {
                      "status": "CANCELLED",
                      "stage": null,
                      "actor": "60f7b2a1c9e77c001a2b3c58",
                      "actorType": "user",
                      "timestamp": "2026-08-01T09:30:00.000Z",
                      "reason": null
                    }
                  ],
                  "createdAt": "2026-08-01T09:00:00.000Z",
                  "updatedAt": "2026-08-01T09:30:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Registrations"
        ],
        "summary": "Edit a registration of a type that keeps drafts (RCS_AGENT) while it may change: DRAFT, SIGNAL_HOUSE_REJECTED, NEEDS_INFORMATION, or PENDING_PROVIDER while the provider still accepts profile changes (an RCS sender READY_FOR_TESTING or SENDER_UPDATE_REQUIRED; the change is pushed to the provider).",
        "description": "Edit a registration of a type that keeps drafts (RCS_AGENT) while it may change: DRAFT, SIGNAL_HOUSE_REJECTED, NEEDS_INFORMATION, or PENDING_PROVIDER while the provider still accepts profile changes (an RCS sender READY_FOR_TESTING or SENDER_UPDATE_REQUIRED; the change is pushed to the provider). The body is a partial of the type's create fields; for RCS_AGENT, agent, consent and contact merge field by field, every other key replaces, and campaignId: null unlinks the campaign. Once the agent exists at the provider its profile must stay complete, and while a launch request is live its launch answers must too; an edit that breaks either is a 400 with details.code REGISTRATION_INCOMPLETE. Any other status, or a type without drafts, is a 409. Two edits racing on one draft cannot both land: the later one is a 409. The registration must belong to your active group.",
        "operationId": "registration.updateRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "description": "- (body) (Body Param): The fields to change, in the type's create shape (see RCS Agents for RCS_AGENT).",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "campaignId": {
                    "type": "string"
                  },
                  "agent": {
                    "type": "object",
                    "properties": {
                      "description": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "example": {
                "campaignId": "C4E5F6G",
                "agent": {
                  "description": "Order and delivery alerts from Acme"
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "identity",
                        "program",
                        "sender"
                      ]
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "tenDLC",
                        "tollFree",
                        "shortCode",
                        "virtualLongCode",
                        "alphanumeric",
                        "rcs"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "brandRef": {
                          "type": "string"
                        },
                        "campaignRef": {
                          "type": "string"
                        }
                      }
                    },
                    "launchable": {
                      "type": "boolean"
                    },
                    "googleAgentId": {},
                    "links": {
                      "type": "object",
                      "properties": {
                        "brand": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "brandRef": {
                              "type": "string"
                            },
                            "brandId": {
                              "type": "string"
                            },
                            "displayName": {
                              "type": "string"
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "PENDING_CREATION",
                                "PENDING_APPROVAL",
                                "UNVERIFIED",
                                "VERIFIED",
                                "VETTED_VERIFIED",
                                "PENDING_DELETE",
                                "DELETED",
                                "DCA_PENDING",
                                "DCA_ACTIVE",
                                "DCA_REJECTED",
                                "DCA_PENDING_2FA",
                                "DCA_PENDING_APPEAL",
                                "SHORT_CODE_REJECTED",
                                null
                              ]
                            }
                          }
                        },
                        "campaign": {
                          "type": "object",
                          "properties": {
                            "state": {
                              "type": "string"
                            },
                            "campaignRef": {
                              "type": "string"
                            },
                            "campaignId": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "registrationId": "RCSA7K2M1QZ8RP",
                  "type": "RCS_AGENT",
                  "kind": "sender",
                  "channel": "rcs",
                  "status": "DRAFT",
                  "data": {
                    "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                    "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7"
                  },
                  "launchable": false,
                  "googleAgentId": null,
                  "links": {
                    "brand": {
                      "state": "OK",
                      "brandRef": "65a1f0c2e4b0a1b2c3d4e5f6",
                      "brandId": "B1A2C3D",
                      "displayName": "Acme",
                      "status": "VERIFIED"
                    },
                    "campaign": {
                      "state": "OK",
                      "campaignRef": "65a1f0c2e4b0a1b2c3d4e5f7",
                      "campaignId": "C4E5F6G",
                      "status": "ACTIVE"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/{registrationId}/carrier-update": {
      "post": {
        "tags": [
          "Registrations"
        ],
        "summary": "Send Signal House the corrected launch answers of an RCS agent after a carrier rejected a launch that other carriers took (agent status PARTIALLY_LAUNCHED with a REJECTED carrier).",
        "description": "Send Signal House the corrected launch answers of an RCS agent after a carrier rejected a launch that other carriers took (agent status PARTIALLY_LAUNCHED with a REJECTED carrier). The carrier partner takes no change through its API once a carrier launched, so edit consent and contact first (PUT /rcs/agent/:agentId), then send this; Signal House emails the update to the carrier partner. The body is empty: the carriers are the ones whose row reads REJECTED. data.carrierUpdate reads REQUESTED, then SENT once Signal House sent it, and the carrier row changes when the partner reports the carrier's new decision. A 409 when no carrier row is REJECTED after a partial launch, when an update is already REQUESTED, or when the agent changed meanwhile. While the status is REQUESTED, edits return 409; after staff mark it SENT, you may edit and send another update. Returns the registration.",
        "operationId": "registration.requestCarrierUpdate",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agent's id, which is its registrationId (RCSA + 10 characters)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "stage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "consent": {
                          "type": "object",
                          "properties": {
                            "optInDetails": {
                              "type": "string"
                            },
                            "optInUrl": {
                              "type": "string"
                            },
                            "optInResponse": {
                              "type": "string"
                            },
                            "optOutDetails": {
                              "type": "string"
                            },
                            "optOutResponse": {
                              "type": "string"
                            },
                            "helpResponse": {
                              "type": "string"
                            },
                            "campaignDescription": {
                              "type": "string"
                            },
                            "messageExamples": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "estimatedMonthlyVolume": {
                              "type": "string"
                            },
                            "launchVideoUrl": {
                              "type": "string"
                            }
                          }
                        },
                        "contact": {
                          "type": "object",
                          "properties": {
                            "firstName": {
                              "type": "string"
                            },
                            "lastName": {
                              "type": "string"
                            },
                            "role": {
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "mobile": {
                              "type": "string"
                            }
                          }
                        },
                        "carriers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "carrier": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "rejectionReason": {},
                              "feedback": {},
                              "updatedAt": {
                                "type": "string"
                              },
                              "submittedAt": {
                                "type": "string"
                              },
                              "rejectionReasons": {
                                "type": "array",
                                "items": {}
                              }
                            }
                          }
                        },
                        "carrierUpdate": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string"
                            },
                            "carriers": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "requestedAt": {
                              "type": "string"
                            },
                            "requestedBy": {
                              "type": "string"
                            },
                            "sentAt": {},
                            "sentBy": {}
                          }
                        }
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "staff",
                              "system",
                              "provider"
                            ]
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "eventType": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "registrationId": "RCSA7K2M1QZ8RP",
                  "type": "RCS_AGENT",
                  "status": "APPROVED",
                  "stage": "LAUNCHED_PARTIAL_SUCCESS",
                  "data": {
                    "consent": {
                      "optInDetails": "Customers tick a box at checkout to get order alerts.",
                      "optInUrl": "https://www.acme.example/alerts",
                      "optInResponse": "Acme: you will get order alerts. Reply STOP to stop.",
                      "optOutDetails": "Reply STOP to any message, or turn alerts off in account settings.",
                      "optOutResponse": "Acme: you are unsubscribed and will get no more messages.",
                      "helpResponse": "Acme: for help visit acme.example/help. Reply STOP to stop.",
                      "campaignDescription": "Order confirmations and delivery updates from Acme.",
                      "messageExamples": [
                        "Acme: your order A-48213 has shipped.",
                        "Acme: your order A-48213 arrives today."
                      ],
                      "estimatedMonthlyVolume": "UP_TO_10K",
                      "launchVideoUrl": "https://www.acme.example/rcs-demo.mp4"
                    },
                    "contact": {
                      "firstName": "Ada",
                      "lastName": "Lovelace",
                      "role": "Marketing lead",
                      "email": "ada.lovelace@acme.example",
                      "mobile": "+15125550101"
                    },
                    "carriers": [
                      {
                        "carrier": "ATT",
                        "status": "COMPLETED",
                        "rejectionReason": null,
                        "feedback": null,
                        "updatedAt": "2026-10-30T15:00:00.000Z",
                        "submittedAt": "2026-10-27T15:00:00.000Z",
                        "rejectionReasons": []
                      },
                      {
                        "carrier": "VERIZON",
                        "status": "REJECTED",
                        "rejectionReason": null,
                        "feedback": null,
                        "updatedAt": "2026-10-28T15:00:00.000Z",
                        "submittedAt": "2026-10-27T15:00:00.000Z",
                        "rejectionReasons": [
                          {
                            "field": "optInExample",
                            "code": "CARRIER_COMMENT",
                            "reason": "Rate disclosure missing",
                            "recommendedAction": "Read the comment and update the agent to match."
                          }
                        ]
                      }
                    ],
                    "carrierUpdate": {
                      "status": "REQUESTED",
                      "carriers": [
                        "VERIZON"
                      ],
                      "requestedAt": "2026-11-02T15:00:00.000Z",
                      "requestedBy": "60f7b2a1c9e77c001a2b3c4d",
                      "sentAt": null,
                      "sentBy": null
                    }
                  },
                  "history": [
                    {
                      "status": "APPROVED",
                      "stage": "LAUNCHED_PARTIAL_SUCCESS",
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-11-02T15:00:00.000Z",
                      "reason": "Carrier update sent to Signal House for VERIZON",
                      "eventType": "CARRIER_UPDATE_REQUESTED"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestCarrierUpdateRequest"
              }
            }
          }
        }
      }
    },
    "/registration/{registrationId}/launch": {
      "post": {
        "tags": [
          "Registrations"
        ],
        "summary": "Request the launch of a registration the provider already holds: an RCS agent the carrier partner reports READY_FOR_TESTING.",
        "description": "Request the launch of a registration the provider already holds: an RCS agent the carrier partner reports READY_FOR_TESTING. The launch requirements are checked (a VERIFIED brand, the linked campaign, the full consent with the launch video, the contact, links that load over https, STOP and HELP in the opt-out details and HELP response, and acknowledgePhi for a healthcare or insurance brand) and the registration goes to SIGNAL_HOUSE_REVIEW; Signal House's approval files the provider's launch request, after which the carrier partner's webhooks move the registration (stage PENDING_LAUNCH, LAUNCHED_IN_PROGRESS, …; data.carriers per carrier). Allowed while the agent is in testing, after a Signal House rejection of an earlier request, and after every carrier refused one (NEEDS_INFORMATION with no live request); any other state is a 409. A failed requirement is a 400 whose details carry { code: REGISTRATION_INCOMPLETE, errors, warnings }. The request charges an RCS agent's launch fees: a wallet that cannot cover them gets a 402 and the registration does not move. Signal House rejecting the request, or a cancellation before filing, refunds them all. After filing, only the T-Mobile activation is refundable, if T-Mobile rejects the agent. The launch text must also pass the carriers' copy rules (see POST /rcs/agent/:agentId/validate); each failure is an error whose code is the carrier partner's key. A group that has not finished account verification is a 403 with details.code GROUP_UNVERIFIED, and a rejected group a 403 with GROUP_REJECTED; a pending verification passes.",
        "operationId": "registration.launchRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id (an agent's RCSA id)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchRegistrationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "stage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "submittedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "stage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "actor": {
                            "type": "string"
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "user",
                              "staff",
                              "system",
                              "provider"
                            ]
                          },
                          "timestamp": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "registrationId": "RCSA7K2M1QZ8RP",
                  "type": "RCS_AGENT",
                  "status": "SIGNAL_HOUSE_REVIEW",
                  "stage": "READY_FOR_TESTING",
                  "submittedAt": "2026-10-21T15:10:00.000Z",
                  "history": [
                    {
                      "status": "SIGNAL_HOUSE_REVIEW",
                      "stage": "READY_FOR_TESTING",
                      "actor": "60f7b2a1c9e77c001a2b3c4d",
                      "actorType": "user",
                      "timestamp": "2026-10-24T09:00:00.000Z",
                      "reason": "Launch requested"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/{registrationId}/submit": {
      "post": {
        "tags": [
          "Registrations"
        ],
        "summary": "Submit a DRAFT after the same checks validate runs.",
        "description": "Submit a DRAFT after the same checks validate runs. A type Signal House reviews goes to SIGNAL_HOUSE_REVIEW; a type it does not review first (RCS_AGENT) goes to SUBMITTING and is filed with the provider at once (the agent is created at the carrier partner). A failed check is a 400 whose details carry { code: REGISTRATION_INCOMPLETE, errors, warnings }; a second submit, one on a registration the provider already holds, or an edit that lands first, is a 409. An RCS agent whose group has not finished account verification is a 403 with details.code GROUP_UNVERIFIED, and one whose group is rejected a 403 with GROUP_REJECTED; a pending verification passes.",
        "operationId": "registration.submitRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id."
          },
          {
            "name": "X-SignalHouse-Client",
            "in": "header",
            "required": false,
            "description": "Optional. The client sending the request, as <name>/<version> (for example mcp/0.4.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-SignalHouse-Guide-Version",
            "in": "header",
            "required": false,
            "description": "Optional. The interview guide version that produced the request, as <guide>@<tag> or <channel>.<region>@<tag> (for example 10dlc.us@1.0.0). Stored for registration attribution; a malformed value is ignored. See Registration Attribution.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registrationId": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "TEN_DLC_BRAND",
                        "TEN_DLC_CAMPAIGN",
                        "TOLL_FREE_BRAND",
                        "TOLL_FREE_CAMPAIGN",
                        "SHORT_CODE_BRAND",
                        "SHORT_CODE_PROGRAM",
                        "SHORT_CODE_LEASE",
                        "VIRTUAL_LONG_CODE",
                        "ALPHANUMERIC_SENDER_ID",
                        "RCS_AGENT"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "SIGNAL_HOUSE_REVIEW",
                        "SIGNAL_HOUSE_APPROVED",
                        "SIGNAL_HOUSE_REJECTED",
                        "SUBMITTING",
                        "PENDING_PROVIDER",
                        "NEEDS_INFORMATION",
                        "PAYMENT_REQUIRED",
                        "APPROVED",
                        "REJECTED",
                        "CANCELLED",
                        "PENDING_DELETE",
                        "DELETED",
                        "EXPIRED",
                        "RECONCILIATION_REQUIRED"
                      ]
                    },
                    "stage": {},
                    "submittedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "registrationId": "RCSA7K2M1QZ8RP",
                  "type": "RCS_AGENT",
                  "status": "SUBMITTING",
                  "stage": null,
                  "submittedAt": "2026-10-21T15:10:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/registration/{registrationId}/validate": {
      "post": {
        "tags": [
          "Registrations"
        ],
        "summary": "Check a draft against every submit requirement and the live state of what it links to, without writing anything.",
        "description": "Check a draft against every submit requirement and the live state of what it links to, without writing anything. Returns errors that block submit and warnings that do not.",
        "operationId": "registration.validateRegistration",
        "parameters": [
          {
            "name": "registrationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "valid": false,
                  "errors": [
                    {
                      "field": "campaignRef",
                      "reason": "Link a 10DLC campaign"
                    }
                  ],
                  "warnings": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/shortlink": {
      "get": {
        "tags": [
          "Shortlinks"
        ],
        "summary": "Read shortlink details/analytics.",
        "description": "Read shortlink details/analytics. Customer roles must pass at least one filter — an unfiltered read-all is restricted to internal use. visits counts people; link previews and scanners count in prefetchVisits.",
        "operationId": "shortlink.readShortlink",
        "parameters": [
          {
            "name": "shortlink",
            "in": "query",
            "required": false,
            "description": "Filter by shortlink.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "required": false,
            "description": "Filter by originating Message ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "campaignId",
            "in": "query",
            "required": false,
            "description": "Filter by Campaign ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brandId",
            "in": "query",
            "required": false,
            "description": "Filter by Brand ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "brandId": {
                        "type": "string"
                      },
                      "campaignId": {
                        "type": "string"
                      },
                      "phoneNumber": {
                        "type": "string"
                      },
                      "messageId": {
                        "type": "string"
                      },
                      "originalUrl": {
                        "type": "string"
                      },
                      "shortlink": {
                        "type": "string"
                      },
                      "visits": {
                        "type": "integer"
                      },
                      "prefetchVisits": {
                        "type": "integer"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5d",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "brandId": "B1234567",
                    "campaignId": "C1234567",
                    "phoneNumber": "12246431042",
                    "messageId": "60f7b2a1c9e77c001a2b3c58",
                    "originalUrl": "https://example.com/promo",
                    "shortlink": "abc123",
                    "visits": 42,
                    "prefetchVisits": 3,
                    "createdAt": "2024-01-15T14:30:00.000Z",
                    "updatedAt": "2024-01-15T16:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/shortlink/optout/{code}": {
      "get": {
        "tags": [
          "Shortlinks"
        ],
        "summary": "Public endpoint behind the opt-out link Signal House appends to every message sent from a UK Alphanumeric Sender ID (sihou.io/o/:code).",
        "description": "Public endpoint behind the opt-out link Signal House appends to every message sent from a UK Alphanumeric Sender ID (sihou.io/o/:code). Returns what the opt-out page shows: the sender name, the recipient masked to its country code, two digits and last three digits, and whether the recipient has already opted out. Reading never opts the recipient out, so link scanners and previews are safe. Does not require auth. An unknown or malformed code returns a 404.",
        "operationId": "shortlink.readOptOutLink",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The opt-out code from the link."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "senderName": {
                      "type": "string"
                    },
                    "maskedRecipient": {
                      "type": "string"
                    },
                    "optedOut": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "code": "Xk3P9qa",
                  "senderName": "ACME",
                  "maskedRecipient": "+4479•••••456",
                  "optedOut": false
                }
              }
            }
          }
        },
        "security": []
      },
      "post": {
        "tags": [
          "Shortlinks"
        ],
        "summary": "Public endpoint that confirms the opt-out behind an opt-out link.",
        "description": "Public endpoint that confirms the opt-out behind an opt-out link. It records the same STOP an inbound keyword would, so the recipient is added to the sender group's Do Not Contact list, and stamps the link as used. Takes no body. Idempotent: confirming again re-asserts the opt-out and returns the same result. Does not require auth. An unknown or malformed code returns a 404.",
        "operationId": "shortlink.confirmOptOut",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The opt-out code from the link."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "senderName": {
                      "type": "string"
                    },
                    "maskedRecipient": {
                      "type": "string"
                    },
                    "optedOut": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "code": "Xk3P9qa",
                  "senderName": "ACME",
                  "maskedRecipient": "+4479•••••456",
                  "optedOut": true
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/shortlink/redirect/{shortlink}": {
      "get": {
        "tags": [
          "Shortlinks"
        ],
        "summary": "Public endpoint that resolves a shortcode and returns the original URL as JSON.",
        "description": "Public endpoint that resolves a shortcode and returns the original URL as JSON. Also records a click for analytics. Does not require auth. The caller is responsible for performing the actual redirect.",
        "operationId": "shortlink.redirectShortlink",
        "parameters": [
          {
            "name": "shortlink",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The shortcode generated by the system."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "originalUrl": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "originalUrl": "https://example.com/promo"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/subgroup": {
      "get": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Retrieve subgroup records.",
        "description": "Retrieve subgroup records. Customer roles must pass at least one filter (id or groupId) — an unfiltered read-all is restricted to internal use.",
        "operationId": "subgroup.readSubgroup",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific Subgroup ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by parent Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "With groupId: free text finds part of the subgroup ID, name or company name. `field:` names subgroupId, subgroupName or subgroupCompanyName. Repeat the param to send several values; every value must match. Each value is free text, or `field:term` to search one field. Each term is 3 to 100 characters, with at most 5 values; a shorter term returns 400. Works with the scoping filters above.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "subgroupId": {
                        "type": "string"
                      },
                      "subgroupName": {
                        "type": "string"
                      },
                      "contactFirstName": {
                        "type": "string"
                      },
                      "contactLastName": {
                        "type": "string"
                      },
                      "subgroupCompanyName": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "carrierIdFamily": {
                        "type": "string"
                      },
                      "carrierIdRegion": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c5e",
                    "groupId": "G1234567",
                    "subgroupId": "S1234567",
                    "subgroupName": "Marketing Team",
                    "contactFirstName": "Jane",
                    "contactLastName": "Smith",
                    "subgroupCompanyName": "Acme Marketing Division",
                    "status": "active",
                    "carrierIdFamily": "Default",
                    "carrierIdRegion": null,
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Create a new Subgroup.",
        "description": "Create a new Subgroup.",
        "operationId": "subgroup.createSubgroup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSubgroupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "subgroupName": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "carrierIdFamily": {
                      "type": "string"
                    },
                    "carrierIdRegion": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5e",
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "subgroupName": "Marketing Team",
                  "status": "active",
                  "carrierIdFamily": "Default",
                  "carrierIdRegion": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/subgroup/counts": {
      "get": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Retrieve resource counts grouped by subgroup.",
        "description": "Retrieve resource counts grouped by subgroup. Results include only groups the authenticated caller can access.",
        "operationId": "subgroup.getSubgroupCounts",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Restrict results to an accessible Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Restrict results to a subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum rows to return (1–1000).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip; requires limit.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "groupId": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "endpoints": {
                            "type": "integer"
                          },
                          "api_keys": {
                            "type": "integer"
                          },
                          "brands": {
                            "type": "integer"
                          },
                          "campaigns": {
                            "type": "integer"
                          },
                          "phone_numbers": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "totalPages": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "groupId": "G1234567",
                      "subgroupId": "S1234567",
                      "endpoints": 3,
                      "api_keys": 1,
                      "brands": 1,
                      "campaigns": 1,
                      "phone_numbers": 2
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 20,
                  "totalPages": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/subgroup/ghl-location-lookup": {
      "get": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Resolve the mapping between a GoHighLevel location and a Signal House subgroup, in either direction.",
        "description": "Resolve the mapping between a GoHighLevel location and a Signal House subgroup, in either direction. Provide exactly one of ghlLocationId or subgroupId — passing both or neither returns 400. groupId is optional: customer roles default to their own accessible group(s) and are rejected (403) only if they explicitly name a group they don't belong to. A subgroupId or ghlLocationId that belongs to a different group than the caller's returns 404 — identical to a nonexistent one, so a cross-group id never reveals that it exists elsewhere. A subgroup with no linked GHL location returns 200 with ghlLocationId and ghlLocationName both null.",
        "operationId": "subgroup.readGhlLocationLookup",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Restrict the lookup to an accessible Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ghlLocationId",
            "in": "query",
            "required": false,
            "description": "GHL location ID to resolve to its subgroup. Mutually exclusive with subgroupId.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Subgroup ID to resolve to its GHL location. Mutually exclusive with ghlLocationId.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "groupId": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "subgroupName": {
                      "type": "string"
                    },
                    "ghlLocationId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ghlLocationName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "groupId": "G1234567",
                  "subgroupId": "S1234567",
                  "subgroupName": "Marketing Team",
                  "ghlLocationId": "abc123locid",
                  "ghlLocationName": "Acme Marketing"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/subgroup/{id}": {
      "put": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Update an existing subgroup.",
        "description": "Update an existing subgroup.",
        "operationId": "subgroup.updateSubgroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subgroup ID to update."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSubgroupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "subgroupId": {
                      "type": "string"
                    },
                    "subgroupName": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "carrierIdFamily": {
                      "type": "string"
                    },
                    "carrierIdRegion": {},
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c5e",
                  "subgroupId": "S1234567",
                  "subgroupName": "Marketing Team Updated",
                  "status": "active",
                  "carrierIdFamily": "Default",
                  "carrierIdRegion": null,
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Subgroups"
        ],
        "summary": "Inactivate a subgroup (must not have active brands).",
        "description": "Inactivate a subgroup (must not have active brands).",
        "operationId": "subgroup.deleteSubgroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subgroup ID to delete."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Subgroup S1234567 inactivated successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/subscription/user": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Retrieve subscription records for a group.",
        "description": "Retrieve subscription records for a group. Returns all records (including expired) by default; pass onlyActive=true to exclude expired subscriptions. Custom volume-tiered plans also return volumeTiers, monthlyMinimumSmsSegments, rampDays, rampEndsAt, volumeContractStartedAt, periodOutboundSmsSegments, volumePeriodClosedAt, nextPeriodOutboundSmsSegments, laterPeriodOutboundSmsSegments, volumeTrueUpLines, unpaidVolumeTrueUpLines, unpaidMonthlyFees, and nextRenewalAttemptAt. A volume plan's periods are UTC calendar months, and an expired period keeps its own periodEnd, so consecutive periods never overlap. laterPeriodOutboundSmsSegments is present only when the period's renewal is more than a month late: it holds the segments sent in each later calendar month, keyed YYYY-MM, so each month keeps its own count. nextRenewalAttemptAt is null unless a renewal charge failed, in which case it is when the renewal is next retried. volumePeriodClosedAt is null except while the period is being closed for billing; from then on periodOutboundSmsSegments is final and new sends are counted in nextPeriodOutboundSmsSegments, which becomes the next period's starting count. volumeTrueUpLines is absent until the period is closed, then lists the shortfall billed for it as [{ quantity, unitPrice }] in microdollars (empty when the minimum was met). unpaidVolumeTrueUpLines lists shortfall from earlier periods whose payment failed, as [{ quantity, unitPrice, referenceId }]; the plan still moves to its next period on schedule, and this debt is collected with that period's own shortfall at its close. It is empty when nothing is owed. unpaidMonthlyFees lists monthly fees from earlier periods whose payment failed, as [{ amount, description, referenceId }] in microdollars, collected at the same time; empty when nothing is owed. Every subscription also returns periodChargesFundedAmount: microdollars already charged to the card and credited to the wallet for charges not yet settled, so a retry charges the card only for the rest; 0 when nothing is pending. periodChargesFundedLines lists the charges that amount was collected for, as [{ referenceId, amount }], and periodChargesFundingPending is { amount, startedAt, attemptId } while a card charge for them is in progress or awaiting reconciliation, otherwise null.",
        "operationId": "subscription.readUserSubscriptions",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "onlyActive",
            "in": "query",
            "required": false,
            "description": "Boolean.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "templateId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "monthlyFee": {
                        "type": "integer"
                      },
                      "monthlyPlanSmsSegments": {
                        "type": "integer"
                      },
                      "accumulatedSmsSegments": {
                        "type": "integer"
                      },
                      "usedSmsSegments": {
                        "type": "integer"
                      },
                      "monthlyPlanMmsSegments": {
                        "type": "integer"
                      },
                      "accumulatedMmsSegments": {
                        "type": "integer"
                      },
                      "usedMmsSegments": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "ACTIVE",
                          "EXPIRED",
                          "PENDING_DOWNGRADE"
                        ]
                      },
                      "periodStart": {
                        "type": "string"
                      },
                      "periodEnd": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c60",
                    "groupId": "G1234567",
                    "templateId": "60f7b2a1c9e77c001a2b3c5f",
                    "name": "Pro Plan",
                    "description": "Ideal for growing businesses with high messaging volume.",
                    "monthlyFee": 99000000,
                    "monthlyPlanSmsSegments": 10000,
                    "accumulatedSmsSegments": 10000,
                    "usedSmsSegments": 3500,
                    "monthlyPlanMmsSegments": 2000,
                    "accumulatedMmsSegments": 2000,
                    "usedMmsSegments": 500,
                    "status": "ACTIVE",
                    "periodStart": "2024-01-15T00:00:00.000Z",
                    "periodEnd": "2024-02-14T00:00:00.000Z",
                    "createdAt": "2024-01-15T00:00:00.000Z",
                    "updatedAt": "2024-01-15T00:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/subscription/user/cancel/{groupId}": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Cancel a group's active subscription (downgrades at end of billing cycle).",
        "description": "Cancel a group's active subscription (downgrades at end of billing cycle). A contracted volume-tiered plan can only be cancelled by Signal House: for these roles the request returns 403 when the group is on one. Contact Signal House to change or end it.",
        "operationId": "subscription.cancelUserSubscription",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "monthlyFee": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "EXPIRED",
                        "PENDING_DOWNGRADE"
                      ]
                    },
                    "nextTemplateId": {},
                    "periodStart": {
                      "type": "string"
                    },
                    "periodEnd": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c70",
                  "groupId": "G1234567",
                  "templateId": "60f7b2a1c9e77c001a2b3c71",
                  "name": "Pro Plan",
                  "monthlyFee": 99000000,
                  "status": "PENDING_DOWNGRADE",
                  "nextTemplateId": null,
                  "periodStart": "2024-01-15T00:00:00.000Z",
                  "periodEnd": "2024-02-14T00:00:00.000Z",
                  "createdAt": "2024-01-15T00:00:00.000Z",
                  "updatedAt": "2024-01-20T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/subscription/user/subscribe/{groupId}/{templateId}": {
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Subscribe a group to a paid template plan (Charges wallet immediately).",
        "description": "Subscribe a group to a paid template plan (Charges wallet immediately). Always returns HTTP 201, but the response body has three possible shapes: (a) New plan or upgrade — returns a new subscription object with status: 'ACTIVE' and a fresh _id. (b) Downgrade — returns the existing subscription object updated to status: 'PENDING_DOWNGRADE' with nextTemplateId set to the requested template; periodStart/periodEnd are unchanged. (c) Same plan — returns { Message: 'You are already on the same plan' } (capital-M key, not a subscription object). Returns 400 when the group is on a contracted volume-tiered plan: that plan cannot be switched to a template. Contact Signal House to change or end it.",
        "operationId": "subscription.createUserSubscriptionFromTemplate",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Group ID."
          },
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Subscription Template ObjectId."
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "monthlyFee": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "EXPIRED",
                        "PENDING_DOWNGRADE"
                      ]
                    },
                    "periodStart": {
                      "type": "string"
                    },
                    "periodEnd": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c60",
                  "groupId": "G1234567",
                  "templateId": "60f7b2a1c9e77c001a2b3c5f",
                  "name": "Pro Plan",
                  "monthlyFee": 99000000,
                  "status": "ACTIVE",
                  "periodStart": "2024-01-15T00:00:00.000Z",
                  "periodEnd": "2024-02-14T00:00:00.000Z",
                  "createdAt": "2024-01-15T00:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "user"
        ]
      }
    },
    "/template": {
      "post": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Create a template with draft version 1 (head revision 1).",
        "description": "Create a template with draft version 1 (head revision 1). The draft may be incomplete: it saves, and validation lists what would stop it publishing.",
        "operationId": "template.createTemplate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "description": "Group that owns the template. Must be your active group, with RCS enabled (otherwise 403)."
                  },
                  "name": {
                    "description": "Library name, 1–120 characters, unique per group and channel."
                  },
                  "tag": {
                    "description": "Tag shown in the portal (1–60 characters). Presentation only; it never affects delivery."
                  },
                  "body": {
                    "description": "The raw RCS template body (see the contract above). contentFormat is optional: omitted means content.v1; \"google.rcs\" sends Google's RBM content, which is converted and stored as content.v1. Drafts may be incomplete."
                  }
                },
                "required": [
                  "groupId",
                  "name",
                  "body"
                ]
              },
              "example": {
                "groupId": "G1234567",
                "name": "Order ready",
                "tag": "Order Confirmation",
                "body": {
                  "channel": "rcs",
                  "contentFormat": "content.v1",
                  "content": {
                    "blocks": [
                      {
                        "id": "b1",
                        "kind": "text",
                        "text": "Order {{order_number}} is ready."
                      },
                      {
                        "id": "b2",
                        "kind": "suggestions",
                        "suggestions": [
                          {
                            "type": "REPLY",
                            "label": "Thanks",
                            "postbackData": "order_ack"
                          }
                        ]
                      }
                    ]
                  },
                  "variables": [
                    {
                      "key": "order_number",
                      "type": "text",
                      "required": true,
                      "sample": "A-48213"
                    }
                  ],
                  "defaults": {
                    "trafficType": "TRANSACTION"
                  },
                  "fallback": {
                    "delivery": {
                      "channel": "sms",
                      "campaignId": "CABC123",
                      "phoneNumber": "15551234567",
                      "content": {
                        "text": "Order {{order_number}} is ready."
                      }
                    }
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "head": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "rcs"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tag": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {},
                        "draftVersion": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "publishedVersion": {},
                        "revision": {
                          "type": "integer"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "hasUnpublishedChanges": {
                          "type": "boolean"
                        }
                      }
                    },
                    "version": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PUBLISHED"
                          ]
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "type": "string"
                            },
                            "contentFormat": {
                              "type": "string"
                            },
                            "content": {
                              "type": "object",
                              "properties": {
                                "blocks": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "kind": {
                                        "type": "string"
                                      },
                                      "text": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "required": {
                                    "type": "boolean"
                                  },
                                  "sample": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "defaults": {
                              "type": "object",
                              "properties": {
                                "trafficType": {
                                  "type": "string"
                                }
                              }
                            },
                            "fallback": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "type": "object",
                                  "properties": {
                                    "channel": {
                                      "type": "string"
                                    },
                                    "campaignId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "object",
                                      "properties": {
                                        "text": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "contentHash": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "publishedAt": {}
                      }
                    },
                    "validation": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean"
                        },
                        "errors": {
                          "type": "array",
                          "items": {}
                        },
                        "warnings": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "head": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "channel": "rcs",
                    "name": "Order ready",
                    "tag": "Order Confirmation",
                    "archivedAt": null,
                    "draftVersion": 1,
                    "publishedVersion": null,
                    "revision": 1,
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "state": "DRAFT",
                    "hasUnpublishedChanges": false
                  },
                  "version": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "version": 1,
                    "state": "DRAFT",
                    "body": {
                      "channel": "rcs",
                      "contentFormat": "content.v1",
                      "content": {
                        "blocks": [
                          {
                            "id": "b1",
                            "kind": "text",
                            "text": "Order {{order_number}} is ready."
                          },
                          {
                            "id": "b2",
                            "kind": "suggestions",
                            "suggestions": [
                              {
                                "type": "REPLY",
                                "label": "Thanks",
                                "postbackData": "order_ack"
                              }
                            ]
                          }
                        ]
                      },
                      "variables": [
                        {
                          "key": "order_number",
                          "type": "text",
                          "required": true,
                          "sample": "A-48213"
                        }
                      ],
                      "defaults": {
                        "trafficType": "TRANSACTION"
                      },
                      "fallback": {
                        "delivery": {
                          "channel": "sms",
                          "campaignId": "CABC123",
                          "phoneNumber": "15551234567",
                          "content": {
                            "text": "Order {{order_number}} is ready."
                          }
                        }
                      }
                    },
                    "contentHash": "9f2c4e…",
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "publishedAt": null
                  },
                  "validation": {
                    "valid": true,
                    "errors": [],
                    "warnings": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "get": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "List a group's templates with server-side filters, sorting and pagination.",
        "description": "List a group's templates with server-side filters, sorting and pagination. Each row includes the derived state and hasUnpublishedChanges.",
        "operationId": "template.listTemplates",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "DRAFT, PUBLISHED or ARCHIVED. Omitted lists every template that is not archived.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Exact tag.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive match on the template name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "name, createdAt or updatedAt (default updatedAt).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "asc or desc (default desc).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (default 25, maximum 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "templateId": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "channel": {
                            "type": "string",
                            "enum": [
                              "rcs"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "tag": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "archivedAt": {},
                          "draftVersion": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "publishedVersion": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "revision": {
                            "type": "integer"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string"
                          },
                          "hasUnpublishedChanges": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "templateId": "TPL7K3M9QXR2V",
                      "groupId": "G1234567",
                      "channel": "rcs",
                      "name": "Order ready",
                      "tag": "Order Confirmation",
                      "archivedAt": null,
                      "draftVersion": 2,
                      "publishedVersion": 1,
                      "revision": 3,
                      "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                      "createdAt": "2026-10-12T15:00:00.000Z",
                      "updatedAt": "2026-10-12T15:00:00.000Z",
                      "state": "PUBLISHED",
                      "hasUnpublishedChanges": true
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 25
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/template/capabilities": {
      "get": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Describe the RCS contract's block kinds, action types, limits and accepted media, and optionally one provider's adapter constraints.",
        "description": "Describe the RCS contract's block kinds, action types, limits and accepted media, and optionally one provider's adapter constraints. Not account configuration.",
        "operationId": "template.readCapabilities",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "query",
            "required": false,
            "description": "infobip or sinch: include that provider's adapter constraints and unsupported features.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "channel": {
                      "type": "string"
                    },
                    "contentFormat": {
                      "type": "string"
                    },
                    "contentFormats": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "validatorVersion": {
                      "type": "string"
                    },
                    "blockKinds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "actionTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "maxTextLength": {
                          "type": "integer"
                        },
                        "maxCardTitle": {
                          "type": "integer"
                        },
                        "maxCardDescription": {
                          "type": "integer"
                        },
                        "maxSuggestionLabel": {
                          "type": "integer"
                        },
                        "maxMessageSuggestions": {
                          "type": "integer"
                        },
                        "maxRecipients": {
                          "type": "integer"
                        },
                        "maxCardSuggestions": {
                          "type": "integer"
                        },
                        "minCarouselCards": {
                          "type": "integer"
                        },
                        "maxCarouselCards": {
                          "type": "integer"
                        },
                        "maxCalendarTitle": {
                          "type": "integer"
                        },
                        "maxCalendarDescription": {
                          "type": "integer"
                        },
                        "minTtlSeconds": {
                          "type": "integer"
                        },
                        "maxTtlSeconds": {
                          "type": "integer"
                        }
                      }
                    },
                    "ttlPresets": {
                      "type": "object",
                      "properties": {
                        "AUTHENTICATION": {
                          "type": "object",
                          "properties": {
                            "seconds": {
                              "type": "integer"
                            },
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        },
                        "TRANSACTION": {
                          "type": "object",
                          "properties": {
                            "seconds": {
                              "type": "integer"
                            },
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        },
                        "SERVICEREQUEST": {
                          "type": "object",
                          "properties": {
                            "seconds": {
                              "type": "integer"
                            },
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        },
                        "ACKNOWLEDGEMENT": {
                          "type": "object",
                          "properties": {
                            "seconds": {
                              "type": "integer"
                            },
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        },
                        "PROMOTION": {
                          "type": "object",
                          "properties": {
                            "seconds": {
                              "type": "integer"
                            },
                            "min": {
                              "type": "integer"
                            },
                            "max": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "trafficByUseCase": {
                      "type": "object",
                      "properties": {
                        "OTP": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "TRANSACTIONAL": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "PROMOTIONAL": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "MULTI_USE": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "defaultTrafficByUseCase": {
                      "type": "object",
                      "properties": {
                        "OTP": {
                          "type": "string"
                        },
                        "TRANSACTIONAL": {
                          "type": "string"
                        },
                        "PROMOTIONAL": {
                          "type": "string"
                        }
                      }
                    },
                    "ios": {
                      "type": "object",
                      "properties": {
                        "cardButtonsInline": {
                          "type": "integer"
                        },
                        "suggestedActionsInline": {
                          "type": "integer"
                        },
                        "linesPerField": {
                          "type": "integer"
                        },
                        "charsPerLine": {
                          "type": "integer"
                        }
                      }
                    },
                    "media": {
                      "type": "object",
                      "properties": {
                        "maxUploadBytes": {
                          "type": "integer"
                        },
                        "mimeTypes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "maxImageEdge": {
                          "type": "integer"
                        },
                        "imageTargetBytes": {
                          "type": "integer"
                        }
                      }
                    },
                    "geocoding": {
                      "type": "object",
                      "properties": {
                        "available": {
                          "type": "boolean"
                        }
                      }
                    },
                    "provider": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "type": "string"
                        },
                        "adapterVersion": {
                          "type": "string"
                        },
                        "unsupported": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "feature": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "channel": "rcs",
                  "contentFormat": "content.v1",
                  "contentFormats": [
                    "content.v1",
                    "google.rcs"
                  ],
                  "validatorVersion": "content-1.0.0",
                  "blockKinds": [
                    "text",
                    "richCard",
                    "video",
                    "carousel",
                    "suggestions",
                    "attachment"
                  ],
                  "actionTypes": [
                    "REPLY",
                    "OPEN_URL",
                    "DIAL",
                    "VIEW_LOCATION",
                    "SHARE_LOCATION",
                    "CALENDAR"
                  ],
                  "limits": {
                    "maxTextLength": 3072,
                    "maxCardTitle": 200,
                    "maxCardDescription": 2000,
                    "maxSuggestionLabel": 25,
                    "maxMessageSuggestions": 11,
                    "maxRecipients": 100,
                    "maxCardSuggestions": 4,
                    "minCarouselCards": 2,
                    "maxCarouselCards": 10,
                    "maxCalendarTitle": 100,
                    "maxCalendarDescription": 500,
                    "minTtlSeconds": 10,
                    "maxTtlSeconds": 172800
                  },
                  "ttlPresets": {
                    "AUTHENTICATION": {
                      "seconds": 30,
                      "min": 15,
                      "max": 300
                    },
                    "TRANSACTION": {
                      "seconds": 900,
                      "min": 60,
                      "max": 86400
                    },
                    "SERVICEREQUEST": {
                      "seconds": 900,
                      "min": 60,
                      "max": 86400
                    },
                    "ACKNOWLEDGEMENT": {
                      "seconds": 300,
                      "min": 60,
                      "max": 3600
                    },
                    "PROMOTION": {
                      "seconds": 14400,
                      "min": 600,
                      "max": 172800
                    }
                  },
                  "trafficByUseCase": {
                    "OTP": [
                      "AUTHENTICATION"
                    ],
                    "TRANSACTIONAL": [
                      "TRANSACTION",
                      "SERVICEREQUEST",
                      "ACKNOWLEDGEMENT"
                    ],
                    "PROMOTIONAL": [
                      "PROMOTION"
                    ],
                    "MULTI_USE": [
                      "AUTHENTICATION",
                      "TRANSACTION",
                      "SERVICEREQUEST",
                      "ACKNOWLEDGEMENT",
                      "PROMOTION"
                    ]
                  },
                  "defaultTrafficByUseCase": {
                    "OTP": "AUTHENTICATION",
                    "TRANSACTIONAL": "TRANSACTION",
                    "PROMOTIONAL": "PROMOTION"
                  },
                  "ios": {
                    "cardButtonsInline": 1,
                    "suggestedActionsInline": 2,
                    "linesPerField": 3,
                    "charsPerLine": 30
                  },
                  "media": {
                    "maxUploadBytes": 10485760,
                    "mimeTypes": [
                      "image/jpeg",
                      "image/png",
                      "image/gif",
                      "video/mp4",
                      "audio/mpeg",
                      "audio/mp4",
                      "application/pdf"
                    ],
                    "maxImageEdge": 1920,
                    "imageTargetBytes": 5000000
                  },
                  "geocoding": {
                    "available": true
                  },
                  "provider": {
                    "provider": "sinch",
                    "adapterVersion": "sinch-rcs-1.0.0",
                    "unsupported": [
                      {
                        "feature": "carousel",
                        "code": "SINCH_CARD_WIDTH_UNMAPPED",
                        "message": "Sinch has no verified carousel card-width mapping"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/template/geocode": {
      "get": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Resolve an address to coordinates for a VIEW_LOCATION suggestion, through the server's geocoding provider.",
        "description": "Resolve an address to coordinates for a VIEW_LOCATION suggestion, through the server's geocoding provider. 400 with code LOCATION_NOT_FOUND when nothing matches; 429 past the group's window of 60 lookups a minute, which template saves and validations share; 503 when the server has no geocoding provider (capabilities.geocoding.available is false).",
        "operationId": "template.geocodeAddress",
        "parameters": [
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "The address to resolve, 1–512 characters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "latitude": {
                      "type": "number"
                    },
                    "longitude": {
                      "type": "number"
                    },
                    "partialMatch": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "address": "88 Lakeshore Dr, Chicago, IL 60601, USA",
                  "latitude": 41.8819,
                  "longitude": -87.6278,
                  "partialMatch": false
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/template/media": {
      "post": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Upload one media file and get its public CDN URL to use in a template.",
        "description": "Upload one media file and get its public CDN URL to use in a template. An image with a longest edge over capabilities.media.maxImageEdge (1920) or over capabilities.media.imageTargetBytes (5,000,000 bytes) is compressed to both before it is stored; a GIF keeps its animation, a PNG stays PNG when it fits, and any other image is stored as JPEG, flattened onto white. An image within both is stored as uploaded. bytes, mimeType, width and height describe the stored file. An image over the MMS size limit (700 KB) also gets an MMS copy, in variants.mms ({ url, bytes }), with a longest edge of at most 1200; an MMS fallback leg sends the copy in place of the image, and a template may use the copy's URL where an image goes. variants is {} when there is no copy. The copy counts against the group's storage quota. Uploaded files are publicly reachable by anyone with the URL; never upload confidential documents.",
        "operationId": "template.uploadMedia",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "type": "string",
                    "description": "Group that will own the file. Must be your active group."
                  },
                  "file": {
                    "type": "string",
                    "description": "One file, at most 10 MiB: JPEG, PNG, GIF, MP4, MP3, M4A or PDF. The type is read from the file's bytes, not its name or declared type."
                  }
                },
                "required": [
                  "groupId",
                  "file"
                ]
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mediaId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "bytes": {
                      "type": "integer"
                    },
                    "mimeType": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "image",
                        "video",
                        "audio",
                        "file"
                      ]
                    },
                    "width": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "height": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "variants": {
                      "type": "object",
                      "properties": {
                        "mms": {
                          "type": "object",
                          "properties": {
                            "url": {
                              "type": "string"
                            },
                            "bytes": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "mediaId": "MED4Q8ZK2M7TX",
                  "groupId": "G1234567",
                  "url": "https://media.signalhouse.io/message-templates/1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed.jpg",
                  "bytes": 1482130,
                  "mimeType": "image/jpeg",
                  "kind": "image",
                  "width": 1920,
                  "height": 1005,
                  "variants": {
                    "mms": {
                      "url": "https://media.signalhouse.io/message-templates/6f1c2a9e-4b7d-4e2f-8a31-0d5c9b7e2f14.jpg",
                      "bytes": 612345
                    }
                  },
                  "createdAt": "2026-10-12T15:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/template/{templateId}": {
      "get": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Read a template head with one selected version.",
        "description": "Read a template head with one selected version.",
        "operationId": "template.readTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "required": false,
            "description": "A version number, \"draft\" or \"published\". Omitted means the published version, otherwise the draft. An explicit selector never falls back.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "head": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "rcs"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tag": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {},
                        "draftVersion": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "publishedVersion": {},
                        "revision": {
                          "type": "integer"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "hasUnpublishedChanges": {
                          "type": "boolean"
                        }
                      }
                    },
                    "version": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PUBLISHED"
                          ]
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "type": "string"
                            },
                            "contentFormat": {
                              "type": "string"
                            },
                            "content": {
                              "type": "object",
                              "properties": {
                                "blocks": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "kind": {
                                        "type": "string"
                                      },
                                      "text": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "required": {
                                    "type": "boolean"
                                  },
                                  "sample": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "defaults": {
                              "type": "object",
                              "properties": {
                                "trafficType": {
                                  "type": "string"
                                }
                              }
                            },
                            "fallback": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "type": "object",
                                  "properties": {
                                    "channel": {
                                      "type": "string"
                                    },
                                    "campaignId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "object",
                                      "properties": {
                                        "text": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "contentHash": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "publishedAt": {}
                      }
                    }
                  }
                },
                "example": {
                  "head": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "channel": "rcs",
                    "name": "Order ready",
                    "tag": "Order Confirmation",
                    "archivedAt": null,
                    "draftVersion": 1,
                    "publishedVersion": null,
                    "revision": 1,
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "state": "DRAFT",
                    "hasUnpublishedChanges": false
                  },
                  "version": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "version": 1,
                    "state": "DRAFT",
                    "body": {
                      "channel": "rcs",
                      "contentFormat": "content.v1",
                      "content": {
                        "blocks": [
                          {
                            "id": "b1",
                            "kind": "text",
                            "text": "Order {{order_number}} is ready."
                          },
                          {
                            "id": "b2",
                            "kind": "suggestions",
                            "suggestions": [
                              {
                                "type": "REPLY",
                                "label": "Thanks",
                                "postbackData": "order_ack"
                              }
                            ]
                          }
                        ]
                      },
                      "variables": [
                        {
                          "key": "order_number",
                          "type": "text",
                          "required": true,
                          "sample": "A-48213"
                        }
                      ],
                      "defaults": {
                        "trafficType": "TRANSACTION"
                      },
                      "fallback": {
                        "delivery": {
                          "channel": "sms",
                          "campaignId": "CABC123",
                          "phoneNumber": "15551234567",
                          "content": {
                            "text": "Order {{order_number}} is ready."
                          }
                        }
                      }
                    },
                    "contentHash": "9f2c4e…",
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "publishedAt": null
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Edit metadata or the draft body.",
        "description": "Edit metadata or the draft body. A supplied body replaces the whole draft; nothing is merged. Editing a published template opens its next draft.",
        "operationId": "template.updateTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "description": "Group that owns the template. Must be your active group, with RCS enabled (otherwise 403)."
                  },
                  "name": {
                    "description": "New library name. Omit to keep."
                  },
                  "tag": {
                    "description": "New tag, or null to clear. Omit to keep."
                  },
                  "body": {
                    "description": "Replaces the whole draft body. On a published template with no draft, creates draft version published + 1. An update with no fields on such a template opens a draft copy of the published body."
                  }
                },
                "required": [
                  "groupId"
                ]
              },
              "example": {
                "groupId": "G1234567",
                "body": {
                  "channel": "rcs",
                  "contentFormat": "content.v1",
                  "content": {
                    "blocks": [
                      {
                        "id": "b1",
                        "kind": "text",
                        "text": "Order {{order_number}} is ready."
                      },
                      {
                        "id": "b2",
                        "kind": "suggestions",
                        "suggestions": [
                          {
                            "type": "REPLY",
                            "label": "Thanks",
                            "postbackData": "order_ack"
                          }
                        ]
                      }
                    ]
                  },
                  "variables": [
                    {
                      "key": "order_number",
                      "type": "text",
                      "required": true,
                      "sample": "A-48213"
                    }
                  ],
                  "defaults": {
                    "trafficType": "TRANSACTION"
                  },
                  "fallback": {
                    "delivery": {
                      "channel": "sms",
                      "campaignId": "CABC123",
                      "phoneNumber": "15551234567",
                      "content": {
                        "text": "Order {{order_number}} is ready."
                      }
                    }
                  }
                }
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "head": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "rcs"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tag": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {},
                        "draftVersion": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "publishedVersion": {},
                        "revision": {
                          "type": "integer"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "hasUnpublishedChanges": {
                          "type": "boolean"
                        }
                      }
                    },
                    "version": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PUBLISHED"
                          ]
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "type": "string"
                            },
                            "contentFormat": {
                              "type": "string"
                            },
                            "content": {
                              "type": "object",
                              "properties": {
                                "blocks": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "kind": {
                                        "type": "string"
                                      },
                                      "text": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "required": {
                                    "type": "boolean"
                                  },
                                  "sample": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "defaults": {
                              "type": "object",
                              "properties": {
                                "trafficType": {
                                  "type": "string"
                                }
                              }
                            },
                            "fallback": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "type": "object",
                                  "properties": {
                                    "channel": {
                                      "type": "string"
                                    },
                                    "campaignId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "object",
                                      "properties": {
                                        "text": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "contentHash": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "publishedAt": {}
                      }
                    },
                    "validation": {
                      "type": "object",
                      "properties": {
                        "valid": {
                          "type": "boolean"
                        },
                        "errors": {
                          "type": "array",
                          "items": {}
                        },
                        "warnings": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "head": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "channel": "rcs",
                    "name": "Order ready",
                    "tag": "Order Confirmation",
                    "archivedAt": null,
                    "draftVersion": 1,
                    "publishedVersion": null,
                    "revision": 2,
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "state": "DRAFT",
                    "hasUnpublishedChanges": false
                  },
                  "version": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "version": 1,
                    "state": "DRAFT",
                    "body": {
                      "channel": "rcs",
                      "contentFormat": "content.v1",
                      "content": {
                        "blocks": [
                          {
                            "id": "b1",
                            "kind": "text",
                            "text": "Order {{order_number}} is ready."
                          },
                          {
                            "id": "b2",
                            "kind": "suggestions",
                            "suggestions": [
                              {
                                "type": "REPLY",
                                "label": "Thanks",
                                "postbackData": "order_ack"
                              }
                            ]
                          }
                        ]
                      },
                      "variables": [
                        {
                          "key": "order_number",
                          "type": "text",
                          "required": true,
                          "sample": "A-48213"
                        }
                      ],
                      "defaults": {
                        "trafficType": "TRANSACTION"
                      },
                      "fallback": {
                        "delivery": {
                          "channel": "sms",
                          "campaignId": "CABC123",
                          "phoneNumber": "15551234567",
                          "content": {
                            "text": "Order {{order_number}} is ready."
                          }
                        }
                      }
                    },
                    "contentHash": "9f2c4e…",
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "publishedAt": null
                  },
                  "validation": {
                    "valid": true,
                    "errors": [],
                    "warnings": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/template/{templateId}/archive": {
      "post": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Archive a template.",
        "description": "Archive a template. Every version stays readable; there is no delete.",
        "operationId": "template.archiveTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "description": "Group that owns the template. Must be your active group, with RCS enabled (otherwise 403)."
                  }
                },
                "required": [
                  "groupId"
                ]
              },
              "example": {
                "groupId": "G1234567"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templateId": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "channel": {
                      "type": "string",
                      "enum": [
                        "rcs"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "tag": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "draftVersion": {},
                    "publishedVersion": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "revision": {
                      "type": "integer"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string"
                    },
                    "hasUnpublishedChanges": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "templateId": "TPL7K3M9QXR2V",
                  "groupId": "G1234567",
                  "channel": "rcs",
                  "name": "Order ready",
                  "tag": "Order Confirmation",
                  "archivedAt": "2026-10-12T16:00:00.000Z",
                  "draftVersion": null,
                  "publishedVersion": 1,
                  "revision": 3,
                  "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                  "createdAt": "2026-10-12T15:00:00.000Z",
                  "updatedAt": "2026-10-12T15:00:00.000Z",
                  "state": "ARCHIVED",
                  "hasUnpublishedChanges": false
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/template/{templateId}/publish": {
      "post": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Validate the current draft and publish it; with no draft this returns 409 NO_DRAFT, and if the draft changed while it was being published, 409 DRAFT_CHANGED.",
        "description": "Validate the current draft and publish it; with no draft this returns 409 NO_DRAFT, and if the draft changed while it was being published, 409 DRAFT_CHANGED. Published versions are immutable. An incomplete draft returns 400 with details.code TEMPLATE_INVALID and per-block errors, and nothing is written. Publish moderates each block's text and images and the fallback text: a flag is a CONTENT_POLICY_FLAGGED error whose message names the category. When the moderation service cannot answer, the check passes, as a send does. An image URL with a variable is moderated at send instead, with its value filled in, and a refused image blocks the recipient with MODERATION.",
        "operationId": "template.publishTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "description": "Group that owns the template. Must be your active group, with RCS enabled (otherwise 403)."
                  }
                },
                "required": [
                  "groupId"
                ]
              },
              "example": {
                "groupId": "G1234567"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "head": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "channel": {
                          "type": "string",
                          "enum": [
                            "rcs"
                          ]
                        },
                        "name": {
                          "type": "string"
                        },
                        "tag": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {},
                        "draftVersion": {},
                        "publishedVersion": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "revision": {
                          "type": "integer"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string"
                        },
                        "hasUnpublishedChanges": {
                          "type": "boolean"
                        }
                      }
                    },
                    "version": {
                      "type": "object",
                      "properties": {
                        "templateId": {
                          "type": "string"
                        },
                        "groupId": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "DRAFT",
                            "PUBLISHED"
                          ]
                        },
                        "body": {
                          "type": "object",
                          "properties": {
                            "channel": {
                              "type": "string"
                            },
                            "contentFormat": {
                              "type": "string"
                            },
                            "content": {
                              "type": "object",
                              "properties": {
                                "blocks": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "kind": {
                                        "type": "string"
                                      },
                                      "text": {
                                        "type": "string"
                                      }
                                    }
                                  }
                                }
                              }
                            },
                            "variables": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  },
                                  "required": {
                                    "type": "boolean"
                                  },
                                  "sample": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "defaults": {
                              "type": "object",
                              "properties": {
                                "trafficType": {
                                  "type": "string"
                                }
                              }
                            },
                            "fallback": {
                              "type": "object",
                              "properties": {
                                "delivery": {
                                  "type": "object",
                                  "properties": {
                                    "channel": {
                                      "type": "string"
                                    },
                                    "campaignId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "phoneNumber": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "object",
                                      "properties": {
                                        "text": {
                                          "type": "string"
                                        }
                                      }
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "contentHash": {
                          "type": "string"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "publishedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "head": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "channel": "rcs",
                    "name": "Order ready",
                    "tag": "Order Confirmation",
                    "archivedAt": null,
                    "draftVersion": null,
                    "publishedVersion": 1,
                    "revision": 2,
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "state": "PUBLISHED",
                    "hasUnpublishedChanges": false
                  },
                  "version": {
                    "templateId": "TPL7K3M9QXR2V",
                    "groupId": "G1234567",
                    "version": 1,
                    "state": "PUBLISHED",
                    "body": {
                      "channel": "rcs",
                      "contentFormat": "content.v1",
                      "content": {
                        "blocks": [
                          {
                            "id": "b1",
                            "kind": "text",
                            "text": "Order {{order_number}} is ready."
                          },
                          {
                            "id": "b2",
                            "kind": "suggestions",
                            "suggestions": [
                              {
                                "type": "REPLY",
                                "label": "Thanks",
                                "postbackData": "order_ack"
                              }
                            ]
                          }
                        ]
                      },
                      "variables": [
                        {
                          "key": "order_number",
                          "type": "text",
                          "required": true,
                          "sample": "A-48213"
                        }
                      ],
                      "defaults": {
                        "trafficType": "TRANSACTION"
                      },
                      "fallback": {
                        "delivery": {
                          "channel": "sms",
                          "campaignId": "CABC123",
                          "phoneNumber": "15551234567",
                          "content": {
                            "text": "Order {{order_number}} is ready."
                          }
                        }
                      }
                    },
                    "contentHash": "9f2c4e…",
                    "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                    "createdAt": "2026-10-12T15:00:00.000Z",
                    "updatedAt": "2026-10-12T15:00:00.000Z",
                    "publishedAt": "2026-10-12T15:05:00.000Z"
                  },
                  "warnings": []
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/template/{templateId}/validate": {
      "post": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "Check a supplied body or a stored version for publication without writing anything.",
        "description": "Check a supplied body or a stored version for publication without writing anything. Hosted media must belong to your group; external media URLs are not probed. Content moderation runs as at publish, so a flagged text or image is a CONTENT_POLICY_FLAGGED error, and an image URL with a variable is left to the send.",
        "operationId": "template.validateTemplate",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "groupId": {
                    "description": "Group that owns the template. Must be your active group, with RCS enabled (otherwise 403)."
                  },
                  "body": {
                    "description": "A body to check. Send exactly one of body or version."
                  },
                  "version": {
                    "description": "A stored version number, \"draft\" or \"published\" to check."
                  }
                },
                "required": [
                  "groupId"
                ]
              },
              "example": {
                "groupId": "G1234567",
                "version": "draft"
              }
            }
          },
          "x-source": "docs"
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "contentHash": {
                      "type": "string"
                    },
                    "validatorVersion": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "blockId": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "severity": {
                            "type": "string"
                          },
                          "code": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "valid": false,
                  "contentHash": "9f2c4e…",
                  "validatorVersion": "content-1.0.0",
                  "errors": [
                    {
                      "severity": "error",
                      "code": "TEXT_REQUIRED",
                      "path": "content.blocks[0].text",
                      "message": "Message text is required",
                      "blockId": "b1"
                    }
                  ],
                  "warnings": [
                    {
                      "severity": "warning",
                      "code": "VARIABLE_UNUSED",
                      "path": "variables[0]",
                      "message": "first_name is declared but never used"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/template/{templateId}/versions": {
      "get": {
        "tags": [
          "Templates (RCS)"
        ],
        "summary": "List a template's versions, newest first, without bodies.",
        "description": "List a template's versions, newest first, without bodies.",
        "operationId": "template.listVersions",
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template ID (TPL + 10 characters)."
          },
          {
            "name": "groupId",
            "in": "query",
            "required": true,
            "description": "Group that owns the templates. Must be a group you can view, with RCS enabled (otherwise 403).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (default 25, maximum 100).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "templateId": {
                            "type": "string"
                          },
                          "groupId": {
                            "type": "string"
                          },
                          "version": {
                            "type": "integer"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "DRAFT",
                              "PUBLISHED"
                            ]
                          },
                          "contentHash": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "publishedAt": {}
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "templateId": "TPL7K3M9QXR2V",
                      "groupId": "G1234567",
                      "version": 1,
                      "state": "DRAFT",
                      "contentHash": "9f2c4e…",
                      "createdBy": "60f7b2a1c9e77c001a2b3c4d",
                      "createdAt": "2026-10-12T15:00:00.000Z",
                      "updatedAt": "2026-10-12T15:00:00.000Z",
                      "publishedAt": null
                    }
                  ],
                  "total": 1,
                  "page": 1,
                  "limit": 25
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/user": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Retrieve user records.",
        "description": "Retrieve user records. Customer roles must pass at least one filter (id or groupId) — an unfiltered read-all is restricted to internal use. Note: the 'developer' role is restricted to service-user queries only; it must supply both groupId and userType=service. Any other combination (no groupId, userType=user, or groupId without userType=service) returns 403 for the developer role. Each user includes a read-only lastLoginAt: the time of the user's most recent portal login, or null if they have not logged in since it began being recorded. It cannot be set through PUT /user/:id. The groupIds, subgroupIds and status query parameters belong to the internal unfiltered list; sending any of them with id, email or groupId returns 400.",
        "operationId": "user.readUsers",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific User ObjectId.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userType",
            "in": "query",
            "required": false,
            "description": "Filter by type: 'user' or 'service'. The 'developer' role requires userType=service.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "api",
                          "admin",
                          "developer",
                          "billing",
                          "user"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "inactive"
                        ]
                      },
                      "mfaEnabled": {
                        "type": "boolean"
                      },
                      "viewGroupIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "activeGroupId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "email": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "firstName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "companyName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "phone": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "timezone": {
                        "type": "string"
                      },
                      "lastLoginAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c61",
                    "role": "admin",
                    "status": "active",
                    "mfaEnabled": false,
                    "viewGroupIds": [
                      "G1234567"
                    ],
                    "activeGroupId": "G1234567",
                    "email": "user@example.com",
                    "firstName": "John",
                    "lastName": "Doe",
                    "companyName": "Acme Corp",
                    "phone": "5551234567",
                    "timezone": "America/Chicago",
                    "lastLoginAt": "2024-01-15T13:30:00.000Z",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "self"
        ]
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create a new dashboard user.",
        "description": "Create a new dashboard user.",
        "operationId": "user.createUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "api",
                            "admin",
                            "developer",
                            "billing",
                            "user"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "inactive"
                          ]
                        },
                        "activeGroupId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "user": {
                    "_id": "60f7b2a1c9e77c001a2b3c61",
                    "role": "admin",
                    "status": "active",
                    "activeGroupId": "G1234567",
                    "email": "user@example.com",
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api"
        ]
      }
    },
    "/user/accept-terms": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Accept the Terms of Service for the authenticated caller.",
        "description": "Accept the Terms of Service for the authenticated caller. Sets acceptedTermsOfService=true on the caller's own user account. Self-service — any authenticated user can accept their own terms.",
        "operationId": "user.acceptTermsOfService",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptUserTermsOfServiceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "acceptedTermsOfService": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "acceptedTermsOfService": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user",
          "api"
        ]
      }
    },
    "/user/serviceuser": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create a non-login Service User (API Key) and instantly returns a JWT.",
        "description": "Create a non-login Service User (API Key) and instantly returns a JWT.",
        "operationId": "user.createServiceUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceUserRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "user": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string"
                            },
                            "role": {
                              "type": "string",
                              "enum": [
                                "api",
                                "admin",
                                "developer",
                                "billing",
                                "user"
                              ]
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "inactive"
                              ]
                            },
                            "activeGroupId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "viewGroupIds": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "firstName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "mfaEnabled": {
                              "type": "boolean"
                            },
                            "createdAt": {
                              "type": "string"
                            },
                            "updatedAt": {
                              "type": "string"
                            }
                          }
                        },
                        "token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "user": {
                    "user": {
                      "_id": "60f7b2a1c9e77c001a2b3c62",
                      "role": "api",
                      "status": "active",
                      "activeGroupId": "G1234567",
                      "viewGroupIds": [
                        "G1234567"
                      ],
                      "firstName": "Backend Integration",
                      "mfaEnabled": false,
                      "createdAt": "2024-01-15T12:00:00.000Z",
                      "updatedAt": "2024-01-15T12:00:00.000Z"
                    },
                    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2MGY3YjJhMWM5ZTc3YzAwMWEyYjNjNjIiLCJncm91cElkIjoiRzEyMzQ1NjciLCJyb2xlIjoiYXBpIiwiaWF0IjoxNjkwMDAwMDAwLCJleHAiOjE3MjE1MzYwMDB9.placeholder_signature"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer"
        ]
      }
    },
    "/user/{id}": {
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update an existing user's details.",
        "description": "Update an existing user's details.",
        "operationId": "user.updateUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ObjectId."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "firstName": {
                          "type": "string"
                        },
                        "lastName": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "user": {
                    "_id": "60f7b2a1c9e77c001a2b3c61",
                    "role": "admin",
                    "status": "active",
                    "email": "user@example.com",
                    "firstName": "John",
                    "lastName": "Doe Updated",
                    "updatedAt": "2024-01-16T14:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Inactivate a user, revoking their login access.",
        "description": "Inactivate a user, revoking their login access.",
        "operationId": "user.deleteUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ObjectId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "User inactivated successfully"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api"
        ]
      }
    },
    "/user/{id}/notification-preferences": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Retrieve notification preferences for a user.",
        "description": "Retrieve notification preferences for a user.",
        "operationId": "user.readNotificationPreferences",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ObjectId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "web": {
                        "type": "boolean"
                      },
                      "email": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "name": "BRAND_CREATION_SUCCESSFUL",
                    "web": true,
                    "email": true
                  },
                  {
                    "name": "BRAND_CREATION_FAILED",
                    "web": true,
                    "email": false
                  },
                  {
                    "name": "CAMPAIGN_APPROVED_BY_SIGNAL_HOUSE",
                    "web": true,
                    "email": false
                  },
                  {
                    "name": "MESSAGE_DELIVERY_FAILURE",
                    "web": true,
                    "email": true
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "api",
          "self"
        ]
      },
      "put": {
        "tags": [
          "Users"
        ],
        "summary": "Update notification preferences for a user.",
        "description": "Update notification preferences for a user. Restricted to human dashboard users (admin, developer, billing, user) — service (api) users and internal accounts are not eligible and will receive a 403.",
        "operationId": "user.updateNotificationPreferences",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User ObjectId."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationPreferencesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notificationPreferences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "web": {
                            "type": "boolean"
                          },
                          "email": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "notificationPreferences": [
                    {
                      "name": "BRAND_CREATION_SUCCESSFUL",
                      "web": true,
                      "email": true
                    },
                    {
                      "name": "CAMPAIGN_APPROVED_BY_SIGNAL_HOUSE",
                      "web": true,
                      "email": false
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "billing",
          "user"
        ]
      }
    },
    "/verify/number": {
      "post": {
        "tags": [
          "Verify"
        ],
        "summary": "Start a Number Verify check.",
        "description": "Start a Number Verify check. Returns a PENDING check and the authorizationUrl the end user's phone must open on a US carrier's mobile data, with Wi-Fi off, before expiresAt (10 minutes). Treat authorizationUrl as opaque and open it unchanged; it works once. Nothing is charged now: the check is billed numberVerifyCheck when it ends VERIFIED or NOT_VERIFIED. Read the result with GET /verify/number/:checkId.",
        "operationId": "verify.startNumberVerification",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartNumberVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkId": {
                      "type": "string"
                    },
                    "phoneNumber": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "VERIFIED",
                        "NOT_VERIFIED",
                        "FAILED"
                      ]
                    },
                    "authorizationUrl": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "checkId": "NVC4H9XW2B6TJ",
                  "phoneNumber": "+12025550123",
                  "status": "PENDING",
                  "authorizationUrl": "https://api.infobip.com/camara/number-verification/v0/authorize?clientId=...&redirectUrl=...&state=...",
                  "expiresAt": "2026-11-10T15:10:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/verify/number/{checkId}": {
      "get": {
        "tags": [
          "Verify"
        ],
        "summary": "Read a Number Verify check's status and result.",
        "description": "Read a Number Verify check's status and result. status is PENDING, VERIFIED, NOT_VERIFIED, FAILED or EXPIRED (see Number Verify statuses). devicePhoneNumberVerified is the carrier's answer, true or false, and null until it answers. failureReason is set only on a FAILED check: NOT_COMPLETED, NOT_APPLICABLE or PROVIDER_ERROR. completedAt is null until the check finishes. cost is the fee charged, in microdollars, and 0 unless the status is VERIFIED or NOT_VERIFIED. Poll until the status is no longer PENDING, or read it once your redirectUrl is called.",
        "operationId": "verify.readNumberVerification",
        "parameters": [
          {
            "name": "checkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The checkId POST /verify/number returned (NVC + 10 characters)."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkId": {
                      "type": "string"
                    },
                    "phoneNumber": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "VERIFIED",
                        "NOT_VERIFIED",
                        "FAILED"
                      ]
                    },
                    "devicePhoneNumberVerified": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "failureReason": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "completedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cost": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "checkId": "NVC4H9XW2B6TJ",
                  "phoneNumber": "+12025550123",
                  "status": "VERIFIED",
                  "devicePhoneNumberVerified": true,
                  "failureReason": null,
                  "createdAt": "2026-11-10T15:00:00.000Z",
                  "expiresAt": "2026-11-10T15:10:00.000Z",
                  "completedAt": "2026-11-10T15:00:42.000Z",
                  "cost": 10000
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/verify/sim-swap": {
      "post": {
        "tags": [
          "Verify"
        ],
        "summary": "Check whether a phone number's SIM changed within maxAge hours, and optionally when it last changed.",
        "description": "Check whether a phone number's SIM changed within maxAge hours, and optionally when it last changed. Answers at once. swapped is true when the SIM changed within the period. latestSimChange is present only when includeSwapDate is true, and is null when the network reports no change or the date could not be read. cost is what this check charged, in microdollars: one simSwapCheck fee, with or without the date.",
        "operationId": "verify.checkSimSwap",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckSimSwapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkId": {
                      "type": "string"
                    },
                    "phoneNumber": {
                      "type": "string"
                    },
                    "swapped": {
                      "type": "boolean"
                    },
                    "maxAge": {
                      "type": "integer"
                    },
                    "latestSimChange": {
                      "type": "string"
                    },
                    "cost": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "checkId": "SSC7K2M1QZ8RP",
                  "phoneNumber": "+12025550123",
                  "swapped": false,
                  "maxAge": 240,
                  "latestSimChange": "2026-03-02T09:14:00.000Z",
                  "cost": 10000
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List your call flows, newest first by default.",
        "description": "List your call flows, newest first by default. Deleted flows are left out unless includeDeleted is true.",
        "operationId": "getVoiceApiV1CallFlows",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number, from 1 (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100 (default 20).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Match against the flow name, ignoring case.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Only flows in this subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "description": "true to include deleted flows (default false).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "required": false,
            "description": "createdAt (default), updatedAt or name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "required": false,
            "description": "asc or desc (default desc).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "accountId": {
                            "type": "string"
                          },
                          "subgroupId": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "deletedAt": {},
                          "currentVersionId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "0088947b-7821-4853-bfe6-744fce926de2",
                      "accountId": "G1234567",
                      "subgroupId": "S1234567",
                      "name": "Main Support Line",
                      "status": "ACTIVE",
                      "deletedAt": null,
                      "currentVersionId": "5c1f9a2e-3b4d-4e8f-9a0b-1c2d3e4f5a6b",
                      "createdAt": "2026-11-17T19:00:00.000Z",
                      "updatedAt": "2026-11-17T19:20:00.000Z"
                    }
                  ],
                  "meta": {
                    "total": 1,
                    "page": 1,
                    "limit": 20,
                    "totalPages": 1
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Create a call flow, with a working draft that holds the Inbound Call step every flow starts from.",
        "description": "Create a call flow, with a working draft that holds the Inbound Call step every flow starts from. Creating a flow changes no routing. Errors: 404 when the subgroup isn't yours; 409 when a flow in the subgroup already has that name, including a deleted one; 503 when the subgroup couldn't be verified (safe to retry).",
        "operationId": "postVoiceApiV1CallFlows",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Flow name, 1-120 characters, unique within the subgroup."
                  },
                  "subgroupId": {
                    "type": "string",
                    "description": "The subgroup the flow belongs to. It can't be changed later; only numbers and Programmable Voice Profiles in this subgroup can run the flow."
                  }
                },
                "required": [
                  "name",
                  "subgroupId"
                ]
              },
              "example": {
                "name": "Main Support Line",
                "subgroupId": "S1234567"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "deletedAt": {},
                        "currentVersionId": {},
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "draft": {
                          "type": "object",
                          "properties": {
                            "versionId": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "nodeType": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "config": {
                                    "type": "object",
                                    "properties": {}
                                  },
                                  "positionX": {
                                    "type": "integer"
                                  },
                                  "positionY": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {}
                            },
                            "issues": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "nodeId": {
                                    "type": "string"
                                  },
                                  "port": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0088947b-7821-4853-bfe6-744fce926de2",
                    "accountId": "G1234567",
                    "subgroupId": "S1234567",
                    "name": "Main Support Line",
                    "status": "ACTIVE",
                    "deletedAt": null,
                    "currentVersionId": null,
                    "createdAt": "2026-11-17T19:00:00.000Z",
                    "updatedAt": "2026-11-17T19:00:00.000Z",
                    "draft": {
                      "versionId": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
                      "nodes": [
                        {
                          "id": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                          "nodeType": "inbound",
                          "name": "Inbound Call",
                          "config": {},
                          "positionX": 0,
                          "positionY": 0
                        }
                      ],
                      "edges": [],
                      "issues": [
                        {
                          "code": "PORT_UNCONNECTED",
                          "nodeId": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                          "port": "next",
                          "message": "Inbound Call has nothing connected to its \"next\" outcome."
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows/catalog": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List the step types a flow can use, with the outcomes each one offers.",
        "description": "List the step types a flow can use, with the outcomes each one offers. An empty ports list means the step ends the call. A menu (ivr) also gets one opt_<optionId> outcome per option you give it, on top of the unknown and no_input outcomes listed here. configurable is true when the step takes settings in its config.",
        "operationId": "getVoiceApiV1CallFlowsCatalog",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "nodeTypes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "ports": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "configurable": {
                                "type": "boolean"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "nodeTypes": [
                      {
                        "type": "inbound",
                        "ports": [
                          "next"
                        ],
                        "configurable": false
                      },
                      {
                        "type": "answer",
                        "ports": [
                          "next"
                        ],
                        "configurable": false
                      },
                      {
                        "type": "play",
                        "ports": [
                          "next"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "sms",
                        "ports": [
                          "next"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "ivr",
                        "ports": [
                          "unknown",
                          "no_input"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "ai_agent",
                        "ports": [
                          "unavailable"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "ai_sms",
                        "ports": [
                          "next"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "webhook",
                        "ports": [
                          "no_match",
                          "failed"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "fwd_phone",
                        "ports": [
                          "success",
                          "no_answer",
                          "busy",
                          "decline",
                          "error"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "fwd_sip",
                        "ports": [
                          "success",
                          "no_answer",
                          "busy",
                          "decline",
                          "error",
                          "unavailable"
                        ],
                        "configurable": true
                      },
                      {
                        "type": "voicemail",
                        "ports": [],
                        "configurable": false
                      },
                      {
                        "type": "hangup",
                        "ports": [],
                        "configurable": false
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/api/v1/call-flows/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Get a call flow with its working draft and the issues that stop the draft being published.",
        "description": "Get a call flow with its working draft and the issues that stop the draft being published. Deleted flows can still be read. Steps come back with their type in nodeType and connections with their outcome in conditionType. Errors: 404 when the flow isn't yours.",
        "operationId": "getVoiceApiV1CallFlowsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "deletedAt": {},
                        "currentVersionId": {},
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "draft": {
                          "type": "object",
                          "properties": {
                            "versionId": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "nodeType": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "config": {
                                    "type": "object",
                                    "properties": {}
                                  },
                                  "positionX": {
                                    "type": "integer"
                                  },
                                  "positionY": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "edges": {
                              "type": "array",
                              "items": {}
                            },
                            "issues": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "nodeId": {
                                    "type": "string"
                                  },
                                  "port": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0088947b-7821-4853-bfe6-744fce926de2",
                    "accountId": "G1234567",
                    "subgroupId": "S1234567",
                    "name": "Main Support Line",
                    "status": "ACTIVE",
                    "deletedAt": null,
                    "currentVersionId": null,
                    "createdAt": "2026-11-17T19:00:00.000Z",
                    "updatedAt": "2026-11-17T19:00:00.000Z",
                    "draft": {
                      "versionId": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
                      "nodes": [
                        {
                          "id": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                          "nodeType": "inbound",
                          "name": "Inbound Call",
                          "config": {},
                          "positionX": 0,
                          "positionY": 0
                        }
                      ],
                      "edges": [],
                      "issues": [
                        {
                          "code": "PORT_UNCONNECTED",
                          "nodeId": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                          "port": "next",
                          "message": "Inbound Call has nothing connected to its \"next\" outcome."
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "patch": {
        "tags": [
          "Voice"
        ],
        "summary": "Rename a call flow, or enable or disable it.",
        "description": "Rename a call flow, or enable or disable it. Send only the fields you are changing. A disabled flow does not run: calls routed to it fall through to the number's next routing layer until you enable it again. Errors: 404 when the flow isn't yours; 409 when a flow in the subgroup already has the new name, including a deleted one.",
        "operationId": "patchVoiceApiV1CallFlowsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name, unique within the flow's subgroup."
                  },
                  "status": {
                    "type": "string",
                    "description": "ACTIVE or DISABLED."
                  }
                }
              },
              "example": {
                "status": "DISABLED"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "draft": {
                          "type": "object",
                          "properties": {
                            "versionId": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {}
                            },
                            "edges": {
                              "type": "array",
                              "items": {}
                            },
                            "issues": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0088947b-7821-4853-bfe6-744fce926de2",
                    "name": "Main Support Line",
                    "status": "DISABLED",
                    "draft": {
                      "versionId": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
                      "nodes": [],
                      "edges": [],
                      "issues": []
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Delete a call flow.",
        "description": "Delete a call flow. Numbers and profiles that route to it keep pointing at it, but their calls fall through to the next routing layer until you restore it. Errors: 404 when the flow isn't yours.",
        "operationId": "deleteVoiceApiV1CallFlowsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "deletedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0088947b-7821-4853-bfe6-744fce926de2",
                    "name": "Main Support Line",
                    "status": "ACTIVE",
                    "deletedAt": "2026-11-18T09:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows/{id}/draft": {
      "put": {
        "tags": [
          "Voice"
        ],
        "summary": "Replace the working draft with the steps and connections you send.",
        "description": "Replace the working draft with the steps and connections you send. The whole draft is saved even when it isn't finished, and the response lists the issues that would stop it being published, so you can save as often as you like. Send each step's type in type and each connection's outcome in port; reads return the same values as nodeType and conditionType. Ids are UUIDs you generate, and they are kept, so a step keeps its id across saves. Errors: 400 when the body is malformed (more than 200 steps or 400 connections, or an id that isn't a UUID); 404 when the flow isn't yours.",
        "operationId": "putVoiceApiV1CallFlowsByIdDraft",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nodes": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Every step: { id, type, name, config, positionX, positionY }. type is one of the catalog's step types, and the flow needs exactly one inbound step. config holds the step's settings: play takes { mode: \"tts\", text } or { mode: \"audio\", url }; ivr takes the same prompt fields plus options [{ id, press, label }] and waitInputSeconds; sms takes from (one of your numbers that can send texts, in E.164), to (\"inbound\" for the caller, or \"designated\" with toNumber) and message (up to 1,600 characters), and the call carries on whether or not the text is sent; ai_agent takes agentProfileId, one of your active AI agents with its voice channel on, either shared with every subgroup or in the flow's own subgroup. The agent is checked on each call. If it can take the call, the call is handed to it and leaves the flow, so the step has no outcome for that. If it can't, the step takes unavailable. ai_sms takes agentProfileId (one of your active AI agents with its SMS channel on), from (a number in the flow's subgroup that agent answers texts on, in E.164) and message (the opening text, up to 1,600 characters). When the text starts a new conversation and doesn't mention STOP, \"Reply STOP to opt out.\" is added to it. The caller is texted from that number, and the agent answers their replies the way it answers any text to it; the call carries on whether or not the text is sent. webhook calls your URL during the call: method (GET, POST, PUT or DELETE), url (a public https address; variables may fill in the path or query, not the host), headers [{ name, value }] (up to 20), body (a string or JSON, up to 10,000 characters; not sent on GET), timeoutSeconds (1 to 10, default 5), store (keep the response for later steps) and conditions [{ id, field, operator, value }] (up to 10). A condition's field is status (the HTTP status), response (the whole body) or response.<path> into a JSON body, such as response.customer.tier; operator is equals, not_equals, contains, starts_with, exists, not_exists, gt, lt, gte or lte, and text comparisons ignore case. The step's outcomes are cond_<id> for the first condition the response meets, in order, then no_match, and failed when there is no response (a timeout, an address that is not public, a connection error). Redirects are not followed, the response is read up to 64 KB, and a call may make at most 10 such requests. Variables: the webhook's url, headers and body, play and ivr text, sms and ai_sms messages, and fwd_phone whisperText may use {{from}} (the caller, E.164), {{to}} (the number dialled), {{callId}}, and, after a webhook step with store on, {{response.<path>}}. A variable with no value is left empty. fwd_phone takes numbers [{ number, timeoutSeconds, whisper, whisperText }], tried one after another, and callerId (\"inbound\", or \"designated\" with callerIdNumber). Every number that answers is checked for voicemail. One detected as a voicemail is hung up without hearing the whisper, the next number rings, and the step takes no_answer after the last. When the check can't tell, the call connects as if a person answered: the whisper plays and the step takes success. A number's whisperText (with whisper: true) is spoken to whoever answers before the caller is connected; the caller never hears it. fwd_sip takes target (\"trunk\", the default, or \"profile\"), sipTrunkId (with trunk: one of your SIP trunks), profileId (with profile: an enabled Programmable Voice Profile whose subgroups include the flow's) and timeoutSeconds (3 to 120, default 30). A trunk is sent the number the caller dialled, with the caller's number as caller ID, at its highest-priority enabled destination host; your PBX must allow our SIP addresses, as for inbound calls. A profile does what it does for its own numbers: FORWARD, SIP_TRUNK, SIP_PROFILE and WEBRTC ring their target (WEBRTC rings the flow subgroup's signed-in softphones, and takes no_answer when none is signed in) and take a forward's outcomes; AI, CALL_CONTROL and CALL_FLOW hand the call on, and it leaves the flow. The trunk or profile is checked on each call, and the step takes unavailable when it can't take the call: a trunk that is disabled or has no enabled destination host, a profile that is disabled or outside the flow's subgroup, a target that is missing, or a profile whose call flow this call is already running. positionX and positionY place the step on a canvas."
                  },
                  "edges": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Every connection: { id, fromNodeId, toNodeId, port }. port is the outcome of the source step it leaves from, e.g. next, success, no_answer, no_input or opt_<optionId>."
                  }
                },
                "required": [
                  "nodes",
                  "edges"
                ]
              },
              "example": {
                "nodes": [
                  {
                    "id": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                    "type": "inbound",
                    "name": "Inbound Call",
                    "config": {},
                    "positionX": 0,
                    "positionY": 0
                  },
                  {
                    "id": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                    "type": "play",
                    "name": "Greeting",
                    "config": {
                      "mode": "tts",
                      "text": "Thanks for calling. Please hold while we connect you."
                    },
                    "positionX": 0,
                    "positionY": 160
                  },
                  {
                    "id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
                    "type": "hangup",
                    "name": "Hang Up",
                    "config": {},
                    "positionX": 0,
                    "positionY": 320
                  }
                ],
                "edges": [
                  {
                    "id": "a0b1c2d3-e4f5-4a6b-8c7d-9e0f1a2b3c4d",
                    "fromNodeId": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                    "toNodeId": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                    "port": "next"
                  },
                  {
                    "id": "b1c2d3e4-f5a6-4b7c-9d8e-0f1a2b3c4d5e",
                    "fromNodeId": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                    "toNodeId": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
                    "port": "next"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "nodes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "nodeType": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "config": {
                                "type": "object",
                                "properties": {}
                              },
                              "positionX": {
                                "type": "integer"
                              },
                              "positionY": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "edges": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "fromNodeId": {
                                "type": "string"
                              },
                              "toNodeId": {
                                "type": "string"
                              },
                              "conditionType": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "issues": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "nodes": [
                      {
                        "id": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                        "nodeType": "inbound",
                        "name": "Inbound Call",
                        "config": {},
                        "positionX": 0,
                        "positionY": 0
                      },
                      {
                        "id": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                        "nodeType": "play",
                        "name": "Greeting",
                        "config": {
                          "mode": "tts",
                          "text": "Thanks for calling. Please hold while we connect you."
                        },
                        "positionX": 0,
                        "positionY": 160
                      },
                      {
                        "id": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
                        "nodeType": "hangup",
                        "name": "Hang Up",
                        "config": {},
                        "positionX": 0,
                        "positionY": 320
                      }
                    ],
                    "edges": [
                      {
                        "id": "a0b1c2d3-e4f5-4a6b-8c7d-9e0f1a2b3c4d",
                        "fromNodeId": "3f2e1d0c-9b8a-4796-8584-736251403f2e",
                        "toNodeId": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                        "conditionType": "next"
                      },
                      {
                        "id": "b1c2d3e4-f5a6-4b7c-9d8e-0f1a2b3c4d5e",
                        "fromNodeId": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",
                        "toNodeId": "1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
                        "conditionType": "next"
                      }
                    ],
                    "issues": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows/{id}/duplicate": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Copy a call flow and its working draft into a new flow in the same subgroup.",
        "description": "Copy a call flow and its working draft into a new flow in the same subgroup. The copy is not published and nothing routes to it. Send an empty JSON object to name the copy “<name> (copy)”. Errors: 404 when the flow isn't yours; 409 when a flow in the subgroup already has that name, including a deleted one.",
        "operationId": "postVoiceApiV1CallFlowsByIdDuplicate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the flow to copy.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name for the copy, unique within the subgroup."
                  }
                }
              },
              "example": {
                "name": "Main Support Line (weekend)"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "currentVersionId": {},
                        "draft": {
                          "type": "object",
                          "properties": {
                            "versionId": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {}
                            },
                            "edges": {
                              "type": "array",
                              "items": {}
                            },
                            "issues": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "4d3c2b1a-0f9e-4d8c-b7a6-5f4e3d2c1b0a",
                    "subgroupId": "S1234567",
                    "name": "Main Support Line (weekend)",
                    "status": "ACTIVE",
                    "currentVersionId": null,
                    "draft": {
                      "versionId": "e1d2c3b4-a5f6-4e7d-8c9b-0a1f2e3d4c5b",
                      "nodes": [],
                      "edges": [],
                      "issues": []
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows/{id}/publish": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Publish the working draft, making it the version calls run.",
        "description": "Publish the working draft, making it the version calls run. The draft stays editable afterwards and changes nothing until you publish again. Send an empty JSON object as the body. Errors: 400 with code CALL_FLOW_NOT_PUBLISHABLE and an issues array when the draft isn't ready. Each issue names the step (nodeId), connection (edgeId) or outcome (port) it concerns, with a code such as ENTRY_MISSING, PORT_UNCONNECTED, UNREACHABLE or CONFIG_INVALID. 404 when the flow isn't yours.",
        "operationId": "postVoiceApiV1CallFlowsByIdPublish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "versionNumber": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string"
                        },
                        "publishedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "5c1f9a2e-3b4d-4e8f-9a0b-1c2d3e4f5a6b",
                    "versionNumber": 1,
                    "status": "PUBLISHED",
                    "publishedAt": "2026-11-17T19:20:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-flows/{id}/restore": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Restore a deleted call flow.",
        "description": "Restore a deleted call flow. Numbers and profiles that still point at it run it again, as long as it is published and enabled. Restoring a flow that isn't deleted changes nothing. Send an empty JSON object as the body. Errors: 404 when the flow isn't yours.",
        "operationId": "postVoiceApiV1CallFlowsByIdRestore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call flow UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "deletedAt": {},
                        "draft": {
                          "type": "object",
                          "properties": {
                            "versionId": {
                              "type": "string"
                            },
                            "nodes": {
                              "type": "array",
                              "items": {}
                            },
                            "edges": {
                              "type": "array",
                              "items": {}
                            },
                            "issues": {
                              "type": "array",
                              "items": {}
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "0088947b-7821-4853-bfe6-744fce926de2",
                    "name": "Main Support Line",
                    "status": "ACTIVE",
                    "deletedAt": null,
                    "draft": {
                      "versionId": "9e8d7c6b-5a49-4382-a1b0-c9d8e7f6a5b4",
                      "nodes": [],
                      "edges": [],
                      "issues": []
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/call-logs": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List call history with rich filtering — by direction, status, call source, sentiment, subgroup, carrier, recording presence, voicemail, free-text query, and date range.",
        "description": "List call history with rich filtering — by direction, status, call source, sentiment, subgroup, carrier, recording presence, voicemail, free-text query, and date range.",
        "operationId": "getVoiceApiV1CallLogs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (1-1000, default 20).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "CSV of INBOUND, OUTBOUND, INTERNAL.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by call status.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "callSource",
            "in": "query",
            "required": false,
            "description": "CSV of SIP_TRUNK, PROGRAMMABLE_VOICE, AI_VOICE, WEBRTC, VOICEMAIL, CONFERENCE, PSTN.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sentiment",
            "in": "query",
            "required": false,
            "description": "positive, negative, or neutral.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Exact carrier match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Filter by originating number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Filter by destination number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "voicemail",
            "in": "query",
            "required": false,
            "description": "Only voicemail calls when true.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hasRecording",
            "in": "query",
            "required": false,
            "description": "Only calls with a recording when true.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "ISO date-time lower bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "ISO date-time upper bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort field (default startedAt).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "asc or desc (default desc).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "callId": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "duration": {
                            "type": "integer"
                          },
                          "startTime": {
                            "type": "string"
                          },
                          "endTime": {
                            "type": "string"
                          },
                          "cost": {
                            "type": "integer"
                          },
                          "callSource": {
                            "type": "string"
                          },
                          "carrier": {
                            "type": "string"
                          },
                          "sentiment": {
                            "type": "string"
                          },
                          "callRecordingUrl": {}
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "page": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "totalPages": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "b1a2c3d4-...",
                      "callId": "8c1f2e34-...",
                      "direction": "OUTBOUND",
                      "from": "+19153374770",
                      "to": "+15551234567",
                      "status": "COMPLETED",
                      "duration": 66,
                      "startTime": "2026-07-28T18:30:01.000Z",
                      "endTime": "2026-07-28T18:31:12.000Z",
                      "cost": 1980,
                      "callSource": "SIP_TRUNK",
                      "carrier": "AT&T",
                      "sentiment": "positive",
                      "callRecordingUrl": null
                    }
                  ],
                  "meta": {
                    "total": 1,
                    "page": 1,
                    "limit": 20,
                    "totalPages": 1
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/api/v1/call-logs/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve a single call log by its UUID or external callId.",
        "description": "Retrieve a single call log by its UUID or external callId.",
        "operationId": "getVoiceApiV1CallLogsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call log UUID or callId.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "callId": {
                          "type": "string"
                        },
                        "direction": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "duration": {
                          "type": "integer"
                        },
                        "cost": {
                          "type": "integer"
                        },
                        "callSource": {
                          "type": "string"
                        },
                        "sentiment": {
                          "type": "string"
                        },
                        "callRecordingUrl": {},
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "b1a2c3d4-...",
                    "callId": "8c1f2e34-...",
                    "direction": "OUTBOUND",
                    "from": "+19153374770",
                    "to": "+15551234567",
                    "status": "COMPLETED",
                    "duration": 66,
                    "cost": 1980,
                    "callSource": "SIP_TRUNK",
                    "sentiment": "positive",
                    "callRecordingUrl": null,
                    "createdAt": "2026-07-28T18:31:12.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/api/v1/call-logs/{id}/recording": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Return a short-TTL presigned URL to play back a call recording.",
        "description": "Return a short-TTL presigned URL to play back a call recording.",
        "operationId": "getVoiceApiV1CallLogsByIdRecording",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call log UUID or callId.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "callId": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "expiresIn": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "callId": "8c1f2e34-...",
                    "url": "https://recordings.signalhouse.io/...signed",
                    "expiresIn": 300
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/api/v1/call-logs/{id}/voicemail-read": {
      "patch": {
        "tags": [
          "Voice"
        ],
        "summary": "Mark a voicemail as read or unread.",
        "description": "Mark a voicemail as read or unread.",
        "operationId": "patchVoiceApiV1CallLogsByIdVoicemailRead",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Call log UUID or callId.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "boolean",
                    "description": "Read state to set. Defaults to true."
                  }
                }
              },
              "example": {
                "read": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "voicemailReadAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "b1a2c3d4-...",
                    "voicemailReadAt": "2026-07-28T18:40:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/global-voice-settings": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve account-wide voice defaults.",
        "description": "Retrieve account-wide voice defaults. Returns null data when settings have never been configured.",
        "operationId": "getVoiceApiV1GlobalVoiceSettings",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string"
                        },
                        "acceptedRegions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "maxSpendPerMinute": {
                          "type": "integer"
                        },
                        "e911Enabled": {
                          "type": "boolean"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "accountId": "G1234567",
                    "acceptedRegions": [
                      "1"
                    ],
                    "maxSpendPerMinute": 10,
                    "e911Enabled": false,
                    "updatedAt": "2026-07-20T12:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Voice"
        ],
        "summary": "Update account-wide voice defaults.",
        "description": "Update account-wide voice defaults. Partial — omitted fields are preserved.",
        "operationId": "putVoiceApiV1GlobalVoiceSettings",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "acceptedRegions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Country calling codes allowed for calls; empty means all."
                  },
                  "maxSpendPerMinute": {
                    "type": "number",
                    "description": "Per-minute spend cap; null means no limit."
                  },
                  "e911Enabled": {
                    "type": "boolean",
                    "description": "Enable E911 by default."
                  }
                }
              },
              "example": {
                "acceptedRegions": [
                  "1"
                ],
                "maxSpendPerMinute": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accountId": {
                          "type": "string"
                        },
                        "acceptedRegions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "maxSpendPerMinute": {
                          "type": "integer"
                        },
                        "e911Enabled": {
                          "type": "boolean"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "accountId": "G1234567",
                    "acceptedRegions": [
                      "1"
                    ],
                    "maxSpendPerMinute": 10,
                    "e911Enabled": false,
                    "updatedAt": "2026-07-28T18:30:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/numbers/{e164}/route": {
      "put": {
        "tags": [
          "Voice"
        ],
        "summary": "Set a number's route, creating it or replacing the existing one.",
        "description": "Set a number's route, creating it or replacing the existing one. The whole route is replaced: fields the new routeAction doesn't use are cleared, so a number never keeps a stale target. SIP trunk and SIP endpoint targets must belong to your account. Returns the saved route and the routing now in effect. Errors: 400 when the number isn't valid E.164 or a field the routeAction requires is missing; 404 when the number isn't held by your account or the SIP trunk / SIP endpoint isn't yours; 503 when number ownership couldn't be verified (safe to retry).",
        "operationId": "putVoiceApiV1NumbersByE164Route",
        "parameters": [
          {
            "name": "e164",
            "in": "path",
            "required": true,
            "description": "The phone number in E.164 (leading + optional).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "routeAction": {
                    "type": "string",
                    "description": "FORWARD, WEBRTC, SIP_TRUNK, SIP_PROFILE, CALL_CONTROL, AI, VOICEMAIL or CALL_FLOW."
                  },
                  "forwardToE164": {
                    "type": "string",
                    "description": "Destination number in E.164. Required for FORWARD, and for WEBRTC when noAnswerAction is FORWARD."
                  },
                  "noAnswerAction": {
                    "type": "string",
                    "description": "WEBRTC only: VOICEMAIL (default), FORWARD or KEEP_RINGING — what happens when no softphone answers."
                  },
                  "noAnswerSeconds": {
                    "type": "integer",
                    "description": "WEBRTC only: seconds to ring before the no-answer action, 5-120 (default 20)."
                  },
                  "routeSipTrunkId": {
                    "type": "string",
                    "description": "SIP trunk to deliver to (required for SIP_TRUNK)."
                  },
                  "routeSipProfileId": {
                    "type": "string",
                    "description": "SIP endpoint to ring (required for SIP_PROFILE)."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Your inbound voice webhook / SHML program URL (required for CALL_CONTROL). See Programmable Call Control (SHML) above. Must be a public http(s) address: a URL naming an internal or private host is refused with a 400."
                  },
                  "routeAgentProfileId": {
                    "type": "string",
                    "description": "AI agent profile id (AGP…) to answer the call (required for AI)."
                  },
                  "routeCallFlowId": {
                    "type": "string",
                    "description": "Call flow to run (required for CALL_FLOW). It must be in the number's subgroup. It need not be published yet: until it is published and enabled, calls fall through to the number's Programmable Voice Profile or subgroup voice settings. See Call Flows below."
                  },
                  "recordingEnabled": {
                    "type": "boolean",
                    "description": "Record calls handled by this route (default false)."
                  }
                },
                "required": [
                  "routeAction"
                ]
              },
              "example": {
                "routeAction": "FORWARD",
                "forwardToE164": "+13055551234"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "e164": {
                      "type": "string"
                    },
                    "route": {
                      "type": "object",
                      "properties": {
                        "e164": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "routeAction": {
                          "type": "string"
                        },
                        "forwardToE164": {
                          "type": "string"
                        },
                        "noAnswerAction": {},
                        "noAnswerSeconds": {},
                        "routeSipTrunkId": {},
                        "routeSipProfileId": {},
                        "webhookUrl": {},
                        "routeAgentProfileId": {},
                        "recordingEnabled": {
                          "type": "boolean"
                        },
                        "source": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    },
                    "effective": {
                      "type": "object",
                      "properties": {
                        "found": {
                          "type": "boolean"
                        },
                        "action": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "forwardToE164": {
                          "type": "string"
                        },
                        "recording": {
                          "type": "boolean"
                        },
                        "source": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "e164": "+19153374770",
                  "route": {
                    "e164": "+19153374770",
                    "accountId": "G1234567",
                    "routeAction": "FORWARD",
                    "forwardToE164": "+13055551234",
                    "noAnswerAction": null,
                    "noAnswerSeconds": null,
                    "routeSipTrunkId": null,
                    "routeSipProfileId": null,
                    "webhookUrl": null,
                    "routeAgentProfileId": null,
                    "recordingEnabled": false,
                    "source": "api",
                    "createdAt": "2026-10-21T03:00:00.000Z",
                    "updatedAt": "2026-10-21T03:00:00.000Z"
                  },
                  "effective": {
                    "found": true,
                    "action": "FORWARD",
                    "subgroupId": "S1234567",
                    "accountId": "G1234567",
                    "forwardToE164": "+13055551234",
                    "recording": false,
                    "source": "number_route"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Read a number's own route and the routing currently in effect for it.",
        "description": "Read a number's own route and the routing currently in effect for it. route is null when the number has no route of its own. effective shows how inbound calls are routed and which layer decided it in effective.source: number_route, programmable_profile, subgroup_settings or default. Numbers assigned to a SIP trunk or SIP endpoint are routed by that assignment unless a number route is set. Errors: 404 when the number isn't held by your account.",
        "operationId": "getVoiceApiV1NumbersByE164Route",
        "parameters": [
          {
            "name": "e164",
            "in": "path",
            "required": true,
            "description": "The phone number in E.164 (leading + optional).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "e164": {
                      "type": "string"
                    },
                    "route": {},
                    "effective": {
                      "type": "object",
                      "properties": {
                        "found": {
                          "type": "boolean"
                        },
                        "action": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "forwardToE164": {},
                        "noAnswerAction": {
                          "type": "string"
                        },
                        "noAnswerSeconds": {
                          "type": "integer"
                        },
                        "recording": {
                          "type": "boolean"
                        },
                        "source": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "e164": "+19153374770",
                  "route": null,
                  "effective": {
                    "found": true,
                    "action": "WEBRTC",
                    "subgroupId": "S1234567",
                    "accountId": "G1234567",
                    "forwardToE164": null,
                    "noAnswerAction": "VOICEMAIL",
                    "noAnswerSeconds": 20,
                    "recording": false,
                    "source": "default"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Remove a number's own route.",
        "description": "Remove a number's own route. Calls to the number are then routed by its Programmable Voice Profile, subgroup voice settings or the default, as shown in effective. Errors: 404 when the number isn't held by your account or has no route to remove.",
        "operationId": "deleteVoiceApiV1NumbersByE164Route",
        "parameters": [
          {
            "name": "e164",
            "in": "path",
            "required": true,
            "description": "The phone number in E.164 (leading + optional).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "e164": {
                      "type": "string"
                    },
                    "route": {},
                    "effective": {
                      "type": "object",
                      "properties": {
                        "found": {
                          "type": "boolean"
                        },
                        "action": {
                          "type": "string"
                        },
                        "subgroupId": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        },
                        "noAnswerAction": {
                          "type": "string"
                        },
                        "noAnswerSeconds": {
                          "type": "integer"
                        },
                        "recording": {
                          "type": "boolean"
                        },
                        "source": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "e164": "+19153374770",
                  "route": null,
                  "effective": {
                    "found": true,
                    "action": "WEBRTC",
                    "subgroupId": "S1234567",
                    "accountId": "G1234567",
                    "noAnswerAction": "VOICEMAIL",
                    "noAnswerSeconds": 20,
                    "recording": false,
                    "source": "default"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/programmable-voice-profiles": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List programmable voice profiles.",
        "description": "List programmable voice profiles. A profile defines how inbound calls to its assigned numbers are handled — forwarded, routed to WebRTC, or delivered to a SIP trunk or profile — scoped to one or more subgroups.",
        "operationId": "getVoiceApiV1ProgrammableVoiceProfiles",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "subgroupIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "routeAction": {
                            "type": "string"
                          },
                          "forwardToE164": {
                            "type": "string"
                          },
                          "forwardAfterSeconds": {
                            "type": "integer"
                          },
                          "recordingEnabled": {
                            "type": "boolean"
                          },
                          "numbers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "e164": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profiles": [
                    {
                      "id": "pv1a2b3c-...",
                      "name": "Support Routing",
                      "enabled": true,
                      "subgroupIds": [
                        "S1234567"
                      ],
                      "routeAction": "FORWARD",
                      "forwardToE164": "+15558675309",
                      "forwardAfterSeconds": 20,
                      "recordingEnabled": true,
                      "numbers": [
                        {
                          "e164": "+19153374770",
                          "createdAt": "2026-07-20T12:00:00.000Z"
                        }
                      ],
                      "createdAt": "2026-07-20T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Create a programmable voice profile.",
        "description": "Create a programmable voice profile. routeAction determines which target fields are required: FORWARD needs forwardToE164, SIP_TRUNK needs routeSipTrunkId, SIP_PROFILE needs routeSipProfileId, CALL_CONTROL needs webhookUrl, AI needs routeAgentProfileId, CALL_FLOW needs routeCallFlowId, WEBRTC needs none.",
        "operationId": "postVoiceApiV1ProgrammableVoiceProfiles",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Profile name."
                  },
                  "subgroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Subgroups this profile applies to (at least one)."
                  },
                  "routeAction": {
                    "type": "string",
                    "description": "FORWARD, WEBRTC, SIP_TRUNK, SIP_PROFILE, CALL_CONTROL, AI or CALL_FLOW (default FORWARD)."
                  },
                  "forwardToE164": {
                    "type": "string",
                    "description": "Destination number (required for FORWARD)."
                  },
                  "forwardAfterSeconds": {
                    "type": "number",
                    "description": "Ring timeout before forwarding."
                  },
                  "routeSipTrunkId": {
                    "type": "string",
                    "description": "Trunk to deliver to (required for SIP_TRUNK)."
                  },
                  "routeSipProfileId": {
                    "type": "string",
                    "description": "Profile to deliver to (required for SIP_PROFILE)."
                  },
                  "routeAgentProfileId": {
                    "type": "string",
                    "description": "AI agent profile id (AGP…) to answer the call (required for AI). The agent's prompt, voice, model and tools are read when the call lands, so editing the agent takes effect on the next call with nothing to re-save here."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Your inbound voice webhook / SHML program URL (required for CALL_CONTROL). See Programmable Call Control (SHML) above. Must be a public http(s) address: a URL naming an internal or private host is refused with a 400."
                  },
                  "routeCallFlowId": {
                    "type": "string",
                    "description": "Call flow to run (required for CALL_FLOW). It must be in one of the profile's subgroups. Until it is published and enabled, calls fall through to the subgroup's voice settings. See Call Flows below."
                  },
                  "recordingEnabled": {
                    "type": "boolean",
                    "description": "Record calls handled by this profile."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Whether the profile is active."
                  }
                },
                "required": [
                  "name",
                  "subgroupIds"
                ]
              },
              "example": {
                "name": "Support Routing",
                "subgroupIds": [
                  "S1234567"
                ],
                "routeAction": "FORWARD",
                "forwardToE164": "+15558675309",
                "forwardAfterSeconds": 20,
                "recordingEnabled": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "subgroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "routeAction": {
                          "type": "string"
                        },
                        "forwardToE164": {
                          "type": "string"
                        },
                        "numbers": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "name": "Support Routing",
                    "enabled": true,
                    "subgroupIds": [
                      "S1234567"
                    ],
                    "routeAction": "FORWARD",
                    "forwardToE164": "+15558675309",
                    "numbers": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/programmable-voice-profiles/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve a single programmable voice profile.",
        "description": "Retrieve a single programmable voice profile.",
        "operationId": "getVoiceApiV1ProgrammableVoiceProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "subgroupIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "routeAction": {
                          "type": "string"
                        },
                        "forwardToE164": {
                          "type": "string"
                        },
                        "numbers": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "name": "Support Routing",
                    "enabled": true,
                    "subgroupIds": [
                      "S1234567"
                    ],
                    "routeAction": "FORWARD",
                    "forwardToE164": "+15558675309",
                    "numbers": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "patch": {
        "tags": [
          "Voice"
        ],
        "summary": "Update a programmable voice profile.",
        "description": "Update a programmable voice profile. All fields optional.",
        "operationId": "patchVoiceApiV1ProgrammableVoiceProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name."
                  },
                  "subgroupIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replacement subgroup list."
                  },
                  "routeAction": {
                    "type": "string",
                    "description": "FORWARD, WEBRTC, SIP_TRUNK, SIP_PROFILE, CALL_CONTROL, AI or CALL_FLOW."
                  },
                  "forwardToE164": {
                    "type": "string",
                    "description": "Destination number."
                  },
                  "routeAgentProfileId": {
                    "type": "string",
                    "description": "AI agent profile id (AGP…) to answer the call (required when routeAction is AI). Pass null to clear."
                  },
                  "webhookUrl": {
                    "type": "string",
                    "description": "Inbound voice webhook / SHML program URL (required for CALL_CONTROL). Pass null to clear. Must be a public http(s) address: a URL naming an internal or private host is refused with a 400."
                  },
                  "routeCallFlowId": {
                    "type": "string",
                    "description": "Call flow to run (required when routeAction is CALL_FLOW). It must be in one of the profile's subgroups, and narrowing subgroupIds away from it is refused. Pass null to clear."
                  },
                  "recordingEnabled": {
                    "type": "boolean",
                    "description": "Record calls."
                  }
                }
              },
              "example": {
                "forwardAfterSeconds": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "forwardAfterSeconds": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "forwardAfterSeconds": 30
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Delete a programmable voice profile.",
        "description": "Delete a programmable voice profile.",
        "operationId": "deleteVoiceApiV1ProgrammableVoiceProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "Programmable voice profile deleted"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/programmable-voice-profiles/{id}/assign-number": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Assign an owned E.164 number to this profile.",
        "description": "Assign an owned E.164 number to this profile.",
        "operationId": "postVoiceApiV1ProgrammableVoiceProfilesByIdAssignNumber",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "e164": {
                    "type": "string",
                    "description": "E.164 number to assign."
                  }
                },
                "required": [
                  "e164"
                ]
              },
              "example": {
                "e164": "+19153374770"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "numbers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "e164": {
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "numbers": [
                      {
                        "e164": "+19153374770",
                        "createdAt": "2026-07-28T18:30:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/programmable-voice-profiles/{id}/toggle-active": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Enable or disable a programmable voice profile.",
        "description": "Enable or disable a programmable voice profile.",
        "operationId": "postVoiceApiV1ProgrammableVoiceProfilesByIdToggleActive",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "enabled": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/programmable-voice-profiles/{id}/unassign-number": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Remove a number from this profile.",
        "description": "Remove a number from this profile.",
        "operationId": "postVoiceApiV1ProgrammableVoiceProfilesByIdUnassignNumber",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "e164": {
                    "type": "string",
                    "description": "E.164 number to unassign."
                  }
                },
                "required": [
                  "e164"
                ]
              },
              "example": {
                "e164": "+19153374770"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "numbers": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "profile": {
                    "id": "pv1a2b3c-...",
                    "numbers": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/push-credentials": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List the account's push credentials.",
        "description": "List the account's push credentials. Secrets are never returned; fingerprint is the first 12 hex characters of the key's SHA-256, to tell keys apart.",
        "operationId": "getVoiceApiV1PushCredentials",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "appId": {
                            "type": "string"
                          },
                          "keyId": {
                            "type": "string"
                          },
                          "teamId": {
                            "type": "string"
                          },
                          "bundleId": {
                            "type": "string"
                          },
                          "projectId": {},
                          "clientEmail": {},
                          "fingerprint": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "5a3c2f8e-1b7d-4c9a-9e2f-0d4b6a8c1e33",
                      "provider": "apns",
                      "name": "Production app",
                      "appId": "com.example.app",
                      "keyId": "ABC123DEFG",
                      "teamId": "TEAM123456",
                      "bundleId": "com.example.app",
                      "projectId": null,
                      "clientEmail": null,
                      "fingerprint": "3f9a1c7e2b04",
                      "createdAt": "2026-11-25T15:00:00.000Z",
                      "updatedAt": "2026-11-25T15:00:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Upload push credentials for one app: an Apple APNs auth key (one key works for development and production builds) or a Firebase service account.",
        "description": "Upload push credentials for one app: an Apple APNs auth key (one key works for development and production builds) or a Firebase service account. The key is checked when you upload it. One credential per app; to change one, replace it.",
        "operationId": "postVoiceApiV1PushCredentials",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "description": "\"apns\" (Apple, iOS) or \"fcm\" (Firebase, Android)."
                  },
                  "name": {
                    "type": "string",
                    "description": "A label for the credential, up to 100 characters."
                  },
                  "keyId": {
                    "type": "string",
                    "description": "apns: the 10-character key ID of the .p8 key. Required for apns."
                  },
                  "teamId": {
                    "type": "string",
                    "description": "apns: your 10-character Apple developer team ID. Required for apns."
                  },
                  "bundleId": {
                    "type": "string",
                    "description": "apns: your app's bundle ID. VoIP pushes go to its .voip topic. Required for apns."
                  },
                  "privateKey": {
                    "type": "string",
                    "description": "apns: the contents of the .p8 file. Required for apns."
                  },
                  "serviceAccount": {
                    "type": "string",
                    "description": "fcm: the service account key file from Firebase (Project settings › Service accounts), as its JSON text or as an object. Required for fcm."
                  }
                },
                "required": [
                  "provider"
                ]
              },
              "example": {
                "provider": "apns",
                "name": "Production app",
                "keyId": "ABC123DEFG",
                "teamId": "TEAM123456",
                "bundleId": "com.example.app",
                "privateKey": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "appId": {
                          "type": "string"
                        },
                        "keyId": {
                          "type": "string"
                        },
                        "teamId": {
                          "type": "string"
                        },
                        "bundleId": {
                          "type": "string"
                        },
                        "projectId": {},
                        "clientEmail": {},
                        "fingerprint": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "5a3c2f8e-1b7d-4c9a-9e2f-0d4b6a8c1e33",
                    "provider": "apns",
                    "name": "Production app",
                    "appId": "com.example.app",
                    "keyId": "ABC123DEFG",
                    "teamId": "TEAM123456",
                    "bundleId": "com.example.app",
                    "projectId": null,
                    "clientEmail": null,
                    "fingerprint": "3f9a1c7e2b04",
                    "createdAt": "2026-11-25T15:00:00.000Z",
                    "updatedAt": "2026-11-25T15:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/push-credentials/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Get one push credential (metadata only).",
        "description": "Get one push credential (metadata only).",
        "operationId": "getVoiceApiV1PushCredentialsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "appId": {
                          "type": "string"
                        },
                        "keyId": {},
                        "teamId": {},
                        "bundleId": {},
                        "projectId": {
                          "type": "string"
                        },
                        "clientEmail": {
                          "type": "string"
                        },
                        "fingerprint": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "8d1e4b2a-6c3f-4a7e-b1d9-2f5c7e9a0b44",
                    "provider": "fcm",
                    "name": "Android",
                    "appId": "example-voice",
                    "keyId": null,
                    "teamId": null,
                    "bundleId": null,
                    "projectId": "example-voice",
                    "clientEmail": "push@example-voice.iam.gserviceaccount.com",
                    "fingerprint": "b71d0e9c4a25",
                    "createdAt": "2026-11-25T15:05:00.000Z",
                    "updatedAt": "2026-11-25T15:05:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "put": {
        "tags": [
          "Voice"
        ],
        "summary": "Replace a credential's key or service account (and name).",
        "description": "Replace a credential's key or service account (and name). Same body as upload; the provider cannot change. Registered devices keep working and use the new key from then on.",
        "operationId": "putVoiceApiV1PushCredentialsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string"
                  },
                  "serviceAccount": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "provider": "fcm",
                "serviceAccount": "{\"type\":\"service_account\",\"project_id\":\"example-voice\",...}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "appId": {
                          "type": "string"
                        },
                        "projectId": {
                          "type": "string"
                        },
                        "fingerprint": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "8d1e4b2a-6c3f-4a7e-b1d9-2f5c7e9a0b44",
                    "provider": "fcm",
                    "appId": "example-voice",
                    "projectId": "example-voice",
                    "fingerprint": "c02e8f6a1d39",
                    "updatedAt": "2026-11-26T09:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Delete a credential and every device registered for that app.",
        "description": "Delete a credential and every device registered for that app. Calls stop waking those phones until you upload a credential and the app registers again.",
        "operationId": "deleteVoiceApiV1PushCredentialsById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The credential ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "success": true
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/api/v1/push-devices": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Register this device for push.",
        "description": "Register this device for push. Called by your app with the user's voice token (from POST /voice/tokens, minted with a subgroupId) as the bearer token, not a dashboard or API key token. Ties the device's push token to the voice token's identity. Refused if the token was minted with incoming calls off, or if the account has no credential for the provider. A push token already registered to another user moves to this one.",
        "operationId": "postVoiceApiV1PushDevices",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "description": "\"apns\" or \"fcm\"."
                  },
                  "deviceToken": {
                    "type": "string",
                    "description": "The device's push token: the PushKit VoIP token (hex) on iOS, the Firebase registration token on Android."
                  },
                  "environment": {
                    "type": "string",
                    "description": "apns only: \"sandbox\" for development builds, \"production\" (default) for TestFlight and App Store builds."
                  },
                  "appId": {
                    "type": "string",
                    "description": "The bundle ID or Firebase project ID. Only needed when the account has more than one credential for the provider."
                  }
                },
                "required": [
                  "provider",
                  "deviceToken"
                ]
              },
              "example": {
                "provider": "apns",
                "deviceToken": "740f4707bebcf74f9b7c25d48e3358945f6aa01da5ddb387462c7eaf61bb78ad",
                "environment": "production"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "identity": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "environment": {
                          "type": "string"
                        },
                        "appId": {
                          "type": "string"
                        },
                        "registeredAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "id": "c4e2a9f1-7b3d-4e8a-a5c6-9d1f0b2e7a55",
                    "identity": "agent-42",
                    "provider": "apns",
                    "environment": "production",
                    "appId": "com.example.app",
                    "registeredAt": "2026-11-25T15:10:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/voice/api/v1/push-devices/deliveries": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "The pushes recently sent to this voice token's user, newest first, for debugging your app.",
        "description": "The pushes recently sent to this voice token's user, newest first, for debugging your app. status is sent, failed, or removed (the provider said the device token is no longer valid, so the device was unregistered). Kept for 7 days.",
        "operationId": "getVoiceApiV1PushDevicesDeliveries",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 100 (default 20).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "callUuid": {
                            "type": "string"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "error": {},
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "e9b1c3d5-2f4a-4b6c-8d0e-1a3c5e7f9b66",
                      "callUuid": "8f3a2b1c-4d5e@203.0.113.10",
                      "provider": "apns",
                      "kind": "incoming",
                      "status": "sent",
                      "error": null,
                      "createdAt": "2026-11-25T15:12:03.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/voice/api/v1/push-devices/{deviceToken}": {
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Unregister this device, e.g.",
        "description": "Unregister this device, e.g. when the user signs out. Called with the user's voice token.",
        "operationId": "deleteVoiceApiV1PushDevicesByDeviceToken",
        "parameters": [
          {
            "name": "deviceToken",
            "in": "path",
            "required": true,
            "description": "The device's push token, URL-encoded.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "removed": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "removed": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/voice/sip-profiles": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List all SIP profiles (device credentials for registering a softphone or PBX endpoint).",
        "description": "List all SIP profiles (device credentials for registering a softphone or PBX endpoint).",
        "operationId": "getVoiceSipProfiles",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "sipDomain": {
                            "type": "string"
                          },
                          "sipPort": {
                            "type": "integer"
                          },
                          "transport": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "recordingAllowed": {
                            "type": "boolean"
                          },
                          "phoneNumbers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "number": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipProfiles": [
                    {
                      "id": "p1a2b3c4-...",
                      "name": "Front Desk",
                      "username": "sip_frontdesk",
                      "sipDomain": "sip.signalhouse.io",
                      "sipPort": 5061,
                      "transport": "TLS",
                      "status": "active",
                      "recordingAllowed": true,
                      "phoneNumbers": [
                        {
                          "id": "n1",
                          "number": "+19153374770",
                          "status": "assigned"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Create a SIP profile.",
        "description": "Create a SIP profile. The generated password is returned once, at the top level of the response.",
        "operationId": "postVoiceSipProfiles",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Profile name."
                  },
                  "recordingAllowed": {
                    "type": "boolean",
                    "description": "Allow call recording on this profile."
                  },
                  "transcriptionEnabled": {
                    "type": "boolean",
                    "description": "Enable transcription."
                  },
                  "sentimentFlag": {
                    "type": "boolean",
                    "description": "Enable sentiment scoring."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Front Desk",
                "recordingAllowed": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "sipDomain": {
                          "type": "string"
                        },
                        "transport": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    },
                    "password": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "sipProfile": {
                    "id": "p1a2b3c4-...",
                    "name": "Front Desk",
                    "username": "sip_frontdesk",
                    "sipDomain": "sip.signalhouse.io",
                    "transport": "TLS",
                    "status": "active"
                  },
                  "password": "one-time-sip-password",
                  "message": "SIP profile created"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-profiles/transports": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List valid transports and their address/port per region.",
        "description": "List valid transports and their address/port per region.",
        "operationId": "getVoiceSipProfilesTransports",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transports": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transport": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "port": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "transports": [
                    {
                      "transport": "TLS",
                      "address": "sip.signalhouse.io",
                      "port": 5061
                    },
                    {
                      "transport": "UDP",
                      "address": "sip.signalhouse.io",
                      "port": 5060
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-profiles/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve a single SIP profile.",
        "description": "Retrieve a single SIP profile. The password is not included — use the password endpoint.",
        "operationId": "getVoiceSipProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "sipDomain": {
                          "type": "string"
                        },
                        "transport": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "recordingAllowed": {
                          "type": "boolean"
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipProfile": {
                    "id": "p1a2b3c4-...",
                    "name": "Front Desk",
                    "username": "sip_frontdesk",
                    "sipDomain": "sip.signalhouse.io",
                    "transport": "TLS",
                    "status": "active",
                    "recordingAllowed": true,
                    "phoneNumbers": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "patch": {
        "tags": [
          "Voice"
        ],
        "summary": "Update a SIP profile.",
        "description": "Update a SIP profile. Pass password to rotate the credential.",
        "operationId": "patchVoiceSipProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New profile name."
                  },
                  "sipUsername": {
                    "type": "string",
                    "description": "New SIP username."
                  },
                  "password": {
                    "type": "string",
                    "description": "New SIP password."
                  },
                  "transport": {
                    "type": "string",
                    "description": "UDP, TCP, or TLS."
                  },
                  "recordingAllowed": {
                    "type": "boolean",
                    "description": "Allow call recording."
                  },
                  "transcriptionEnabled": {
                    "type": "boolean",
                    "description": "Enable transcription."
                  },
                  "sentimentFlag": {
                    "type": "boolean",
                    "description": "Enable sentiment scoring."
                  }
                }
              },
              "example": {
                "recordingAllowed": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "recordingAllowed": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipProfile": {
                    "id": "p1a2b3c4-...",
                    "name": "Front Desk",
                    "recordingAllowed": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Delete a SIP profile.",
        "description": "Delete a SIP profile. Any assigned numbers are unassigned.",
        "operationId": "deleteVoiceSipProfilesById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "SIP profile deleted"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-profiles/{id}/assign-number": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Route an inbound number to this SIP profile.",
        "description": "Route an inbound number to this SIP profile. Numbers are identified by their E.164.",
        "operationId": "postVoiceSipProfilesByIdAssignNumber",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "e164": {
                    "type": "string",
                    "description": "The phone number in E.164."
                  }
                },
                "required": [
                  "e164"
                ]
              },
              "example": {
                "e164": "+19153374770"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "number": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipProfile": {
                    "id": "p1a2b3c4-...",
                    "phoneNumbers": [
                      {
                        "id": "n1a2b3c4-...",
                        "number": "+19153374770",
                        "status": "assigned"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-profiles/{id}/password": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve the stored SIP password for a profile.",
        "description": "Retrieve the stored SIP password for a profile.",
        "operationId": "getVoiceSipProfilesByIdPassword",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "password": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "password": "profile-sip-password"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-profiles/{id}/unassign-number": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Unassign a number from this SIP profile.",
        "description": "Unassign a number from this SIP profile.",
        "operationId": "postVoiceSipProfilesByIdUnassignNumber",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP profile UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "e164": {
                    "type": "string",
                    "description": "The phone number in E.164."
                  }
                },
                "required": [
                  "e164"
                ]
              },
              "example": {
                "e164": "+19153374770"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipProfile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipProfile": {
                    "id": "p1a2b3c4-...",
                    "phoneNumbers": []
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List all SIP trunks on the account.",
        "description": "List all SIP trunks on the account.",
        "operationId": "getVoiceSipTrunks",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipTrunks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "region": {
                            "type": "string"
                          },
                          "connectionType": {
                            "type": "string"
                          },
                          "transport": {
                            "type": "string"
                          },
                          "isActive": {
                            "type": "boolean"
                          },
                          "sipDomain": {
                            "type": "string"
                          },
                          "allowedIps": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "e911Enabled": {
                            "type": "boolean"
                          },
                          "phoneNumbers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "number": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipTrunks": [
                    {
                      "id": "0a1b2c3d-...",
                      "name": "Primary Trunk",
                      "region": "us-east-1",
                      "connectionType": "IP_AUTH",
                      "transport": "tcp",
                      "isActive": true,
                      "sipDomain": "trunk.signalhouse.io",
                      "allowedIps": [
                        "203.0.113.10"
                      ],
                      "e911Enabled": false,
                      "phoneNumbers": [
                        {
                          "id": "n1",
                          "number": "+19153374770"
                        }
                      ],
                      "createdAt": "2026-07-20T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Create a SIP trunk.",
        "description": "Create a SIP trunk. connectionType IP_AUTH authorizes by source IP; REGISTRATION returns generated username/password credentials.",
        "operationId": "postVoiceSipTrunks",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Trunk name (1-255 chars)."
                  },
                  "region": {
                    "type": "string",
                    "description": "SIP POP region code (see /voice/sip-trunks/pops)."
                  },
                  "connectionType": {
                    "type": "string",
                    "description": "IP_AUTH or REGISTRATION."
                  },
                  "transport": {
                    "type": "string",
                    "description": "tcp, udp, or tls (default tcp)."
                  },
                  "allowedIps": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Source IPs allowed to send (IP_AUTH)."
                  },
                  "destinationHosts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Where outbound calls are delivered: { host, port }."
                  },
                  "sourceHosts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Trusted inbound source hosts: { host }."
                  },
                  "maxSpendPerMinute": {
                    "type": "number",
                    "description": "Per-minute spend cap."
                  },
                  "allowedRegions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Permitted destination regions."
                  },
                  "e911Enabled": {
                    "type": "boolean",
                    "description": "Enable E911 (default false)."
                  }
                },
                "required": [
                  "name",
                  "region",
                  "connectionType"
                ]
              },
              "example": {
                "name": "Primary Trunk",
                "region": "us-east-1",
                "connectionType": "IP_AUTH",
                "transport": "tcp",
                "allowedIps": [
                  "203.0.113.10"
                ],
                "destinationHosts": [
                  {
                    "host": "203.0.113.20",
                    "port": "5060"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipTrunk": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "region": {
                          "type": "string"
                        },
                        "connectionType": {
                          "type": "string"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "sipDomain": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipTrunk": {
                    "id": "0a1b2c3d-...",
                    "name": "Primary Trunk",
                    "region": "us-east-1",
                    "connectionType": "IP_AUTH",
                    "isActive": true,
                    "sipDomain": "trunk.signalhouse.io",
                    "createdAt": "2026-07-28T18:30:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks/pops": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List available SIP points of presence (regions, domains, and ports) for trunk configuration.",
        "description": "List available SIP points of presence (regions, domains, and ports) for trunk configuration.",
        "operationId": "getVoiceSipTrunksPops",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipPops": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "popCode": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "sipDomain": {
                            "type": "string"
                          },
                          "udpPort": {
                            "type": "integer"
                          },
                          "tcpPort": {
                            "type": "integer"
                          },
                          "tlsPort": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipPops": [
                    {
                      "id": "pop-use1",
                      "popCode": "us-east-1",
                      "name": "US East (Virginia)",
                      "sipDomain": "use1.trunk.signalhouse.io",
                      "udpPort": 5060,
                      "tcpPort": 5060,
                      "tlsPort": 5061
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks/{id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve a single SIP trunk by ID.",
        "description": "Retrieve a single SIP trunk by ID.",
        "operationId": "getVoiceSipTrunksById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipTrunk": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "region": {
                          "type": "string"
                        },
                        "connectionType": {
                          "type": "string"
                        },
                        "transport": {
                          "type": "string"
                        },
                        "isActive": {
                          "type": "boolean"
                        },
                        "sipDomain": {
                          "type": "string"
                        },
                        "destinationHosts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "host": {
                                "type": "string"
                              },
                              "port": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "sourceHosts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "host": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "phoneNumbers": {
                          "type": "array",
                          "items": {}
                        },
                        "createdAt": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipTrunk": {
                    "id": "0a1b2c3d-...",
                    "name": "Primary Trunk",
                    "region": "us-east-1",
                    "connectionType": "IP_AUTH",
                    "transport": "tcp",
                    "isActive": true,
                    "sipDomain": "trunk.signalhouse.io",
                    "destinationHosts": [
                      {
                        "host": "203.0.113.20",
                        "port": "5060"
                      }
                    ],
                    "sourceHosts": [
                      {
                        "host": "203.0.113.10"
                      }
                    ],
                    "phoneNumbers": [],
                    "createdAt": "2026-07-20T12:00:00.000Z"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "patch": {
        "tags": [
          "Voice"
        ],
        "summary": "Update a SIP trunk.",
        "description": "Update a SIP trunk. All fields are optional; only supplied fields are changed.",
        "operationId": "patchVoiceSipTrunksById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New trunk name."
                  },
                  "transport": {
                    "type": "string",
                    "description": "tcp, udp, or tls."
                  },
                  "allowedIps": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Replacement source IP allowlist."
                  },
                  "destinationHosts": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "description": "Replacement destination hosts."
                  },
                  "maxSpendPerMinute": {
                    "type": "number",
                    "description": "Per-minute spend cap."
                  },
                  "e911Enabled": {
                    "type": "boolean",
                    "description": "Enable or disable E911."
                  }
                }
              },
              "example": {
                "name": "Primary Trunk (US East)",
                "maxSpendPerMinute": 5
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipTrunk": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "maxSpendPerMinute": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipTrunk": {
                    "id": "0a1b2c3d-...",
                    "name": "Primary Trunk (US East)",
                    "maxSpendPerMinute": 5
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "delete": {
        "tags": [
          "Voice"
        ],
        "summary": "Delete a SIP trunk.",
        "description": "Delete a SIP trunk.",
        "operationId": "deleteVoiceSipTrunksById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "success": true,
                  "message": "SIP trunk deleted"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks/{id}/assign-numbers": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Route one or more owned E.164 numbers down this trunk.",
        "description": "Route one or more owned E.164 numbers down this trunk. Numbers that cannot be assigned are returned in skipped.",
        "operationId": "postVoiceSipTrunksByIdAssignNumbers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phoneNumbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "E.164 numbers to assign."
                  }
                },
                "required": [
                  "phoneNumbers"
                ]
              },
              "example": {
                "phoneNumbers": [
                  "+19153374770",
                  "+15551234567"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assigned": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "e164": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "assigned": [
                    "+19153374770"
                  ],
                  "skipped": [
                    {
                      "e164": "+15551234567",
                      "reason": "not owned"
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/sip-trunks/{id}/regenerate-password": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Rotate the SIP registration password for a REGISTRATION trunk.",
        "description": "Rotate the SIP registration password for a REGISTRATION trunk. The new password is returned once.",
        "operationId": "postVoiceSipTrunksByIdRegeneratePassword",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "password": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "password": "new-one-time-trunk-password"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks/{id}/toggle-active": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Enable or disable a SIP trunk.",
        "description": "Enable or disable a SIP trunk.",
        "operationId": "postVoiceSipTrunksByIdToggleActive",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sipTrunk": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "isActive": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sipTrunk": {
                    "id": "0a1b2c3d-...",
                    "isActive": false
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/sip-trunks/{id}/unassign-numbers": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Detach numbers from this trunk.",
        "description": "Detach numbers from this trunk.",
        "operationId": "postVoiceSipTrunksByIdUnassignNumbers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "SIP trunk UUID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phoneNumbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "E.164 numbers to unassign."
                  }
                },
                "required": [
                  "phoneNumbers"
                ]
              },
              "example": {
                "phoneNumbers": [
                  "+19153374770"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "unassigned": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "unassigned": [
                    "+19153374770"
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/voice/stats/voice-analytics": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Aggregated voice analytics — per-direction summary tiles plus breakdowns by date, number, carrier, and channel.",
        "description": "Aggregated voice analytics — per-direction summary tiles plus breakdowns by date, number, carrier, and channel. Summary tiles honor all filters except direction; breakdowns honor all filters.",
        "operationId": "getVoiceStatsVoiceAnalytics",
        "parameters": [
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "description": "ISO date-time lower bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "description": "ISO date-time upper bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "day, week, or month (default day).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "INBOUND or OUTBOUND.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "callSource",
            "in": "query",
            "required": false,
            "description": "CSV of call sources.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subgroupId",
            "in": "query",
            "required": false,
            "description": "Filter by subgroup.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Substring match against from/to E.164.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "carrier",
            "in": "query",
            "required": false,
            "description": "Filter by carrier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "dateFrom": {
                          "type": "string"
                        },
                        "dateTo": {
                          "type": "string"
                        },
                        "days": {
                          "type": "integer"
                        }
                      }
                    },
                    "outbound": {
                      "type": "object",
                      "properties": {
                        "totalCalls": {
                          "type": "integer"
                        },
                        "successfulCalls": {
                          "type": "integer"
                        },
                        "successRate": {
                          "type": "number"
                        },
                        "avgCallDurationSeconds": {
                          "type": "integer"
                        },
                        "totalCallMinutes": {
                          "type": "integer"
                        },
                        "answerRate": {
                          "type": "number"
                        },
                        "failedCalls": {
                          "type": "integer"
                        },
                        "sentimentScore": {
                          "type": "number"
                        },
                        "sentimentLabel": {
                          "type": "string"
                        }
                      }
                    },
                    "inbound": {
                      "type": "object",
                      "properties": {
                        "totalCalls": {
                          "type": "integer"
                        },
                        "successfulCalls": {
                          "type": "integer"
                        },
                        "successRate": {
                          "type": "integer"
                        },
                        "avgCallDurationSeconds": {
                          "type": "integer"
                        },
                        "totalCallMinutes": {
                          "type": "integer"
                        },
                        "answerRate": {
                          "type": "number"
                        },
                        "failedCalls": {
                          "type": "integer"
                        },
                        "sentimentScore": {
                          "type": "number"
                        },
                        "sentimentLabel": {
                          "type": "string"
                        }
                      }
                    },
                    "byDate": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "completed": {
                            "type": "integer"
                          },
                          "failed": {
                            "type": "integer"
                          },
                          "totalDurationSeconds": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byNumber": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "completed": {
                            "type": "integer"
                          },
                          "failed": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byCarrier": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "completed": {
                            "type": "integer"
                          },
                          "failed": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "byChannel": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "total": {
                            "type": "integer"
                          },
                          "completed": {
                            "type": "integer"
                          },
                          "failed": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "range": {
                    "dateFrom": "2026-07-01T00:00:00.000Z",
                    "dateTo": "2026-07-28T00:00:00.000Z",
                    "days": 27
                  },
                  "outbound": {
                    "totalCalls": 1240,
                    "successfulCalls": 1102,
                    "successRate": 88.9,
                    "avgCallDurationSeconds": 74,
                    "totalCallMinutes": 1528,
                    "answerRate": 71.2,
                    "failedCalls": 138,
                    "sentimentScore": 0.42,
                    "sentimentLabel": "positive"
                  },
                  "inbound": {
                    "totalCalls": 860,
                    "successfulCalls": 774,
                    "successRate": 90,
                    "avgCallDurationSeconds": 96,
                    "totalCallMinutes": 1376,
                    "answerRate": 82.5,
                    "failedCalls": 86,
                    "sentimentScore": 0.51,
                    "sentimentLabel": "positive"
                  },
                  "byDate": [
                    {
                      "key": "2026-07-01",
                      "total": 78,
                      "completed": 70,
                      "failed": 8,
                      "totalDurationSeconds": 5820
                    }
                  ],
                  "byNumber": [
                    {
                      "key": "+19153374770",
                      "total": 420,
                      "completed": 380,
                      "failed": 40
                    }
                  ],
                  "byCarrier": [
                    {
                      "key": "AT&T",
                      "total": 610,
                      "completed": 560,
                      "failed": 50
                    }
                  ],
                  "byChannel": [
                    {
                      "key": "SIP_TRUNK",
                      "total": 1500,
                      "completed": 1360,
                      "failed": 140
                    }
                  ]
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/tokens": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Mint an ephemeral voice token and one-time SIP credentials for the browser softphone (Device).",
        "description": "Mint an ephemeral voice token and one-time SIP credentials for the browser softphone (Device). All fields are optional. The returned identity is a server-generated SIP username; the identity you pass is stored as requested_identity so a server-side call can ring this endpoint via to_identity. The password is returned once only.",
        "operationId": "postVoiceTokens",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identity": {
                    "type": "string",
                    "description": "Logical name for this softphone (1-255 chars). Stored as requested_identity for inbound routing."
                  },
                  "ttl": {
                    "type": "number",
                    "description": "Token lifetime in seconds (min 60). Server-clamped to the account maximum."
                  },
                  "subgroupId": {
                    "type": "string",
                    "description": "Subgroup (1-64 chars) whose phone numbers should ring this softphone. REQUIRED to receive inbound calls — inbound DIDs fork only to live tokens carrying that DID's subgroupId. Optional for outbound-only softphones; a token minted without it registers and dials out fine but never receives inbound calls."
                  },
                  "grants": {
                    "type": "object",
                    "description": "Optional voice grants, e.g. { voice: { incoming: { allow }, outgoing: { allowedNumbers } } }."
                  }
                }
              },
              "example": {
                "identity": "alice",
                "ttl": 1800,
                "subgroupId": "S1A2B3C4"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "identity": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "sip_credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "wss_url": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "identity": "wrtc_9f3c1a2b",
                  "expires_at": "2026-07-28T18:30:00.000Z",
                  "sip_credentials": {
                    "username": "wrtc_9f3c1a2b",
                    "password": "s3cr3t-one-time-password",
                    "domain": "sip.signalhouse.io",
                    "wss_url": "wss://sip.signalhouse.io:7443"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/tokens/refresh": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Refresh (extend) an existing voice token in place — identity-preserving.",
        "description": "Refresh (extend) an existing voice token in place — identity-preserving. Keeps the same identity + SIP credentials and only pushes out expires_at, so a long-lived softphone stays registered without re-establishing its SIP registration (mirrors Twilio's Device.updateToken). Identify the session with the current token (its identity is decoded) or the identity directly. Returns 404 if no matching token exists for the account — mint a new one via POST /voice/tokens instead.",
        "operationId": "postVoiceTokensRefresh",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The current voice token (JWT); its grants.identity is extended. Provide this or identity."
                  },
                  "identity": {
                    "type": "string",
                    "description": "The wrtc_ identity to extend, if held directly (from the mint/refresh response). Provide this or token."
                  },
                  "ttl": {
                    "type": "number",
                    "description": "New token lifetime in seconds (min 60). Server-clamped to the account maximum."
                  }
                }
              },
              "example": {
                "identity": "wrtc_9f3c1a2b"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "identity": {
                      "type": "string"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "sip_credentials": {
                      "type": "object",
                      "properties": {
                        "username": {
                          "type": "string"
                        },
                        "password": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "wss_url": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                  "identity": "wrtc_9f3c1a2b",
                  "expires_at": "2026-07-28T19:00:00.000Z",
                  "sip_credentials": {
                    "username": "wrtc_9f3c1a2b",
                    "password": "s3cr3t-one-time-password",
                    "domain": "sip.signalhouse.io",
                    "wss_url": "wss://sip.signalhouse.io:7443"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/v1/calls": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Originate an outbound call.",
        "description": "Originate an outbound call. Provide to and from (an owned E.164 number). Omit trunk/profile/identity for a single-leg call, pass sip_trunk_id to route down a trunk, or pass sip_profile_id or to_identity to bridge to a SIP endpoint or a browser-registered identity.",
        "operationId": "postVoiceV1Calls",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "description": "Destination number (E.164) or SIP target."
                  },
                  "from": {
                    "type": "string",
                    "description": "Caller ID — must be an E.164 number you own."
                  },
                  "sip_trunk_id": {
                    "type": "string",
                    "description": "Route the call down this SIP trunk (UUID)."
                  },
                  "sip_profile_id": {
                    "type": "string",
                    "description": "Bridge to this SIP profile (UUID). Mutually exclusive with to_identity."
                  },
                  "to_identity": {
                    "type": "string",
                    "description": "Ring a browser-registered WebRTC identity (the logical name from tokens.create)."
                  },
                  "answer_url": {
                    "type": "string",
                    "description": "Programmable call control: on answer, the call is handed to your webhook, which returns SHML to control it. See Programmable Call Control (SHML) above. Must be a public http(s) address: a URL naming an internal or private host is refused with a 400."
                  },
                  "answer_method": {
                    "type": "string",
                    "description": "HTTP method used to fetch answer_url — GET or POST. Defaults to POST."
                  },
                  "recording_enabled": {
                    "type": "boolean",
                    "description": "Record the call. Defaults to false."
                  },
                  "transcription_enabled": {
                    "type": "boolean",
                    "description": "Transcribe the recording. Defaults to false."
                  },
                  "status_callback": {
                    "type": "string",
                    "description": "URL to receive call status webhooks. Must be a public http(s) address: a URL naming an internal or private host is refused with a 400."
                  },
                  "metadata": {
                    "type": "object",
                    "description": "Arbitrary key/value data echoed back on the call log."
                  }
                },
                "required": [
                  "to",
                  "from"
                ]
              },
              "example": {
                "to": "+15551234567",
                "from": "+19153374770",
                "recording_enabled": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "call_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "call_id": "8c1f2e34-9a0b-4c1d-8e2f-1a2b3c4d5e6f",
                  "status": "QUEUED",
                  "direction": "OUTBOUND",
                  "from": "+19153374770",
                  "to": "+15551234567",
                  "created_at": "2026-07-28T18:30:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      },
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "List calls with pagination and filtering.",
        "description": "List calls with pagination and filtering. This is a Twilio-compatible view of the call history.",
        "operationId": "getVoiceV1Calls",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page (1-100, default 20).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by call status (e.g. QUEUED, COMPLETED, FAILED).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "INBOUND or OUTBOUND.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Filter by originating number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Filter by destination number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from_date",
            "in": "query",
            "required": false,
            "description": "ISO date-time lower bound.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to_date",
            "in": "query",
            "required": false,
            "description": "ISO date-time upper bound.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "call_id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "direction": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "started_at": {
                            "type": "string"
                          },
                          "answered_at": {
                            "type": "string"
                          },
                          "ended_at": {
                            "type": "string"
                          },
                          "duration_seconds": {
                            "type": "integer"
                          },
                          "recording_available": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "call_id": "8c1f2e34-9a0b-4c1d-8e2f-1a2b3c4d5e6f",
                      "status": "COMPLETED",
                      "direction": "OUTBOUND",
                      "from": "+19153374770",
                      "to": "+15551234567",
                      "type": "SIP_TRUNK",
                      "started_at": "2026-07-28T18:30:01.000Z",
                      "answered_at": "2026-07-28T18:30:06.000Z",
                      "ended_at": "2026-07-28T18:31:12.000Z",
                      "duration_seconds": 66,
                      "recording_available": true
                    }
                  ],
                  "page": 1,
                  "limit": 20,
                  "total": 1
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/v1/calls/{call_id}": {
      "get": {
        "tags": [
          "Voice"
        ],
        "summary": "Retrieve a single call by its call_id.",
        "description": "Retrieve a single call by its call_id.",
        "operationId": "getVoiceV1CallsByCallId",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "description": "The call identifier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "call_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "direction": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "to": {
                      "type": "string"
                    },
                    "started_at": {
                      "type": "string"
                    },
                    "answered_at": {
                      "type": "string"
                    },
                    "ended_at": {
                      "type": "string"
                    },
                    "duration_seconds": {
                      "type": "integer"
                    },
                    "hangup_cause": {
                      "type": "string"
                    },
                    "recording_enabled": {
                      "type": "boolean"
                    },
                    "transcription_enabled": {
                      "type": "boolean"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                },
                "example": {
                  "call_id": "8c1f2e34-9a0b-4c1d-8e2f-1a2b3c4d5e6f",
                  "status": "COMPLETED",
                  "direction": "OUTBOUND",
                  "from": "+19153374770",
                  "to": "+15551234567",
                  "started_at": "2026-07-28T18:30:01.000Z",
                  "answered_at": "2026-07-28T18:30:06.000Z",
                  "ended_at": "2026-07-28T18:31:12.000Z",
                  "duration_seconds": 66,
                  "hangup_cause": "NORMAL",
                  "recording_enabled": true,
                  "transcription_enabled": false,
                  "metadata": {}
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/voice/v1/calls/{call_id}/hangup": {
      "post": {
        "tags": [
          "Voice"
        ],
        "summary": "Hang up an in-progress call.",
        "description": "Hang up an in-progress call.",
        "operationId": "postVoiceV1CallsByCallIdHangup",
        "parameters": [
          {
            "name": "call_id",
            "in": "path",
            "required": true,
            "description": "The call identifier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Hangup reason: NORMAL, BUSY, NO_ANSWER, or REJECTED."
                  }
                }
              },
              "example": {
                "reason": "NORMAL"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "call_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "call_id": "8c1f2e34-9a0b-4c1d-8e2f-1a2b3c4d5e6f",
                  "status": "COMPLETED",
                  "message": "Call hangup requested"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api",
          "billing",
          "user"
        ]
      }
    },
    "/webhook": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve configured webhook endpoints.",
        "description": "Retrieve configured webhook endpoints. Customer roles must pass at least one filter (id or groupId) — an unfiltered read-all is restricted to internal use.",
        "operationId": "webhook.readEndpoints",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Specific Webhook ObjectId.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "groupId",
            "in": "query",
            "required": false,
            "description": "Filter by Group ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpointType",
            "in": "query",
            "required": false,
            "description": "'Global', 'Number' or 'Agent'.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phoneNumber",
            "in": "query",
            "required": false,
            "description": "Filter by phone number (for Number type).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "required": false,
            "description": "Filter by RCS agent (for Agent type).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number for pagination.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results per page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "_id": {
                        "type": "string"
                      },
                      "groupId": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "endpointType": {
                        "type": "string"
                      },
                      "subscribedEvents": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "eventSettings": {
                        "type": "object",
                        "properties": {
                          "NUMBER_HEALTH_BELOW_THRESHOLD": {
                            "type": "object",
                            "properties": {
                              "threshold": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      },
                      "url": {
                        "type": "string"
                      },
                      "authType": {
                        "type": "string"
                      },
                      "hasSigningSecret": {
                        "type": "boolean"
                      },
                      "hasCredentials": {
                        "type": "boolean"
                      },
                      "previousSecretExpiresAt": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": [
                  {
                    "_id": "60f7b2a1c9e77c001a2b3c63",
                    "groupId": "G1234567",
                    "name": "Inbound Message Listener",
                    "endpointType": "Global",
                    "subscribedEvents": [
                      "MESSAGE_RECEIVED",
                      "MESSAGE_DELIVERED",
                      "NUMBER_HEALTH_BELOW_THRESHOLD"
                    ],
                    "eventSettings": {
                      "NUMBER_HEALTH_BELOW_THRESHOLD": {
                        "threshold": 6
                      }
                    },
                    "url": "https://your-server.com/api/webhooks/signalhouse",
                    "authType": "NONE",
                    "hasSigningSecret": true,
                    "hasCredentials": false,
                    "previousSecretExpiresAt": null,
                    "createdAt": "2024-01-15T12:00:00.000Z",
                    "updatedAt": "2024-01-15T12:00:00.000Z"
                  }
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Register a new webhook endpoint to receive real-time system events.",
        "description": "Register a new webhook endpoint to receive real-time system events. A signing secret is generated automatically and returned once, in this response, as signingSecret. Every delivery is signed with it (HMAC-SHA256); see the Webhook Signing guide. An OAuth connector token granted specific scopes also needs the messaging scope to subscribe to message events (SMS_*, MMS_*, MESSAGE_*, SUGGESTION_RESPONSE, P2P_INBOUND, USER_SUBSCRIBED or USER_UNSUBSCRIBED), and gets a 403 without it.",
        "operationId": "webhook.createEndpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "endpointType": {
                      "type": "string"
                    },
                    "subscribedEvents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eventSettings": {
                      "type": "object",
                      "properties": {
                        "NUMBER_HEALTH_BELOW_THRESHOLD": {
                          "type": "object",
                          "properties": {
                            "threshold": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "url": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "hasSigningSecret": {
                      "type": "boolean"
                    },
                    "hasCredentials": {
                      "type": "boolean"
                    },
                    "previousSecretExpiresAt": {},
                    "signingSecret": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c63",
                  "groupId": "G1234567",
                  "name": "Inbound Message Listener",
                  "endpointType": "Global",
                  "subscribedEvents": [
                    "MESSAGE_RECEIVED",
                    "MESSAGE_DELIVERED",
                    "NUMBER_HEALTH_BELOW_THRESHOLD"
                  ],
                  "eventSettings": {
                    "NUMBER_HEALTH_BELOW_THRESHOLD": {
                      "threshold": 6
                    }
                  },
                  "url": "https://your-server.com/api/webhooks/signalhouse",
                  "authType": "NONE",
                  "hasSigningSecret": true,
                  "hasCredentials": false,
                  "previousSecretExpiresAt": null,
                  "signingSecret": "a1b2c3d4e5f6...  (64 hex chars — plaintext, shown only this once)",
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/webhook/{id}": {
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update an existing webhook endpoint.",
        "description": "Update an existing webhook endpoint. An OAuth connector token granted specific scopes also needs the messaging scope to change subscribedEvents, url or secondaryUrl on an endpoint that ends up subscribed to message events, and gets a 403 without it.",
        "operationId": "webhook.updateEndpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook endpoint ObjectId."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEndpointRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "endpointType": {
                      "type": "string"
                    },
                    "subscribedEvents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "eventSettings": {
                      "type": "object",
                      "properties": {
                        "CAMPAIGN_HEALTH_BELOW_THRESHOLD": {
                          "type": "object",
                          "properties": {
                            "threshold": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    },
                    "url": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "hasSigningSecret": {
                      "type": "boolean"
                    },
                    "hasCredentials": {
                      "type": "boolean"
                    },
                    "previousSecretExpiresAt": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c63",
                  "groupId": "G1234567",
                  "name": "Updated Webhook Listener",
                  "endpointType": "Global",
                  "subscribedEvents": [
                    "MESSAGE_RECEIVED",
                    "MESSAGE_DELIVERED",
                    "MESSAGE_FAILED",
                    "CAMPAIGN_HEALTH_BELOW_THRESHOLD"
                  ],
                  "eventSettings": {
                    "CAMPAIGN_HEALTH_BELOW_THRESHOLD": {
                      "threshold": 5
                    }
                  },
                  "url": "https://your-server.com/api/webhooks/signalhouse",
                  "authType": "NONE",
                  "hasSigningSecret": true,
                  "hasCredentials": false,
                  "previousSecretExpiresAt": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-16T14:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a configured webhook endpoint.",
        "description": "Delete a configured webhook endpoint.",
        "operationId": "webhook.deleteEndpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook endpoint ObjectId."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "endpointType": {
                      "type": "string"
                    },
                    "subscribedEvents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "url": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "hasSigningSecret": {
                      "type": "boolean"
                    },
                    "hasCredentials": {
                      "type": "boolean"
                    },
                    "previousSecretExpiresAt": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c63",
                  "groupId": "G1234567",
                  "name": "Webhook Listener",
                  "endpointType": "Global",
                  "subscribedEvents": [
                    "MESSAGE_RECEIVED",
                    "MESSAGE_DELIVERED"
                  ],
                  "url": "https://your-server.com/api/webhooks/signalhouse",
                  "authType": "NONE",
                  "hasSigningSecret": true,
                  "hasCredentials": false,
                  "previousSecretExpiresAt": null,
                  "createdAt": "2024-01-15T12:00:00.000Z",
                  "updatedAt": "2024-01-15T12:00:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    },
    "/webhook/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Rotate the endpoint's signing secret, or give an endpoint created before signing existed its first one.",
        "description": "Rotate the endpoint's signing secret, or give an endpoint created before signing existed its first one. The new secret is returned in plaintext exactly once, in this response. The replaced secret keeps working until previousSecretExpiresAt: during that window X-SignalHouse-Signature stays on the previous secret (it switches when the window ends) and X-SignalHouse-Signature-V1 carries a signature for both, so you can switch your server over without dropping deliveries. Only one previous secret is kept: rotating again during a grace window retires the older one immediately. Not available to OAuth connector tokens.",
        "operationId": "webhook.rotateSigningSecret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook endpoint ObjectId."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateSigningSecretRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string"
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "endpointType": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "authType": {
                      "type": "string"
                    },
                    "hasSigningSecret": {
                      "type": "boolean"
                    },
                    "hasCredentials": {
                      "type": "boolean"
                    },
                    "previousSecretExpiresAt": {
                      "type": "string"
                    },
                    "signingSecret": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "_id": "60f7b2a1c9e77c001a2b3c63",
                  "groupId": "G1234567",
                  "name": "Webhook Listener",
                  "endpointType": "Global",
                  "url": "https://your-server.com/api/webhooks/signalhouse",
                  "authType": "NONE",
                  "hasSigningSecret": true,
                  "hasCredentials": false,
                  "previousSecretExpiresAt": "2024-01-17T14:00:00.000Z",
                  "signingSecret": "f6e5d4c3b2a1...  (64 hex chars — plaintext, shown only this once)"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-required-roles": [
          "admin",
          "developer",
          "api"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "AcceptUserTermsOfServiceRequest": {
        "type": "object",
        "properties": {
          "acceptedTermsOfService": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "acceptedTermsOfService"
        ]
      },
      "AddFundsToWalletRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "minimum": 10
          },
          "paymentMethodId": {
            "type": "string"
          }
        },
        "required": [
          "amount"
        ]
      },
      "AnswerRequirementRequest": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "fileIds": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^cf_[a-f0-9]{16}$"
            }
          }
        },
        "additionalProperties": false
      },
      "AppealDcaRejectionRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          }
        },
        "required": [
          "reason"
        ]
      },
      "AppendConversationMessageRequest": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant",
              "system",
              "tool"
            ]
          },
          "content": {
            "type": "string",
            "maxLength": 32000
          },
          "toolCalls": {
            "anyOf": [
              {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": {}
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "toolResults": {
            "anyOf": [
              {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": {}
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "ttfbMs": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 600000
              },
              {
                "type": "null"
              }
            ]
          },
          "latencyMs": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 600000
              },
              {
                "type": "null"
              }
            ]
          },
          "bargeInOccurred": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "role"
        ]
      },
      "ApproveAgentReplyDraftRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        },
        "additionalProperties": false
      },
      "AssignNumbersToCampaignRequest": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "minItems": 1,
            "maxItems": 5000,
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "phoneNumbers"
        ]
      },
      "AttachPaymentMethodRequest": {
        "type": "object",
        "properties": {
          "paymentMethodId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "paymentMethodId"
        ]
      },
      "AuthorizeConsentRequest": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "minLength": 1
          },
          "approved": {
            "type": "boolean"
          }
        },
        "required": [
          "approved",
          "request_id"
        ]
      },
      "CarrierIdLookupRequest": {
        "type": "object",
        "properties": {
          "phoneNumber": {}
        },
        "required": [
          "phoneNumber"
        ]
      },
      "CheckSimSwapRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 6,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 32,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "maxAge": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2400
          },
          "includeSwapDate": {}
        },
        "required": [
          "phoneNumber"
        ],
        "additionalProperties": false
      },
      "CompleteExternalAgentReplyDraftRequest": {
        "type": "object",
        "properties": {
          "claimId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "externalMessageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "claimId"
        ],
        "additionalProperties": false
      },
      "ConfirmOAuthLinkRequest": {
        "type": "object",
        "properties": {
          "pendingLink": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "pendingLink"
        ]
      },
      "ConfirmOAuthReauthRequest": {
        "type": "object",
        "properties": {
          "pendingReauth": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "reauthSecret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "pendingReauth",
          "reauthSecret"
        ]
      },
      "ConfirmTwoFactorEnrollmentRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 4,
            "maxLength": 20
          }
        },
        "required": [
          "code"
        ]
      },
      "ConfirmTwoFactorIdentityRequest": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "method": {
            "type": "string",
            "enum": [
              "app",
              "sms",
              "email"
            ]
          },
          "usingBackupCode": {
            "type": "boolean"
          }
        }
      },
      "ConnectOntraportRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "apiKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "appId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "required": [
          "apiKey",
          "appId",
          "groupId"
        ]
      },
      "CreateAgentProfileRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "subgroupId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8,
                "format": "starts_with",
                "pattern": "^S.*"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "systemPrompt": {
            "type": "string"
          },
          "greeting": {
            "type": "string"
          },
          "guardrails": {
            "type": "string"
          },
          "sendAuthority": {
            "type": "string",
            "enum": [
              "review",
              "autopilot"
            ]
          }
        },
        "required": [
          "groupId",
          "name"
        ],
        "additionalProperties": false
      },
      "CreateAgentToolRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "subgroupId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8,
                "format": "starts_with",
                "pattern": "^S.*"
              },
              {
                "type": "null"
              }
            ]
          },
          "agentProfileId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "type": {
            "type": "string",
            "enum": [
              "builtin",
              "webhook",
              "mcp"
            ]
          },
          "builtinKey": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "check_business_hours",
                  "knowledge_search",
                  "escalate_to_human",
                  "send_sms",
                  "handoff_to_agent"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "parametersSchema": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "webhookUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhookAuth": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[!#$%&'*+\\-.^_|~0-9A-Za-z]+$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "pattern": "^[^\\r\\n\\0]*$"
                    },
                    "description": "The API applies further cross-field rules that this schema does not express."
                  },
                  "signingSecret": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "mcpServerUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "voice",
                "webchat",
                "sms"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "groupId",
          "name",
          "description"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateEndpointRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "endpointType": {
            "type": "string",
            "enum": [
              "Global",
              "Number",
              "Agent"
            ]
          },
          "agentId": {
            "type": "string",
            "pattern": "^RCSA[0-9A-Z]{10}$"
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "BRAND_CREATION_FAILED",
                "BRAND_CREATION_SUCCESSFUL",
                "BRAND_DELETION_FAILED",
                "BRAND_DELETION_SUCCESSFUL",
                "BRAND_UPDATE_FAILED",
                "BRAND_UPDATE_SUCCESSFUL",
                "BRAND_REVET_FAILED",
                "BRAND_REVET_SUCCESSFUL",
                "BRAND_VETTING_REQUEST_CREATED",
                "BRAND_VETTING_REQUEST_FAILED",
                "BRAND_VETTING_REQUEST_UPDATED",
                "BRAND_IDENTITY_STATUS_UPDATED",
                "CAMPAIGN_APPROVED_BY_SIGNAL_HOUSE",
                "CAMPAIGN_REJECTED_BY_SIGNAL_HOUSE",
                "CAMPAIGN_CREATION_FAILED",
                "CAMPAIGN_UPDATE_FAILED",
                "CAMPAIGN_UPDATE_SUCCESSFUL",
                "CAMPAIGN_DELETION_FAILED",
                "CAMPAIGN_DELETION_SUCCESSFUL",
                "CAMPAIGN_RENEWAL_FAILED",
                "CAMPAIGN_RENEWAL_SUCCESSFUL",
                "CAMPAIGN_DCA_APPEAL_SUBMITTED",
                "CAMPAIGN_OPT_OUT_RATE_EXCEEDED",
                "CAMPAIGN_HEALTH_BELOW_THRESHOLD",
                "CAMPAIGN_SUSPENDED",
                "CAMPAIGN_UNSUSPENDED",
                "COMPLIANCE_CASE_UPDATED",
                "NUMBER_PURCHASE_FAILED",
                "NUMBER_PURCHASE_SUCCESSFUL",
                "NUMBER_ASSIGNMENT_FAILED",
                "NUMBER_ASSIGNMENT_SUCCESSFUL",
                "NUMBER_UNASSIGNMENT_FAILED",
                "NUMBER_UNASSIGNMENT_SUCCESSFUL",
                "NUMBER_DELETION_FAILED",
                "NUMBER_DELETION_SUCCESSFUL",
                "NUMBER_RENEWAL_FAILED",
                "NUMBER_RENEWAL_SUCCESSFUL",
                "NUMBER_MIGRATION_FAILED",
                "NUMBER_MIGRATION_SUCCESSFUL",
                "NUMBER_UPDATED",
                "NUMBER_HEALTH_BELOW_THRESHOLD",
                "SUBSCRIPTION_RENEWAL_FAILED",
                "SUBSCRIPTION_RENEWAL_SUCCESSFUL",
                "LOW_BALANCE_ALERT",
                "AUTO_RECHARGE_FAILED",
                "AUTO_RECHARGE_SUCCESSFUL",
                "SMS_SENT",
                "SMS_FAILED",
                "MMS_SENT",
                "MMS_FAILED",
                "MESSAGE_DELIVERED",
                "MESSAGE_FAILED",
                "MESSAGE_RECEIVED",
                "MESSAGE_QUEUED",
                "MESSAGE_SENT",
                "MESSAGE_READ",
                "MESSAGE_EXPIRED",
                "MESSAGE_BLOCKED",
                "MESSAGE_FALLBACK_TRIGGERED",
                "MESSAGE_FALLBACK_SENT",
                "MESSAGE_FALLBACK_DELIVERED",
                "SUGGESTION_RESPONSE",
                "USER_UNSUBSCRIBED",
                "USER_SUBSCRIBED",
                "P2P_SENT",
                "P2P_FAILED",
                "P2P_INBOUND",
                "TMOBILE_THROUGHPUT_75",
                "TMOBILE_THROUGHPUT_90",
                "TMOBILE_THROUGHPUT_100",
                "RCS_AGENT_STATUS_UPDATED",
                "RCS_AGENT_CARRIER_STATUS_UPDATED",
                "RCS_TESTER_STATUS_UPDATED",
                "AI_AGENT_CONVERSATION_ENDED"
              ]
            }
          },
          "eventSettings": {
            "type": "object",
            "properties": {
              "NUMBER_HEALTH_BELOW_THRESHOLD": {
                "type": "object",
                "properties": {
                  "threshold": {
                    "type": "number",
                    "minimum": 1.5,
                    "maximum": 10,
                    "multipleOf": 0.5
                  }
                },
                "required": [
                  "threshold"
                ],
                "additionalProperties": false
              },
              "CAMPAIGN_HEALTH_BELOW_THRESHOLD": {
                "type": "object",
                "properties": {
                  "threshold": {
                    "type": "number",
                    "minimum": 1.5,
                    "maximum": 10,
                    "multipleOf": 0.5
                  }
                },
                "required": [
                  "threshold"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "phoneNumber": {},
          "url": {
            "type": "string",
            "format": "uri"
          },
          "secondaryUrl": {
            "type": "string",
            "format": "uri"
          },
          "authType": {
            "default": "NONE",
            "type": "string",
            "enum": [
              "NONE",
              "BASIC",
              "API_KEY",
              "OAUTH2",
              "HMAC"
            ]
          },
          "apiHeaderPrefix": {
            "type": "string"
          },
          "credentials": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "secret": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        },
        "required": [
          "groupId",
          "name",
          "endpointType",
          "url"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateExternalLinkTokenRequest": {
        "type": "object",
        "properties": {
          "product": {
            "type": "string",
            "enum": [
              "ghl",
              "shopify"
            ]
          }
        },
        "required": [
          "product"
        ]
      },
      "CreateExternalVettingRequestRequest": {
        "type": "object",
        "properties": {
          "vettingProviderId": {
            "type": "string",
            "minLength": 1,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "vettingClass": {
            "type": "string",
            "minLength": 1,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "additionalData": {
            "type": "object",
            "properties": {}
          }
        },
        "required": [
          "vettingClass",
          "vettingProviderId"
        ],
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateKnowledgeItemRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "subgroupId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8,
                "format": "starts_with",
                "pattern": "^S.*"
              },
              {
                "type": "null"
              }
            ]
          },
          "agentProfileId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100000
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "url",
              "document",
              "import"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "groupId",
          "text"
        ],
        "additionalProperties": false
      },
      "CreateServiceUserRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "type": "string",
            "enum": [
              "api"
            ]
          },
          "groupId": {
            "type": "string",
            "minLength": 8,
            "maxLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "allowedIps": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          },
          "allowedCountries": {
            "maxItems": 250,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          },
          "allowedDestinationCountries": {
            "maxItems": 250,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          }
        },
        "required": [
          "name",
          "role"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateShortCodeBrandRequest": {
        "type": "object",
        "properties": {
          "subgroupId": {
            "type": "string",
            "minLength": 8,
            "maxLength": 8
          },
          "companyName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "street": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "state": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "postalCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "email": {
            "type": "string",
            "maxLength": 100,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "lastName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "website": {
            "type": "string",
            "maxLength": 255,
            "format": "uri"
          },
          "optInLink": {
            "type": "string",
            "maxLength": 255,
            "format": "uri"
          },
          "privacyPolicyLink": {
            "type": "string",
            "maxLength": 255,
            "format": "uri"
          },
          "termsAndConditionsLink": {
            "type": "string",
            "maxLength": 255,
            "format": "uri"
          },
          "complianceScanId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "shortCode": {
            "type": "object",
            "properties": {
              "businessRegistrationType": {
                "type": "string",
                "enum": [
                  "EIN",
                  "CBN",
                  "NEQ",
                  "PROVINCIAL_NUMBER",
                  "CRN",
                  "VAT",
                  "ACN",
                  "ABN",
                  "BRN",
                  "SIREN",
                  "SIRET",
                  "NZBN",
                  "UST_IDNR",
                  "CIF",
                  "NIF",
                  "CNPJ",
                  "UID",
                  "OTHER"
                ]
              },
              "legalEntityType": {
                "type": "string",
                "enum": [
                  "PRIVATE_COMPANY",
                  "PUBLIC_COMPANY",
                  "NON_PROFIT",
                  "GOVERNMENT",
                  "SOLE_PROPRIETOR"
                ]
              },
              "taxId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 50
              },
              "countryCode": {
                "type": "string",
                "minLength": 2,
                "maxLength": 2
              },
              "supportPhone": {
                "type": "string",
                "minLength": 1,
                "maxLength": 20
              }
            },
            "required": [
              "businessRegistrationType",
              "legalEntityType",
              "taxId",
              "countryCode",
              "supportPhone"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "subgroupId",
          "companyName",
          "displayName",
          "street",
          "city",
          "state",
          "postalCode",
          "country",
          "email",
          "firstName",
          "lastName",
          "website",
          "shortCode"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateSubgroupRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "subgroupName": {
            "type": "string",
            "minLength": 1
          },
          "contactFirstName": {
            "type": "string"
          },
          "contactLastName": {
            "type": "string"
          },
          "contactMiddleName": {
            "type": "string"
          },
          "subgroupCompanyName": {
            "type": "string"
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "carrierIdFamily": {
            "deprecated": true,
            "type": "string",
            "enum": [
              "Default",
              "ATT",
              "TMobile",
              "Verizon",
              "USCellular",
              "GoogleVoice",
              "ClearSky",
              "Interop"
            ]
          },
          "carrierIdRegion": {
            "deprecated": true,
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PRClaro",
                  "GuamDocomo",
                  "GuamGTA",
                  "GuamITE"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "groupId",
          "subgroupName"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "CreateUserRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "billing",
              "user"
            ]
          },
          "password": {
            "type": "string",
            "minLength": 8
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "profileImageLink": {
            "type": "string",
            "format": "uri"
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "signupSource": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "acceptedTermsOfService": {
            "type": "boolean"
          }
        },
        "required": [
          "groupId",
          "role",
          "password",
          "email"
        ],
        "additionalProperties": false
      },
      "DeleteNumbersRequest": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "minItems": 1,
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "string",
                  "description": "The API applies further cross-field rules that this schema does not express."
                },
                {}
              ]
            }
          }
        },
        "required": [
          "phoneNumbers"
        ]
      },
      "EndConversationRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "escalated",
              "abandoned"
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "FetchDeliveryReportsRequest": {
        "type": "object",
        "properties": {
          "messageIds": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "messageIds"
        ]
      },
      "ImportExternalVettingRequest": {
        "type": "object",
        "properties": {
          "vettingProviderId": {
            "type": "string",
            "minLength": 1,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "vettingId": {
            "type": "string",
            "minLength": 1
          },
          "vettingToken": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "vettingId",
          "vettingProviderId"
        ]
      },
      "LaunchRegistrationRequest": {
        "type": "object",
        "properties": {
          "acknowledgeFees": {
            "type": "boolean"
          },
          "acknowledgePhi": {
            "type": "boolean"
          }
        }
      },
      "LookupLocationsRequest": {
        "type": "object",
        "properties": {
          "entries": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "npa": {
                  "type": "string",
                  "pattern": "^\\d{1,3}$"
                },
                "nxx": {
                  "type": "string",
                  "pattern": "^\\d{1,3}$"
                }
              },
              "required": [
                "npa",
                "nxx"
              ]
            }
          }
        },
        "required": [
          "entries"
        ]
      },
      "MigrateNumberTov2Request": {
        "type": "object",
        "properties": {
          "phoneNumber": {},
          "campaignId": {
            "type": "string",
            "minLength": 7
          },
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          }
        },
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "OntraportGroupRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          }
        },
        "required": [
          "groupId"
        ]
      },
      "PauseAgentConversationRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "human_reply",
              "manual"
            ]
          }
        },
        "additionalProperties": false
      },
      "PurchaseNumbersRequest": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "minItems": 1,
            "type": "array",
            "items": {}
          },
          "subgroupId": {
            "type": "string",
            "minLength": 8
          },
          "country": {}
        },
        "required": [
          "phoneNumbers",
          "subgroupId"
        ]
      },
      "PurchaseTollFreeNumbersRequest": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10
          },
          "subgroupId": {
            "type": "string",
            "minLength": 8
          },
          "country": {}
        },
        "required": [
          "quantity",
          "subgroupId"
        ]
      },
      "RcsCapabilitiesRequest": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(?:[A-Z]{2}[0-9A-Z]{10}|RCSA[0-9A-Z]{10}|REG[A-Z0-9]+)$"
          },
          "phoneNumbers": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\+?\\d{10,15}$"
            }
          }
        },
        "required": [
          "agentId",
          "phoneNumbers"
        ],
        "additionalProperties": false
      },
      "ReadOAuthTicketRequest": {
        "type": "object",
        "properties": {
          "ticket": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "ticket"
        ]
      },
      "RegisterClientRequest": {
        "type": "object",
        "properties": {
          "client_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "redirect_uris": {
            "minItems": 1,
            "maxItems": 10,
            "type": "array",
            "items": {}
          },
          "grant_types": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "authorization_code",
                "refresh_token"
              ]
            }
          },
          "response_types": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          "token_endpoint_auth_method": {
            "type": "string",
            "const": "none"
          },
          "software_id": {
            "type": "string",
            "maxLength": 200
          },
          "scope": {
            "type": "string",
            "maxLength": 500
          }
        },
        "required": [
          "client_name",
          "redirect_uris"
        ]
      },
      "ReleaseExternalAgentReplyDraftRequest": {
        "type": "object",
        "properties": {
          "claimId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "permanent": {
            "type": "boolean"
          }
        },
        "required": [
          "claimId"
        ],
        "additionalProperties": false
      },
      "RequestCarrierUpdateRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "RequestPasswordResetRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ]
      },
      "ResetPasswordRequest": {
        "type": "object",
        "properties": {
          "newPassword": {
            "type": "string",
            "minLength": 8
          }
        },
        "required": [
          "newPassword"
        ]
      },
      "ResetPasswordWithTokenRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 1
          },
          "password": {
            "type": "string",
            "minLength": 8
          }
        },
        "required": [
          "password",
          "token"
        ]
      },
      "RotateSigningSecretRequest": {
        "type": "object",
        "properties": {
          "graceSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 604800
          }
        }
      },
      "SaveSsoConnectionRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "issuer": {
            "type": "string",
            "maxLength": 500,
            "format": "uri"
          },
          "clientId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "clientSecret": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "clientId",
          "groupId",
          "issuer"
        ]
      },
      "SendP2PRequest": {
        "type": "object",
        "properties": {
          "recipientPhoneNumber": {
            "minItems": 1,
            "type": "array",
            "items": {}
          },
          "messageBody": {
            "type": "string",
            "minLength": 1
          },
          "statusCallbackUrl": {},
          "groupId": {
            "type": "string",
            "minLength": 7
          },
          "subgroupId": {
            "type": "string",
            "minLength": 8
          },
          "useSignalHouseShortlinks": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "recipientPhoneNumber",
          "messageBody"
        ],
        "additionalProperties": false
      },
      "SendSMSRequest": {
        "type": "object",
        "properties": {
          "senderPhoneNumber": {},
          "recipientPhoneNumber": {
            "minItems": 1,
            "type": "array",
            "items": {}
          },
          "messageBody": {
            "type": "string",
            "minLength": 1
          },
          "statusCallbackUrl": {
            "type": "string",
            "format": "uri"
          },
          "enableShortlink": {
            "default": false,
            "type": "boolean"
          },
          "filterLandlinesAndInactiveNumbers": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "senderPhoneNumber",
          "recipientPhoneNumber",
          "messageBody"
        ],
        "additionalProperties": false
      },
      "SendTwoFactorChallengeCodeRequest": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "app",
              "sms",
              "email"
            ]
          }
        },
        "required": [
          "method"
        ]
      },
      "SetBrandCnamRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 15
          }
        },
        "required": [
          "name"
        ]
      },
      "SetNumberCnamRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 15
          },
          "brandId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "name"
        ]
      },
      "SimulateRcsInboundRequest": {
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string",
            "maxLength": 80,
            "pattern": "^(?:[A-Z]{2}[0-9A-Z]{10}|RCSA[0-9A-Z]{10}|REG[A-Z0-9]+)$"
          },
          "from": {
            "type": "string",
            "pattern": "^\\+?\\d{10,15}$"
          },
          "type": {
            "type": "string",
            "enum": [
              "TEXT",
              "SUGGESTION",
              "LOCATION",
              "FILE",
              "UNSUBSCRIBE"
            ]
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 3072
          },
          "postbackData": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "messageId": {
            "type": "string",
            "pattern": "^[0-9a-f]{24}$"
          },
          "buttonId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "latitude": {
            "type": "number",
            "minimum": -90,
            "maximum": 90
          },
          "longitude": {
            "type": "number",
            "minimum": -180,
            "maximum": 180
          },
          "fileName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "agentId",
          "from",
          "type"
        ],
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "SsoDomainRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 8,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "domain": {
            "type": "string",
            "maxLength": 253,
            "pattern": "^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
          }
        },
        "required": [
          "domain",
          "groupId"
        ]
      },
      "StartConversationRequest": {
        "type": "object",
        "properties": {
          "agentProfileId": {
            "type": "string",
            "minLength": 8
          },
          "channel": {
            "type": "string",
            "enum": [
              "voice",
              "webchat",
              "sms"
            ]
          },
          "contactIdentifier": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ]
          },
          "callId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "agentProfileId",
          "channel"
        ]
      },
      "StartNumberVerificationRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "minLength": 6,
            "format": "starts_with",
            "pattern": "^G.*"
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 32,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "devicePhoneNumber": {
            "type": "string",
            "maxLength": 32,
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "redirectUrl": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri"
          }
        },
        "required": [
          "phoneNumber"
        ],
        "additionalProperties": false
      },
      "StartTwoFactorEnrollmentRequest": {
        "type": "object",
        "properties": {
          "method": {
            "type": "string",
            "enum": [
              "app",
              "sms",
              "email"
            ]
          },
          "phone": {
            "type": "string",
            "maxLength": 30
          },
          "address": {
            "type": "string",
            "maxLength": 254
          },
          "deviceName": {
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "method"
        ]
      },
      "TokenRequestRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "grant_type": {
                "type": "string",
                "const": "authorization_code"
              },
              "code": {
                "type": "string",
                "minLength": 1
              },
              "redirect_uri": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "description": "The API applies further cross-field rules that this schema does not express."
              },
              "client_id": {
                "type": "string",
                "minLength": 1
              },
              "code_verifier": {
                "type": "string",
                "minLength": 43,
                "maxLength": 128,
                "pattern": "^[A-Za-z0-9\\-._~]+$"
              }
            },
            "required": [
              "grant_type",
              "code",
              "redirect_uri",
              "client_id",
              "code_verifier"
            ]
          },
          {
            "type": "object",
            "properties": {
              "grant_type": {
                "type": "string",
                "const": "refresh_token"
              },
              "refresh_token": {
                "type": "string",
                "minLength": 1
              },
              "client_id": {
                "type": "string",
                "minLength": 1
              },
              "scope": {
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "grant_type",
              "refresh_token",
              "client_id"
            ]
          }
        ]
      },
      "TransferBrandsRequest": {
        "type": "object",
        "properties": {
          "brandIds": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 7
            }
          }
        },
        "required": [
          "brandIds"
        ]
      },
      "TransferUnassignedNumbersRequest": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "minItems": 1,
            "type": "array",
            "items": {}
          },
          "newSubgroupId": {
            "type": "string",
            "minLength": 8
          }
        },
        "required": [
          "newSubgroupId",
          "phoneNumbers"
        ]
      },
      "UnassignNumbersFromCampaignRequest": {
        "type": "object",
        "properties": {
          "phoneNumbers": {
            "minItems": 1,
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "phoneNumbers"
        ]
      },
      "UpdateAgentProfileRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "systemPrompt": {
            "type": "string"
          },
          "greeting": {
            "type": "string"
          },
          "guardrails": {
            "type": "string"
          },
          "sendAuthority": {
            "type": "string",
            "enum": [
              "review",
              "autopilot"
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateAgentToolRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "type": {
            "type": "string",
            "enum": [
              "builtin",
              "webhook",
              "mcp"
            ]
          },
          "builtinKey": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "check_business_hours",
                  "knowledge_search",
                  "escalate_to_human",
                  "send_sms",
                  "handoff_to_agent"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "parametersSchema": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          },
          "webhookUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "webhookAuth": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[!#$%&'*+\\-.^_|~0-9A-Za-z]+$"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "pattern": "^[^\\r\\n\\0]*$"
                    },
                    "description": "The API applies further cross-field rules that this schema does not express."
                  },
                  "signingSecret": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "mcpServerUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "voice",
                "webchat",
                "sms"
              ]
            }
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpdateCampaignRequest": {
        "type": "object",
        "properties": {
          "usecase": {
            "type": "string",
            "enum": [
              "2FA",
              "ACCOUNT_NOTIFICATION",
              "AGENTS_FRANCHISES",
              "CARRIER_EXEMPT",
              "CHARITY",
              "CUSTOMER_CARE",
              "DELIVERY_NOTIFICATION",
              "EMERGENCY",
              "FRAUD_ALERT",
              "HIGHER_EDUCATION",
              "K12_EDUCATION",
              "LOW_VOLUME",
              "M2M",
              "MARKETING",
              "MIXED",
              "POLITICAL",
              "POLLING_VOTING",
              "PROXY",
              "PUBLIC_SAFETY_RESTRICTED",
              "PUBLIC_SERVICE_ANNOUNCEMENT",
              "SECURITY_ALERT",
              "SOCIAL",
              "SOLE_PROPRIETOR",
              "SWEEPSTAKE",
              "TRIAL",
              "UCAAS_HIGH",
              "UCAAS_LOW"
            ]
          },
          "subUsecases": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "2FA",
                "ACCOUNT_NOTIFICATION",
                "AGENTS_FRANCHISES",
                "CARRIER_EXEMPT",
                "CHARITY",
                "CUSTOMER_CARE",
                "DELIVERY_NOTIFICATION",
                "EMERGENCY",
                "FRAUD_ALERT",
                "HIGHER_EDUCATION",
                "K12_EDUCATION",
                "LOW_VOLUME",
                "M2M",
                "MARKETING",
                "MIXED",
                "POLITICAL",
                "POLLING_VOTING",
                "PROXY",
                "PUBLIC_SAFETY_RESTRICTED",
                "PUBLIC_SERVICE_ANNOUNCEMENT",
                "SECURITY_ALERT",
                "SOLE_PROPRIETOR",
                "SWEEPSTAKE",
                "TRIAL",
                "UCAAS_HIGH",
                "UCAAS_LOW"
              ]
            }
          },
          "description": {
            "type": "string",
            "minLength": 40,
            "maxLength": 4096
          },
          "embeddedLink": {
            "type": "boolean"
          },
          "embeddedPhone": {
            "type": "boolean"
          },
          "termsAndConditions": {
            "type": "boolean"
          },
          "numberPool": {
            "type": "boolean"
          },
          "ageGated": {
            "type": "boolean"
          },
          "directLending": {
            "type": "boolean"
          },
          "subscriberOptIn": {
            "type": "boolean"
          },
          "subscriberOptOut": {
            "type": "boolean"
          },
          "subscriberHelp": {
            "type": "boolean"
          },
          "sample1": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "sample2": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "sample3": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "sample4": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "sample5": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "messageFlow": {
            "type": "string",
            "minLength": 40,
            "maxLength": 4096
          },
          "helpMessage": {
            "type": "string"
          },
          "autoRenewal": {
            "type": "boolean"
          },
          "tag": {
            "type": "string",
            "maxLength": 255
          },
          "optinKeywords": {
            "type": "string",
            "maxLength": 255
          },
          "optoutKeywords": {
            "type": "string",
            "maxLength": 255
          },
          "helpKeywords": {
            "type": "string",
            "maxLength": 255
          },
          "optinMessage": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "optoutMessage": {
            "type": "string",
            "minLength": 20,
            "maxLength": 1024
          },
          "privacyPolicyLink": {
            "type": "string",
            "maxLength": 2048
          },
          "termsAndConditionsLink": {
            "type": "string",
            "maxLength": 2048
          },
          "embeddedLinkSample": {
            "type": "string",
            "maxLength": 255
          },
          "sampleMediaIds": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "tollFree": {
            "type": "object",
            "properties": {
              "useCase": {
                "type": "string",
                "enum": [
                  "TWO_FA",
                  "APP_NOTIFICATIONS",
                  "APPOINTMENTS",
                  "AUCTIONS",
                  "AUTO_DEALERSHIP_SERVICES",
                  "BANKING",
                  "BILLING",
                  "BOOKING_CONFIRMATIONS",
                  "BUSINESS_UPDATES",
                  "COVID_19_ALERTS",
                  "CAREER_TRAINING",
                  "CHATBOT",
                  "CONVERSATIONAL_ALERTS",
                  "COURIER_SERVICES_DELIVERIES",
                  "EDUCATIONAL",
                  "EMERGENCY_ALERTS",
                  "EMPLOYEE_ALERTS_NOTIFICATIONS",
                  "EVENTS_PLANNING",
                  "FINANCIAL_SERVICES",
                  "FRAUD_ALERTS",
                  "FUNDRAISING",
                  "GENERAL_MARKETING",
                  "HR_STAFFING",
                  "HEALTHCARE",
                  "HOUSING_COMMUNITY_UPDATES",
                  "INSURANCE_SERVICES",
                  "JOB_ALERTS",
                  "LEGAL_SERVICES",
                  "MIXED",
                  "MOTIVATIONAL_REMINDERS",
                  "NOTARY_NOTIFICATIONS",
                  "NOTIFICATIONS",
                  "ORDER_NOTIFICATIONS",
                  "POLITICAL",
                  "PUBLIC_WORKS",
                  "REAL_ESTATE_SERVICES",
                  "RECEIPT_NOTIFICATIONS",
                  "RELIGIOUS_SERVICES",
                  "REPAIR_DIAGNOSTICS_ALERTS",
                  "REWARDS_PROGRAM",
                  "SURVEYS",
                  "SYSTEM_ALERTS",
                  "WAITLIST_ALERTS",
                  "WEBINAR_REMINDERS",
                  "WORKSHOP_ALERTS"
                ]
              },
              "messageVolume": {
                "type": "string",
                "enum": [
                  "TEN",
                  "HUNDRED",
                  "THOUSAND",
                  "TEN_THOUSAND",
                  "HUNDRED_THOUSAND",
                  "TWO_HUNDRED_FIFTY_THOUSAND",
                  "FIVE_HUNDRED_THOUSAND",
                  "SEVEN_HUNDRED_FIFTY_THOUSAND",
                  "ONE_MILLION",
                  "FIVE_MILLION",
                  "TEN_MILLION_PLUS"
                ]
              },
              "programSummary": {
                "type": "string",
                "minLength": 40,
                "maxLength": 500
              },
              "exampleMessage": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              },
              "customerCareEmail": {
                "type": "string",
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              "optInImageURLs": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 2048
                }
              },
              "optIns": {
                "type": "object",
                "properties": {
                  "verbal": {
                    "type": "object",
                    "properties": {
                      "callToAction": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20,
                            "maxLength": 1024
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "web": {
                    "type": "object",
                    "properties": {
                      "callToAction": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20,
                            "maxLength": 1024
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "url": {
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 2048
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  },
                  "keyword": {
                    "type": "object",
                    "properties": {
                      "callToAction": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20,
                            "maxLength": 1024
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "keywords": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "interactiveVoiceResponse": {
                    "type": "object",
                    "properties": {
                      "callToAction": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 20,
                            "maxLength": 1024
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "multiNumberReason": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 500
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "useCases": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "TWO_FA",
                    "APP_NOTIFICATIONS",
                    "APPOINTMENTS",
                    "AUCTIONS",
                    "AUTO_DEALERSHIP_SERVICES",
                    "BANKING",
                    "BILLING",
                    "BOOKING_CONFIRMATIONS",
                    "BUSINESS_UPDATES",
                    "COVID_19_ALERTS",
                    "CAREER_TRAINING",
                    "CHATBOT",
                    "CONVERSATIONAL_ALERTS",
                    "COURIER_SERVICES_DELIVERIES",
                    "EDUCATIONAL",
                    "EMERGENCY_ALERTS",
                    "EMPLOYEE_ALERTS_NOTIFICATIONS",
                    "EVENTS_PLANNING",
                    "FINANCIAL_SERVICES",
                    "FRAUD_ALERTS",
                    "FUNDRAISING",
                    "GENERAL_MARKETING",
                    "HR_STAFFING",
                    "HEALTHCARE",
                    "HOUSING_COMMUNITY_UPDATES",
                    "INSURANCE_SERVICES",
                    "JOB_ALERTS",
                    "LEGAL_SERVICES",
                    "MIXED",
                    "MOTIVATIONAL_REMINDERS",
                    "NOTARY_NOTIFICATIONS",
                    "NOTIFICATIONS",
                    "ORDER_NOTIFICATIONS",
                    "POLITICAL",
                    "PUBLIC_WORKS",
                    "REAL_ESTATE_SERVICES",
                    "RECEIPT_NOTIFICATIONS",
                    "RELIGIOUS_SERVICES",
                    "REPAIR_DIAGNOSTICS_ALERTS",
                    "REWARDS_PROGRAM",
                    "SURVEYS",
                    "SYSTEM_ALERTS",
                    "WAITLIST_ALERTS",
                    "WEBINAR_REMINDERS",
                    "WORKSHOP_ALERTS"
                  ]
                }
              },
              "channels": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "SMS",
                    "MMS",
                    "VOICE"
                  ]
                }
              },
              "landingId": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 64
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpdateEndpointRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "subscribedEvents": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "BRAND_CREATION_FAILED",
                "BRAND_CREATION_SUCCESSFUL",
                "BRAND_DELETION_FAILED",
                "BRAND_DELETION_SUCCESSFUL",
                "BRAND_UPDATE_FAILED",
                "BRAND_UPDATE_SUCCESSFUL",
                "BRAND_REVET_FAILED",
                "BRAND_REVET_SUCCESSFUL",
                "BRAND_VETTING_REQUEST_CREATED",
                "BRAND_VETTING_REQUEST_FAILED",
                "BRAND_VETTING_REQUEST_UPDATED",
                "BRAND_IDENTITY_STATUS_UPDATED",
                "CAMPAIGN_APPROVED_BY_SIGNAL_HOUSE",
                "CAMPAIGN_REJECTED_BY_SIGNAL_HOUSE",
                "CAMPAIGN_CREATION_FAILED",
                "CAMPAIGN_UPDATE_FAILED",
                "CAMPAIGN_UPDATE_SUCCESSFUL",
                "CAMPAIGN_DELETION_FAILED",
                "CAMPAIGN_DELETION_SUCCESSFUL",
                "CAMPAIGN_RENEWAL_FAILED",
                "CAMPAIGN_RENEWAL_SUCCESSFUL",
                "CAMPAIGN_DCA_APPEAL_SUBMITTED",
                "CAMPAIGN_OPT_OUT_RATE_EXCEEDED",
                "CAMPAIGN_HEALTH_BELOW_THRESHOLD",
                "CAMPAIGN_SUSPENDED",
                "CAMPAIGN_UNSUSPENDED",
                "COMPLIANCE_CASE_UPDATED",
                "NUMBER_PURCHASE_FAILED",
                "NUMBER_PURCHASE_SUCCESSFUL",
                "NUMBER_ASSIGNMENT_FAILED",
                "NUMBER_ASSIGNMENT_SUCCESSFUL",
                "NUMBER_UNASSIGNMENT_FAILED",
                "NUMBER_UNASSIGNMENT_SUCCESSFUL",
                "NUMBER_DELETION_FAILED",
                "NUMBER_DELETION_SUCCESSFUL",
                "NUMBER_RENEWAL_FAILED",
                "NUMBER_RENEWAL_SUCCESSFUL",
                "NUMBER_MIGRATION_FAILED",
                "NUMBER_MIGRATION_SUCCESSFUL",
                "NUMBER_UPDATED",
                "NUMBER_HEALTH_BELOW_THRESHOLD",
                "SUBSCRIPTION_RENEWAL_FAILED",
                "SUBSCRIPTION_RENEWAL_SUCCESSFUL",
                "LOW_BALANCE_ALERT",
                "AUTO_RECHARGE_FAILED",
                "AUTO_RECHARGE_SUCCESSFUL",
                "SMS_SENT",
                "SMS_FAILED",
                "MMS_SENT",
                "MMS_FAILED",
                "MESSAGE_DELIVERED",
                "MESSAGE_FAILED",
                "MESSAGE_RECEIVED",
                "MESSAGE_QUEUED",
                "MESSAGE_SENT",
                "MESSAGE_READ",
                "MESSAGE_EXPIRED",
                "MESSAGE_BLOCKED",
                "MESSAGE_FALLBACK_TRIGGERED",
                "MESSAGE_FALLBACK_SENT",
                "MESSAGE_FALLBACK_DELIVERED",
                "SUGGESTION_RESPONSE",
                "USER_UNSUBSCRIBED",
                "USER_SUBSCRIBED",
                "P2P_SENT",
                "P2P_FAILED",
                "P2P_INBOUND",
                "TMOBILE_THROUGHPUT_75",
                "TMOBILE_THROUGHPUT_90",
                "TMOBILE_THROUGHPUT_100",
                "RCS_AGENT_STATUS_UPDATED",
                "RCS_AGENT_CARRIER_STATUS_UPDATED",
                "RCS_TESTER_STATUS_UPDATED",
                "AI_AGENT_CONVERSATION_ENDED"
              ]
            }
          },
          "eventSettings": {
            "type": "object",
            "properties": {
              "NUMBER_HEALTH_BELOW_THRESHOLD": {
                "type": "object",
                "properties": {
                  "threshold": {
                    "type": "number",
                    "minimum": 1.5,
                    "maximum": 10,
                    "multipleOf": 0.5
                  }
                },
                "required": [
                  "threshold"
                ],
                "additionalProperties": false
              },
              "CAMPAIGN_HEALTH_BELOW_THRESHOLD": {
                "type": "object",
                "properties": {
                  "threshold": {
                    "type": "number",
                    "minimum": 1.5,
                    "maximum": 10,
                    "multipleOf": 0.5
                  }
                },
                "required": [
                  "threshold"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "secondaryUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "authType": {
            "type": "string",
            "enum": [
              "NONE",
              "BASIC",
              "API_KEY",
              "OAUTH2",
              "HMAC"
            ]
          },
          "apiHeaderPrefix": {
            "type": "string"
          },
          "credentials": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1
              },
              "secret": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpdateGroupRequest": {
        "type": "object",
        "properties": {
          "groupName": {
            "type": "string",
            "minLength": 1
          },
          "contactFirstName": {
            "type": "string"
          },
          "contactLastName": {
            "type": "string"
          },
          "contactMiddleName": {
            "type": "string"
          },
          "groupCompanyName": {
            "type": "string"
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "cspId": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultCnpSubgroupId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "customerType": {
            "type": "string",
            "enum": [
              "standard",
              "p2p"
            ]
          },
          "requireTwoFactor": {
            "type": "boolean"
          },
          "featureFlags": {
            "type": "object",
            "properties": {
              "tmtIntegration": {
                "type": "boolean"
              },
              "netPricing": {
                "type": "boolean"
              },
              "p2pEnabled": {
                "type": "boolean"
              },
              "tollFreeEnabled": {
                "type": "boolean"
              },
              "shortCodeEnabled": {
                "type": "boolean"
              },
              "p2pShortlinksDisabled": {
                "type": "boolean"
              },
              "sentimentDisabled": {
                "type": "boolean"
              },
              "rcsEnabled": {
                "type": "boolean"
              },
              "ontraportIntegration": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "UpdateKnowledgeItemRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100000
          },
          "source": {
            "type": "string",
            "enum": [
              "manual",
              "url",
              "document",
              "import"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "type": "object",
                "properties": {},
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateNotificationPreferencesRequest": {
        "type": "object",
        "properties": {
          "notificationPreferences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "web": {
                  "type": "boolean"
                },
                "email": {
                  "type": "boolean"
                }
              },
              "required": [
                "name",
                "web",
                "email"
              ]
            },
            "description": "The API applies further cross-field rules that this schema does not express."
          }
        },
        "required": [
          "notificationPreferences"
        ]
      },
      "UpdateNumberRequest": {
        "type": "object",
        "properties": {
          "friendlyName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "primaryInboundWebhookUrl": {},
          "secondaryInboundWebhookUrl": {}
        },
        "additionalProperties": false
      },
      "UpdateSubgroupRequest": {
        "type": "object",
        "properties": {
          "subgroupName": {
            "type": "string",
            "minLength": 1
          },
          "contactFirstName": {
            "type": "string"
          },
          "contactLastName": {
            "type": "string"
          },
          "contactMiddleName": {
            "type": "string"
          },
          "subgroupCompanyName": {
            "type": "string"
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "carrierIdFamily": {
            "deprecated": true,
            "type": "string",
            "enum": [
              "Default",
              "ATT",
              "TMobile",
              "Verizon",
              "USCellular",
              "GoogleVoice",
              "ClearSky",
              "Interop"
            ]
          },
          "carrierIdRegion": {
            "deprecated": true,
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PRClaro",
                  "GuamDocomo",
                  "GuamGTA",
                  "GuamITE"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "cnamAutoApply": {
            "type": "boolean"
          },
          "cnamBrandId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpdateUserRequest": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "billing",
              "user"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive"
            ]
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "profileImageLink": {
            "type": "string",
            "format": "uri"
          },
          "addressLine1": {
            "type": "string"
          },
          "addressLine2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "timezone": {
            "type": "string",
            "description": "The API applies further cross-field rules that this schema does not express."
          },
          "allowedIps": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          },
          "allowedCountries": {
            "maxItems": 250,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          },
          "allowedDestinationCountries": {
            "maxItems": 250,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Z]{2}$",
              "description": "The API applies further cross-field rules that this schema does not express."
            }
          }
        },
        "additionalProperties": false
      },
      "UpdateWalletRequest": {
        "type": "object",
        "properties": {
          "autoRechargeEnabled": {
            "type": "boolean"
          },
          "autoRechargeThreshold": {
            "type": "number",
            "minimum": 30000000
          },
          "autoRechargeToAmount": {
            "type": "number",
            "minimum": 100000000
          },
          "primaryPaymentMethodId": {
            "type": [
              "string",
              "null"
            ]
          },
          "secondaryPaymentMethodId": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpsertAgentChannelSettingRequest": {
        "type": "object",
        "properties": {
          "allowedTools": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "channelPrompt": {
            "type": "string"
          },
          "greeting": {
            "type": [
              "string",
              "null"
            ]
          },
          "llmProvider": {
            "type": "string",
            "enum": [
              "bedrock",
              "openai",
              "anthropic",
              "groq"
            ]
          },
          "llmModel": {
            "type": [
              "string",
              "null"
            ]
          },
          "temperature": {
            "type": "number",
            "minimum": 0,
            "maximum": 2
          },
          "voiceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "speed": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.7,
                "maximum": 1.2
              },
              {
                "type": "null"
              }
            ]
          },
          "stability": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "similarityBoost": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "speechModel": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "eleven_v3_conversational",
                  "eleven_v4_turbo",
                  "eleven_v4",
                  "eleven_flash_v2",
                  "eleven_turbo_v2",
                  "eleven_multilingual_v2"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "turnEagerness": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "patient",
                  "normal",
                  "eager"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "turnTimeoutSeconds": {
            "anyOf": [
              {
                "type": "number",
                "description": "The API applies further cross-field rules that this schema does not express."
              },
              {
                "type": "null"
              }
            ]
          },
          "initialWaitSeconds": {
            "anyOf": [
              {
                "type": "number",
                "description": "The API applies further cross-field rules that this schema does not express."
              },
              {
                "type": "null"
              }
            ]
          },
          "silenceEndCallSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 10,
                "maximum": 7200
              },
              {
                "type": "null"
              }
            ]
          },
          "maxCallDurationSeconds": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 60,
                "maximum": 7200
              },
              {
                "type": "null"
              }
            ]
          },
          "allowGreetingInterruption": {
            "type": "boolean"
          },
          "keyterms": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "allowedCommitments": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "confirm_booking",
                    "call_back",
                    "text_back",
                    "follow_up",
                    "hold_slot",
                    "send_reminder"
                  ]
                },
                "detail": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 200
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "backgroundSound": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "preset": {
                    "type": "string",
                    "enum": [
                      "office1",
                      "office2",
                      "restaurant",
                      "city",
                      "typing",
                      "elevator1",
                      "elevator2",
                      "elevator3",
                      "elevator4"
                    ]
                  },
                  "volume": {
                    "type": "number",
                    "minimum": 0.01,
                    "maximum": 1
                  }
                },
                "required": [
                  "preset"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "workflow": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "nodes": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "minLength": 1
                        },
                        "position": {
                          "type": "object",
                          "properties": {
                            "x": {
                              "type": "number"
                            },
                            "y": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "x",
                            "y"
                          ],
                          "additionalProperties": {}
                        },
                        "edge_order": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "type",
                        "position"
                      ],
                      "additionalProperties": {}
                    }
                  },
                  "edges": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "minLength": 1
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "source",
                        "target"
                      ],
                      "additionalProperties": {}
                    }
                  },
                  "subgraphs": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  },
                  "prevent_subagent_loops": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "nodes",
                  "edges"
                ],
                "additionalProperties": {},
                "description": "The API applies further cross-field rules that this schema does not express."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "description": "The API applies further cross-field rules that this schema does not express."
      },
      "UpsertAgentDeploymentRequest": {
        "type": "object",
        "properties": {
          "sendAuthorityOverride": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "review",
                  "autopilot"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpsertAgentEndpointRequest": {
        "type": "object",
        "properties": {
          "agentProfileId": {
            "type": "string",
            "minLength": 8
          },
          "answerMode": {
            "type": "string",
            "enum": [
              "all_inbound"
            ]
          }
        },
        "required": [
          "agentProfileId"
        ],
        "additionalProperties": false
      }
    }
  }
}
