Send a message
POST
/2010-04-01/Accounts/{AccountSid}/Messages.json https://api.twilio.com
Send a message
Parameters
path Path Parameters
| Name | Type |
|---|---|
AccountSid
required
The SID of the Account creating the Message resource. | `AC${string}` |
Request Body
application/x-www-form-urlencoded
{
To: string;
StatusCallback?: string;
ApplicationSid?: `AP${string}`;
MaxPrice?: number;
ProvideFeedback?: boolean;
Attempt?: number;
ValidityPeriod?: number;
ForceDelivery?: boolean;
ContentRetention?:MessageEnumContentRetention ;
AddressRetention?:MessageEnumAddressRetention ;
SmartEncoded?: boolean;
PersistentAction?: string[];
TrafficType?:MessageEnumTrafficType ;
ShortenUrls?: boolean;
ScheduleType?:MessageEnumScheduleType ;
SendAt?: string;
SendAsMms?: boolean;
ContentVariables?: string;
RiskCheck?:MessageEnumRiskCheck ;
From?: string;
MessagingServiceSid?: `MG${string}`;
Body?: string;
MediaUrl?: string[];
ContentSid?: `HX${string}`;
}
To: string;
StatusCallback?: string;
ApplicationSid?: `AP${string}`;
MaxPrice?: number;
ProvideFeedback?: boolean;
Attempt?: number;
ValidityPeriod?: number;
ForceDelivery?: boolean;
ContentRetention?:
AddressRetention?:
SmartEncoded?: boolean;
PersistentAction?: string[];
TrafficType?:
ShortenUrls?: boolean;
ScheduleType?:
SendAt?: string;
SendAsMms?: boolean;
ContentVariables?: string;
RiskCheck?:
From?: string;
MessagingServiceSid?: `MG${string}`;
Body?: string;
MediaUrl?: string[];
ContentSid?: `HX${string}`;
}
Responses
201 application/json
Created
interface ApiV2010AccountMessage {
body?: string | null;
num_segments?: string | null;
direction?:MessageEnumDirection ;
from?: string | null;
to?: string | null;
date_updated?: string | null;
price?: string | null;
error_message?: string | null;
uri?: string | null;
account_sid?: `AC${string}` | null;
num_media?: string | null;
status?:MessageEnumStatus ;
messaging_service_sid?: `MG${string}` | null;
sid?: string | null;
date_sent?: string | null;
date_created?: string | null;
error_code?: number | null;
price_unit?: string | null;
api_version?: string | null;
subresource_uris?: {} | null;
}
body?: string | null;
num_segments?: string | null;
direction?:
from?: string | null;
to?: string | null;
date_updated?: string | null;
price?: string | null;
error_message?: string | null;
uri?: string | null;
account_sid?: `AC${string}` | null;
num_media?: string | null;
status?:
messaging_service_sid?: `MG${string}` | null;
sid?: string | null;
date_sent?: string | null;
date_created?: string | null;
error_code?: number | null;
price_unit?: string | null;
api_version?: string | null;
subresource_uris?: {} | null;
}