import Surge from '@surgeapi/node';const client = new Surge({ apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted});const message = await client.messages.create('acct_01j9a43avnfqzbjfch6pygv1td', { conversation: { contact: { phone_number: '+18015551234' } },});console.log(message.id);
import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
message = client.messages.create(
account_id="acct_01j9a43avnfqzbjfch6pygv1td",
conversation={
"contact": {
"phone_number": "+18015551234"
}
},
)
print(message.id)
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
message = surge.messages.create(
"acct_01j9a43avnfqzbjfch6pygv1td",
message_params: {conversation: {contact: {phone_number: "+18015551234"}}}
)
puts(message)
{
"error": {
"message": "The requested resource could not be found.",
"type": "not_found"
}
}
Messages
Send message
Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.
POST
/
accounts
/
{account_id}
/
messages
JavaScript
import Surge from '@surgeapi/node';const client = new Surge({ apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted});const message = await client.messages.create('acct_01j9a43avnfqzbjfch6pygv1td', { conversation: { contact: { phone_number: '+18015551234' } },});console.log(message.id);
import os
from surge import Surge
client = Surge(
api_key=os.environ.get("SURGE_API_KEY"), # This is the default and can be omitted
)
message = client.messages.create(
account_id="acct_01j9a43avnfqzbjfch6pygv1td",
conversation={
"contact": {
"phone_number": "+18015551234"
}
},
)
print(message.id)
require "surge_api"
surge = SurgeAPI::Client.new(api_key: "My API Key")
message = surge.messages.create(
"acct_01j9a43avnfqzbjfch6pygv1td",
message_params: {conversation: {contact: {phone_number: "+18015551234"}}}
)
puts(message)
Set of key-value pairs that will be stored with the object.
Show child attributes
send_at
string<date-time>
An optional datetime for scheduling message up to a couple of months in the future.
settings
MessageSettingsParams · object
Per-message setting overrides.
Show child attributes
Example:
{ "link_shortening": "enabled" }
Response
Created message
A Message is a communication sent to a Contact.
created_at
string<date-time> | null
required
When the message was added to the conversation, in ISO8601 UTC format. Null for scheduled messages until they are created. For imported messages, this is the original creation time.
attachments
Attachment · object[]
Show child attributes
blast_id
string | null
The ID of the blast this message belongs to, if any. This can be used to attribute messages back to a specific blast.
The reason the message failed, or null if no failure reason is set.
id
string
Unique identifier for the object.
metadata
Metadata · object
Set of key-value pairs that will be stored with the object.
Show child attributes
status
enum<string>
The current status of the message.
Available options:
pending,
received,
sent,
delivered,
failed
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Surge","colors":{"primary":"#8200ff","light":"#a684ff","dark":"#7f22fe"},"logo":{"light":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339","dark":"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339"},"favicon":"https://mintcdn.com/surge-67d47b03/TCCrlfgdQylYa0Zn/favicon.png?fit=max\u0026auto=format\u0026n=TCCrlfgdQylYa0Zn\u0026q=85\u0026s=9026e6be7d30dc29237a92585de3ae74","api":{"openapi":"openapi.documented.json"},"navbar":{"links":[{"href":"mailto:support@surge.app","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://hq.surge.app"}},"footer":{"socials":{"x":"https://x.com/surgeapi","github":"https://github.com/surgeapi","linkedin":"https://www.linkedin.com/company/surgeapi"}},"seo":{"metatags":{"og:image":"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d"},"indexing":"navigable"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"surge-67d47b03","hasAudioNarration":false,"actualSubdomain":"surge-67d47b03","customDomains":["docs.surge.app"],"gitSource":{"type":"github","owner":"surgeapi","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6afce457b74e9cc4f2fc86cd","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"default","tag":"API Reference","count":64},{"language":"default","tag":"Endpoints","count":45},{"language":"default","tag":"Documentation","count":38},{"language":"default","tag":"Webhooks","count":16},{"language":"default","tag":"Events","count":14},{"language":"default","tag":"Phone numbers","count":10},{"language":"default","tag":"SDKs","count":10},{"language":"default","tag":"Register your business","count":9},{"language":"default","tag":"Accounts","count":6},{"language":"default","tag":"Users","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2rem}"}]}
{"page":{"pagePath":"api-reference/endpoint/messages/create","slug":"/api-reference/endpoint/messages/create","pageMetadata":{"title":"Send message","description":"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.","openapi":"POST /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/create"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Send message","description":"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.","openapi":"POST /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/create"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Messages"],"responses":{"201":"bb38972a-c6b7-4ee5-9ea0-cf0b95f04de1","default":"d3097ce0-75ac-48cf-9def-953cc5ea44b2"},"description":"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.","operationId":"CreateMessage","parameters":["5de7934b-9392-4889-a9b5-4aba7bbe6238"],"requestBody":"b10beb5d-93ea-403b-be93-4e4d3bb049f6","summary":"Create a message","x-codeSamples":[{"lang":"JavaScript","source":"import Surge from '@surgeapi/node';\n\nconst client = new Surge({\n apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.create('acct_01j9a43avnfqzbjfch6pygv1td', {\n conversation: { contact: { phone_number: '+18015551234' } },\n});\n\nconsole.log(message.id);"},{"lang":"Python","source":"import os\nfrom surge import Surge\n\nclient = Surge(\n api_key=os.environ.get(\"SURGE_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.messages.create(\n account_id=\"acct_01j9a43avnfqzbjfch6pygv1td\",\n conversation={\n \"contact\": {\n \"phone_number\": \"+18015551234\"\n }\n },\n)\nprint(message.id)"},{"lang":"Ruby","source":"require \"surge_api\"\n\nsurge = SurgeAPI::Client.new(api_key: \"My API Key\")\n\nmessage = surge.messages.create(\n \"acct_01j9a43avnfqzbjfch6pygv1td\",\n message_params: {conversation: {contact: {phone_number: \"+18015551234\"}}}\n)\n\nputs(message)"}],"method":"post","type":"path","servers":["e57117fb-d785-48af-9e4e-135b2696c50b"],"security":["efd1bd9d-ebc2-4498-93ae-729be344cc09"],"path":"/accounts/{account_id}/messages","baseUrlOptions":["https://api.surge.app"],"title":"Create a message","codeSamples":[{"lang":"JavaScript","source":"import Surge from '@surgeapi/node';\n\nconst client = new Surge({\n apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted\n});\n\nconst message = await client.messages.create('acct_01j9a43avnfqzbjfch6pygv1td', {\n conversation: { contact: { phone_number: '+18015551234' } },\n});\n\nconsole.log(message.id);"},{"lang":"Python","source":"import os\nfrom surge import Surge\n\nclient = Surge(\n api_key=os.environ.get(\"SURGE_API_KEY\"), # This is the default and can be omitted\n)\nmessage = client.messages.create(\n account_id=\"acct_01j9a43avnfqzbjfch6pygv1td\",\n conversation={\n \"contact\": {\n \"phone_number\": \"+18015551234\"\n }\n },\n)\nprint(message.id)"},{"lang":"Ruby","source":"require \"surge_api\"\n\nsurge = SurgeAPI::Client.new(api_key: \"My API Key\")\n\nmessage = surge.messages.create(\n \"acct_01j9a43avnfqzbjfch6pygv1td\",\n message_params: {conversation: {contact: {phone_number: \"+18015551234\"}}}\n)\n\nputs(message)"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{"5de7934b-9392-4889-a9b5-4aba7bbe6238":{"in":"path","name":"account_id","required":true,"schema":{"description":"The account from which the message should be sent.","example":"acct_01j9a43avnfqzbjfch6pygv1td","type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","title":"MessageParamsWithConversation","description":"Create a message while including parameters for the conversation in which the message should be sent.","required":["conversation"],"example":{"attachments":[{"url":"https://toretto.family/coronas.gif"}],"body":"Thought you could leave without saying goodbye?","conversation":{"contact":{"first_name":"Dominic","last_name":"Toretto","phone_number":"+18015551234"}},"metadata":{"external_id":"12345"},"settings":{"link_shortening":"enabled"}},"properties":{"conversation":{"title":"ConversationParams","description":"Params for selecting or creating a new conversation. Either the id or the Contact must be given.","example":{"contact":{"first_name":"Dominic","last_name":"Toretto","phone_number":"+18015551234"},"phone_number":"+18015556789"},"properties":{"contact":{"title":"ContactParams","description":"Parameters for creating a contact","example":{"email":"dom@toretto.family","first_name":"Dominic","last_name":"Toretto","metadata":{"car":"1970 Dodge Charger R/T"},"outbound_disabled":false,"phone_number":"+18015551234"},"properties":{"phone_number":{"description":"The contact's phone number in E.164 format.","example":"+18015551234","format":"phone-number","pattern":"^\\+[1-9]\\d{6,14}$","type":"string","isRequired":true,"uniqueKey":"oneOf.0.conversation.contact.phone_number","typeLabel":"string\u003cphone-number>"},"email":{"description":"The contact's email address.","format":"email","type":"string","uniqueKey":"oneOf.0.conversation.contact.email","typeLabel":"string\u003cemail>"},"first_name":{"description":"The contact's first name.","type":"string","uniqueKey":"oneOf.0.conversation.contact.first_name","typeLabel":"string"},"last_name":{"description":"The contact's last name.","type":"string","uniqueKey":"oneOf.0.conversation.contact.last_name","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"oneOf.0.conversation.contact.metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"oneOf.0.conversation.contact.metadata","typeLabel":"Metadata · object"},"outbound_disabled":{"description":"Whether outbound messaging should be manually disabled for the contact.","type":"boolean","uniqueKey":"oneOf.0.conversation.contact.outbound_disabled","typeLabel":"boolean"}},"required":["phone_number"],"type":"object","isRequired":true,"uniqueKey":"oneOf.0.conversation.contact","typeLabel":"ContactParams · object"},"phone_number":{"description":"The phone number from which to send the message. This can be either the phone number in E.164 format or a Surge phone number id.","example":"+18015552345","pattern":"^\\+[1-9]\\d{6,14}$|^\\d{5,6}$|^pn_[[:alnum:]]{26}$","type":"string","uniqueKey":"oneOf.0.conversation.phone_number","typeLabel":"string"}},"required":["contact"],"type":"object","isRequired":true,"uniqueKey":"oneOf.0.conversation","typeLabel":"ConversationParams · object"},"attachments":{"items":{"title":"AttachmentParams","description":"Params for creating an attachment","example":{"url":"https://toretto.family/coronas.gif"},"properties":{"url":{"description":"The URL of the attachment.","type":"string","isRequired":true,"uniqueKey":"oneOf.0.attachments.items.[INDEX].url","typeLabel":"string"}},"required":["url"],"type":"object","uniqueKey":"oneOf.0.attachments.items.[INDEX]","typeLabel":"AttachmentParams · object"},"type":"array","uniqueKey":"oneOf.0.attachments","typeLabel":"AttachmentParams · object[]"},"body":{"description":"The message body.","type":"string","uniqueKey":"oneOf.0.body","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"oneOf.0.metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"oneOf.0.metadata","typeLabel":"Metadata · object"},"send_at":{"description":"An optional datetime for scheduling message up to a couple of months in the future.","format":"date-time","type":"string","uniqueKey":"oneOf.0.send_at","typeLabel":"string\u003cdate-time>"},"settings":{"title":"MessageSettingsParams","description":"Per-message setting overrides.","example":{"link_shortening":"enabled"},"properties":{"link_shortening":{"description":"Override link shortening for this message.","enum":["enabled","disabled"],"type":"string","uniqueKey":"oneOf.0.settings.link_shortening","typeLabel":"enum\u003cstring>"}},"type":"object","uniqueKey":"oneOf.0.settings","typeLabel":"MessageSettingsParams · object"}},"uniqueKey":"oneOf.0","typeLabel":"MessageParamsWithConversation · object"},{"type":"object","title":"SimpleMessageParams","description":"Create a basic message by specifying just the to/from phone numbers.","required":["to"],"example":{"attachments":[{"url":"https://toretto.family/coronas.gif"}],"body":"Thought you could leave without saying goodbye?","metadata":{"external_id":"12345"},"settings":{"link_shortening":"enabled"}},"properties":{"to":{"description":"The recipient's phone number in E.164 format. Cannot be used together with 'conversation'.","example":"+18015551234","format":"phone-number","pattern":"^\\+[1-9]\\d{6,14}$","type":"string","isRequired":true,"uniqueKey":"oneOf.1.to","typeLabel":"string\u003cphone-number>"},"attachments":{"items":{"title":"AttachmentParams","description":"Params for creating an attachment","example":{"url":"https://toretto.family/coronas.gif"},"properties":{"url":{"description":"The URL of the attachment.","type":"string","isRequired":true,"uniqueKey":"oneOf.1.attachments.items.[INDEX].url","typeLabel":"string"}},"required":["url"],"type":"object","uniqueKey":"oneOf.1.attachments.items.[INDEX]","typeLabel":"AttachmentParams · object"},"type":"array","uniqueKey":"oneOf.1.attachments","typeLabel":"AttachmentParams · object[]"},"body":{"description":"The message body.","type":"string","uniqueKey":"oneOf.1.body","typeLabel":"string"},"from":{"description":"The sender's phone number in E.164 format or phone number ID. If omitted, uses the account's default phone number. Cannot be used together with 'conversation'.","example":"+18015552345","pattern":"^\\+[1-9]\\d{6,14}$|^\\d{5,6}$|^pn_[[:alnum:]]{26}$","type":"string","uniqueKey":"oneOf.1.from","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"oneOf.1.metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"oneOf.1.metadata","typeLabel":"Metadata · object"},"send_at":{"description":"An optional datetime for scheduling message up to a couple of months in the future.","format":"date-time","type":"string","uniqueKey":"oneOf.1.send_at","typeLabel":"string\u003cdate-time>"},"settings":{"title":"MessageSettingsParams","description":"Per-message setting overrides.","example":{"link_shortening":"enabled"},"properties":{"link_shortening":{"description":"Override link shortening for this message.","enum":["enabled","disabled"],"type":"string","uniqueKey":"oneOf.1.settings.link_shortening","typeLabel":"enum\u003cstring>"}},"type":"object","uniqueKey":"oneOf.1.settings","typeLabel":"MessageSettingsParams · object"}},"uniqueKey":"oneOf.1","typeLabel":"SimpleMessageParams · object"}],"uniqueKey":"","typeLabel":"MessageParamsWithConversation · object | SimpleMessageParams · object"},"examples":{"Example":{"title":"Example","value":{"attachments":[{"url":"https://toretto.family/coronas.gif"}],"body":"Thought you could leave without saying goodbye?","conversation":{"contact":{"first_name":"Dominic","last_name":"Toretto","phone_number":"+18015551234"}},"metadata":{"external_id":"12345"},"settings":{"link_shortening":"enabled"}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"bb38972a-c6b7-4ee5-9ea0-cf0b95f04de1":{"content":{"application/json":{"schema":{"title":"Message","description":"A Message is a communication sent to a Contact.","example":{"attachments":[{"id":"att_01j9e0m1m6fc38gsv2vkfqgzz2","type":"image","url":"https://api.surge.app/attachments/att_01jbwyqj7rejzat7pq03r7fgmf"}],"blast_id":null,"body":"Thought you could leave without saying goodbye?","conversation":{"contact":{"first_name":"Dominic","id":"ctc_01j9dy8mdzfn3r0e8x1tbdrdrf","last_name":"Toretto","phone_number":"+18015551234"},"id":"cnv_01j9e0dgmdfkj86c877ws0znae","phone_number":{"id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"number":"+18015552345","type":"local"}},"created_at":"2024-10-21T23:29:40Z","failure_reason":null,"id":"msg_01j9e0m1m6fc38gsv2vkfqgzz2","metadata":{"external_id":"12345"},"status":"delivered"},"properties":{"created_at":{"oneOf":[{"description":"When the message was added to the conversation, in ISO8601 UTC format. Null for scheduled messages until they are created. For imported messages, this is the original creation time.","format":"date-time","type":"string","isRequired":true,"uniqueKey":"created_at.oneOf.0","typeLabel":"string\u003cdate-time>"},{"description":"When the message was added to the conversation, in ISO8601 UTC format. Null for scheduled messages until they are created. For imported messages, this is the original creation time.","format":"date-time","type":"null","isRequired":true,"uniqueKey":"created_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"created_at","typeLabel":"string\u003cdate-time> | null"},"attachments":{"items":{"title":"Attachment","description":"An Attachment is a file that can be sent with a message.","example":{"id":"att_01j9e0m1m6fc38gsv2vkfqgzz2","type":"image","url":"https://api.surge.app/attachments/att_01jbwyqj7rejzat7pq03r7fgmf"},"properties":{"id":{"description":"Unique identifier for the object.","type":"string","uniqueKey":"attachments.items.[INDEX].id","typeLabel":"string"},"type":{"description":"The type of attachment.","enum":["file","image","link","contact","video"],"type":"string","uniqueKey":"attachments.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"url":{"description":"The URL of the attachment.","type":"string","uniqueKey":"attachments.items.[INDEX].url","typeLabel":"string"}},"type":"object","uniqueKey":"attachments.items.[INDEX]","typeLabel":"Attachment · object"},"type":"array","uniqueKey":"attachments","typeLabel":"Attachment · object[]"},"blast_id":{"oneOf":[{"description":"The ID of the blast this message belongs to, if any. This can be used to attribute messages back to a specific blast.","type":"string","uniqueKey":"blast_id.oneOf.0","typeLabel":"string"},{"description":"The ID of the blast this message belongs to, if any. This can be used to attribute messages back to a specific blast.","type":"null","uniqueKey":"blast_id.oneOf.1","typeLabel":"null"}],"uniqueKey":"blast_id","typeLabel":"string | null"},"body":{"oneOf":[{"description":"The message body.","type":"string","uniqueKey":"body.oneOf.0","typeLabel":"string"},{"description":"The message body.","type":"null","uniqueKey":"body.oneOf.1","typeLabel":"null"}],"uniqueKey":"body","typeLabel":"string | null"},"conversation":{"title":"Conversation","description":"A conversation with a Contact","example":{"contact":{"first_name":"Dominic","id":"ctc_01j9dy8mdzfn3r0e8x1tbdrdrf","last_name":"Toretto","phone_number":"+18015551234"},"id":"cnv_01j9e0dgmdfkj86c877ws0znae","phone_number":{"id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"name":"(801) 555-2345","number":"+18015552345","type":"local"}},"properties":{"contact":{"title":"Contact","description":"A contact who has consented to receive messages","example":{"email":"dom@toretto.family","first_name":"Dominic","id":"ctc_01j9dy8mdzfn3r0e8x1tbdrdrf","last_name":"Toretto","metadata":{"car":"1970 Dodge Charger R/T"},"outbound_disabled":false,"phone_number":"+18015551234"},"properties":{"id":{"description":"Unique identifier for the object.","type":"string","isRequired":true,"uniqueKey":"conversation.contact.id","typeLabel":"string"},"phone_number":{"description":"The contact's phone number in E.164 format.","example":"+18015551234","format":"phone-number","pattern":"^\\+[1-9]\\d{6,14}$","type":"string","isRequired":true,"uniqueKey":"conversation.contact.phone_number","typeLabel":"string\u003cphone-number>"},"email":{"description":"The contact's email address.","format":"email","type":"string","uniqueKey":"conversation.contact.email","typeLabel":"string\u003cemail>"},"first_name":{"description":"The contact's first name.","type":"string","uniqueKey":"conversation.contact.first_name","typeLabel":"string"},"last_name":{"description":"The contact's last name.","type":"string","uniqueKey":"conversation.contact.last_name","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"conversation.contact.metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"conversation.contact.metadata","typeLabel":"Metadata · object"},"outbound_disabled":{"description":"Whether outbound messaging has been manually disabled for the contact.","type":"boolean","uniqueKey":"conversation.contact.outbound_disabled","typeLabel":"boolean"}},"required":["id","phone_number"],"type":"object","isRequired":true,"uniqueKey":"conversation.contact","typeLabel":"Contact · object"},"id":{"description":"Unique identifier for the object.","type":"string","isRequired":true,"uniqueKey":"conversation.id","typeLabel":"string"},"phone_number":{"title":"ConversationPhoneNumber","description":"This is the phone number tied to the Surge account.","example":{"id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"name":"(801) 555-1234","number":"+18015551234","type":"local"},"properties":{"id":{"description":"Unique identifier for the phone number","type":"string","isRequired":true,"uniqueKey":"conversation.phone_number.id","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"conversation.phone_number.metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","isRequired":true,"uniqueKey":"conversation.phone_number.metadata","typeLabel":"Metadata · object"},"name":{"oneOf":[{"description":"A human-readable name for the phone number","type":"string","isRequired":true,"uniqueKey":"conversation.phone_number.name.oneOf.0","typeLabel":"string"},{"description":"A human-readable name for the phone number","type":"null","isRequired":true,"uniqueKey":"conversation.phone_number.name.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"conversation.phone_number.name","typeLabel":"string | null"},"number":{"description":"The canonical format of the phone number.","example":"+18015551234","format":"phone-number","pattern":"^\\+[1-9]\\d{6,14}$|^\\d{5,6}$","type":"string","isRequired":true,"uniqueKey":"conversation.phone_number.number","typeLabel":"string\u003cphone-number>"},"type":{"description":"Whether the phone number is local, toll-free, or short code","enum":["local","toll_free","short_code","demo"],"type":"string","isRequired":true,"uniqueKey":"conversation.phone_number.type","typeLabel":"enum\u003cstring>"}},"required":["id","metadata","name","number","type"],"type":"object","uniqueKey":"conversation.phone_number","typeLabel":"ConversationPhoneNumber · object"}},"required":["id","contact"],"type":"object","uniqueKey":"conversation","typeLabel":"Conversation · object"},"failure_reason":{"oneOf":[{"description":"The reason the message failed, or null if no failure reason is set.","type":"string","uniqueKey":"failure_reason.oneOf.0","typeLabel":"string"},{"description":"The reason the message failed, or null if no failure reason is set.","type":"null","uniqueKey":"failure_reason.oneOf.1","typeLabel":"null"}],"uniqueKey":"failure_reason","typeLabel":"string | null"},"id":{"description":"Unique identifier for the object.","type":"string","uniqueKey":"id","typeLabel":"string"},"metadata":{"title":"Metadata","additionalProperties":{"maxLength":500,"type":"string","uniqueKey":"metadata.additionalProperties","typeLabel":"string"},"description":"Set of key-value pairs that will be stored with the object.","maxProperties":50,"properties":{},"type":"object","uniqueKey":"metadata","typeLabel":"Metadata · object"},"status":{"description":"The current status of the message.","enum":["pending","received","sent","delivered","failed"],"type":"string","uniqueKey":"status","typeLabel":"enum\u003cstring>"}},"required":["created_at"],"type":"object","uniqueKey":"","typeLabel":"Message · object"},"examples":{"Example":{"title":"Example","value":{"attachments":[{"id":"att_01j9e0m1m6fc38gsv2vkfqgzz2","type":"image","url":"https://api.surge.app/attachments/att_01jbwyqj7rejzat7pq03r7fgmf"}],"blast_id":null,"body":"Thought you could leave without saying goodbye?","conversation":{"contact":{"first_name":"Dominic","id":"ctc_01j9dy8mdzfn3r0e8x1tbdrdrf","last_name":"Toretto","phone_number":"+18015551234"},"id":"cnv_01j9e0dgmdfkj86c877ws0znae","phone_number":{"id":"pn_01jsjwe4d9fx3tpymgtg958d9w","metadata":{"location":"Downtown store"},"number":"+18015552345","type":"local"}},"created_at":"2024-10-21T23:29:40Z","failure_reason":null,"id":"msg_01j9e0m1m6fc38gsv2vkfqgzz2","metadata":{"external_id":"12345"},"status":"delivered"}}},"exampleType":"generated"}},"description":"Created message","exampleType":"generated"},"d3097ce0-75ac-48cf-9def-953cc5ea44b2":{"content":{"application/json":{"schema":{"title":"ErrorResponse","description":"An error response","example":{"error":{"message":"The requested resource could not be found.","type":"not_found"}},"properties":{"error":{"title":"Error","description":"An error response","example":{"message":"The requested resource was not found.","type":"not_found"},"properties":{"message":{"description":"A human-readable error message.","example":"The requested resource was not found.","type":"string","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"type":{"description":"A unique error code.","example":"not_found","type":"string","isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"detail":{"additionalProperties":true,"description":"Additional details about the error.","type":"object","uniqueKey":"error.detail","typeLabel":"object"}},"required":["type","message"],"type":"object","isRequired":true,"uniqueKey":"error","typeLabel":"Error · object"}},"required":["error"],"type":"object","uniqueKey":"","typeLabel":"ErrorResponse · object"},"examples":{"Example":{"title":"Example","value":{"error":{"message":"The requested resource could not be found.","type":"not_found"}}}},"exampleType":"generated"}},"description":"Error","exampleType":"generated"}},"security":{"efd1bd9d-ebc2-4498-93ae-729be344cc09":{"authorization":{"bearerFormat":"Surge API token","scheme":"bearer","type":"http","scopes":[],"schemeName":"authorization"}}},"servers":{"e57117fb-d785-48af-9e4e-135b2696c50b":{"url":"https://api.surge.app"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"bearerFormat":"Surge API token","scheme":"bearer","type":"http","scopes":[],"schemeName":"authorization"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"authorization","name":"Authorization"}],"title":"authorization"}]},"originalFileLocation":"openapi.documented.json"},"subdomain":"surge-67d47b03","siteName":"Surge","title":"Send message - Surge","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-21T23:32:26.787Z","originalFileLocation":"api-reference/endpoint/messages/create.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Surge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Send message - Surge\">\u003cmeta data-mint-head property=\"og:description\" content=\"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Surge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.surge.app/api-reference/endpoint/messages/create\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Send message - Surge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/surge-67d47b03/sXzShSiekorghOlZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Surge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8200ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.surge.app/api-reference/endpoint/messages/create\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/messages/create.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.surge.app/#organization\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/surge-67d47b03/1YdD2Aq20HHnJtCK/logo.svg?fit=max\u0026auto=format\u0026n=1YdD2Aq20HHnJtCK\u0026q=85\u0026s=fb53e91d462980a01e9b7c046c98f339\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.surge.app#website\",\"name\":\"Surge\",\"url\":\"https://docs.surge.app\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.surge.app/api-reference/endpoint/messages/create#webpage\",\"url\":\"https://docs.surge.app/api-reference/endpoint/messages/create\",\"name\":\"Send message\",\"description\":\"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\",\"dateModified\":\"2026-07-21T23:32:26.787Z\",\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.surge.app/api-reference/endpoint/messages/create#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.surge.app/api-reference/endpoint/messages/create#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.surge.app/api-reference/endpoint/accounts/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Send message\",\"item\":\"https://docs.surge.app/api-reference/endpoint/messages/create\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.surge.app/api-reference/endpoint/messages/create#apireference\",\"headline\":\"Send message\",\"name\":\"Send message\",\"description\":\"Queue an SMS or MMS message from a phone number to be sent to a recipient, asynchronously.\",\"url\":\"https://docs.surge.app/api-reference/endpoint/messages/create\",\"mainEntityOfPage\":{\"@id\":\"https://docs.surge.app/api-reference/endpoint/messages/create#webpage\"},\"image\":\"https://surgemsg.com/images/surge-preview-9b01c93f5b24bb5128b47c354c371546.jpg?vsn=d\",\"dateModified\":\"2026-07-21T23:32:26.787Z\",\"publisher\":{\"@id\":\"https://docs.surge.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.surge.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Surge\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Surge\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/messages/create.md","siteName":"Surge","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/overview/what-is-surge"}]},{"anchor":"SDKs","icon":"code","pages":[{"title":"SDKs","href":"/sdks"}]},{"anchor":"API Reference","icon":"terminal","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Authentication","href":"/api-reference/authentication"},{"title":"Error Reference","href":"/api-reference/errors"}]},{"group":"Endpoints","pages":[{"group":"Accounts","pages":[{"title":"Create account","openapi":"POST /accounts","href":"/api-reference/endpoint/accounts/create"},{"title":"List accounts","openapi":"GET /accounts","href":"/api-reference/endpoint/accounts/list"},{"title":"Retrieve account","openapi":"GET /accounts/{id}","href":"/api-reference/endpoint/accounts/get"},{"title":"Check account status","openapi":"GET /accounts/{account_id}/status","href":"/api-reference/endpoint/accounts/check-status"},{"title":"Update account","openapi":"PATCH /accounts/{id}","href":"/api-reference/endpoint/accounts/update"},{"title":"Archive account","openapi":"DELETE /accounts/{id}","href":"/api-reference/endpoint/accounts/archive"}]},{"group":"Attachments","pages":[{"title":"Retrieve attachment file","openapi":"GET /attachments/{attachment_id}/file","href":"/api-reference/endpoint/attachments/get-file"}]},{"group":"Audiences","pages":[{"title":"Create audience","openapi":"POST /accounts/{account_id}/audiences","href":"/api-reference/endpoint/audiences/create"},{"title":"Add contact to audience","openapi":"POST /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/add-contact"},{"title":"List audience contacts","openapi":"GET /audiences/{audience_id}/contacts","href":"/api-reference/endpoint/audiences/list-contacts"}]},{"group":"Blasts","pages":[{"title":"Create blast","openapi":"POST /accounts/{account_id}/blasts","href":"/api-reference/endpoint/blasts/create"}]},{"group":"Campaigns","pages":[{"title":"Create campaign","openapi":"POST /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/create"},{"title":"List campaigns","openapi":"GET /accounts/{account_id}/campaigns","href":"/api-reference/endpoint/campaigns/list"},{"title":"Retrieve campaign","openapi":"GET /campaigns/{id}","href":"/api-reference/endpoint/campaigns/get"},{"title":"Update campaign","openapi":"PATCH /campaigns/{id}","href":"/api-reference/endpoint/campaigns/update"},{"title":"Resend brand verification OTP","openapi":"POST /accounts/{account_id}/brand_verification_messages","href":"/api-reference/endpoint/campaigns/resend-brand-verification-message"}]},{"group":"Contacts","pages":[{"title":"Create contact","openapi":"POST /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/create"},{"title":"List contacts","openapi":"GET /accounts/{account_id}/contacts","href":"/api-reference/endpoint/contacts/list"},{"title":"Retrieve contact","openapi":"GET /contacts/{id}","href":"/api-reference/endpoint/contacts/get"},{"title":"Update contact","description":"Update contact details such as name, email, or custom metadata.","openapi":"PATCH /contacts/{id}","href":"/api-reference/endpoint/contacts/update"}]},{"group":"Messages","pages":[{"title":"Send message","openapi":"POST /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/create"},{"title":"List messages","description":"List messages for an account with cursor-based pagination and optional conversation filtering.","openapi":"GET /accounts/{account_id}/messages","href":"/api-reference/endpoint/messages/list"},{"title":"Retrieve message","openapi":"GET /messages/{id}","href":"/api-reference/endpoint/messages/get"}]},{"group":"Phone numbers","pages":[{"title":"Purchase phone number","openapi":"POST /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/purchase"},{"title":"List phone numbers","openapi":"GET /accounts/{account_id}/phone_numbers","href":"/api-reference/endpoint/phone-numbers/list"},{"title":"Retrieve phone number","openapi":"GET /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/get"},{"title":"Update phone number","openapi":"PATCH /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/update"},{"title":"Release phone number","openapi":"DELETE /phone_numbers/{id}","href":"/api-reference/endpoint/phone-numbers/release"},{"title":"List available numbers","openapi":"GET /accounts/{account_id}/available_phone_numbers","href":"/api-reference/endpoint/phone-numbers/list-available-numbers"}]},{"group":"Recordings","pages":[{"title":"List recordings","openapi":"GET /accounts/{account_id}/recordings","href":"/api-reference/endpoint/recordings/list"},{"title":"Retrieve recording","openapi":"GET /recordings/{id}","href":"/api-reference/endpoint/recordings/get"},{"title":"Delete recording","openapi":"DELETE /recordings/{id}","href":"/api-reference/endpoint/recordings/delete"},{"title":"Download recording file","openapi":"GET /recordings/{recording_id}/file","href":"/api-reference/endpoint/recordings/get-file"}]},{"group":"Toll-free Campaigns","pages":[{"title":"Create toll-free campaign","openapi":"POST /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/create"},{"title":"List toll-free campaigns","openapi":"GET /accounts/{account_id}/toll_free_campaigns","href":"/api-reference/endpoint/toll-free-campaigns/list"},{"title":"Retrieve toll-free campaign","openapi":"GET /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/get"},{"title":"Update toll-free campaign","openapi":"PATCH /toll_free_campaigns/{campaign_id}","href":"/api-reference/endpoint/toll-free-campaigns/update"}]},{"group":"Users","pages":[{"title":"Create user","openapi":"POST /accounts/{account_id}/users","href":"/api-reference/endpoint/users/create"},{"title":"List users","openapi":"GET /accounts/{account_id}/users","href":"/api-reference/endpoint/users/list"},{"title":"Retrieve user","openapi":"GET /users/{id}","href":"/api-reference/endpoint/users/get"},{"title":"Update user","openapi":"PATCH /users/{id}","href":"/api-reference/endpoint/users/update"},{"title":"Delete user","openapi":"DELETE /users/{id}","href":"/api-reference/endpoint/users/delete"},{"title":"Create user token","openapi":"POST /users/{user_id}/tokens","href":"/api-reference/endpoint/users/create-token"}]},{"group":"Verifications","pages":[{"title":"Create verification","openapi":"POST /accounts/{account_id}/verifications","href":"/api-reference/endpoint/verifications/create"},{"title":"Check verification","openapi":"POST /verifications/{id}/checks","href":"/api-reference/endpoint/verifications/check"}]}]},{"group":"Webhooks","pages":[{"title":"Webhooks Overview","href":"/api-reference/webhooks/intro"},{"title":"Signature Verification","href":"/api-reference/webhooks/signature-validation"},{"group":"Events","pages":[{"title":"message.sent","openapi":"webhook messageSent","href":"/api-reference/webhooks/message/sent"},{"title":"message.delivered","openapi":"webhook messageDelivered","href":"/api-reference/webhooks/message/delivered"},{"title":"message.failed","openapi":"webhook messageFailed","href":"/api-reference/webhooks/message/failed"},{"title":"message.received","openapi":"webhook messageReceived","href":"/api-reference/webhooks/message/received"},{"title":"contact.opted_in","openapi":"webhook contactOptedIn","href":"/api-reference/webhooks/contact/opted_in"},{"title":"contact.opted_out","openapi":"webhook contactOptedOut","href":"/api-reference/webhooks/contact/opted_out"},{"title":"conversation.created","openapi":"webhook conversationCreated","href":"/api-reference/webhooks/conversation/created"},{"title":"campaign.approved","openapi":"webhook campaignApproved","href":"/api-reference/webhooks/campaign/approved"},{"title":"phone_number.imported","openapi":"webhook phoneNumberImported","href":"/api-reference/webhooks/phone_number/imported"},{"title":"phone_number.attached_to_campaign","openapi":"webhook phoneNumberAttachedToCampaign","href":"/api-reference/webhooks/phone_number/attached_to_campaign"},{"title":"link.followed","openapi":"webhook linkFollowed","href":"/api-reference/webhooks/link/followed"},{"title":"call.ended","openapi":"webhook callEnded","href":"/api-reference/webhooks/call/ended"},{"title":"recording.completed","openapi":"webhook recordingCompleted","href":"/api-reference/webhooks/recording/completed"},{"title":"voicemail.received","openapi":"webhook voicemailReceived","href":"/api-reference/webhooks/voicemail/received"}]}]}]},{"anchor":"Resources","icon":"folder-open","pages":[{"title":"Resources","href":"/resources/hipaa"}]}]},"basePath":"","title":"Send message - Surge","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BtG4DSkw.js","snippetPresets-C1k1xDhp.js","utils-PMJoEt4Y.js","style-to-object-BY3JEAdk.js","utils-DW3Pr7Jq.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-DIISLO2w.js","conditional-requirements-CFM0id0Q.js","cloneDeep-BErNCZCm.js","_Uint8Array-f0PCu9f_.js","isObject-FP1Yky1u.js","ApiExamples-OjY-8mqu.js","usePlaygroundInputsStore-B2HS2hUb.js","shallow-DVFuuIDQ.js","isEqual-DG0UKiQC.js","CodeSnippets-Cy6FBgwN.js","CodeSnippet-D1PtG8ed.js","getApiPlaygroundDisplay-Dkx2eNtL.js","Page-C8Cg25if.js","DynamicMarkdown-BvJIe00T.js","SectionHeading-B0rKYV8d.js","icon-yclzBff4.js","MethodPill-DxA11cCF.js","getPastedJson-CpkIDpMk.js","DuplicateIcon-CFCQNJ-D.js","axios-CsQoIw0U.js","Markdown-CK5C-fmV.js","AssistantPageLink-Cw134Dd-.js","dist-3xM3Qrc7.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}