This is the API V2 documentation. To switch out of beta revert back to our API V1.

Open SidemenuAPI Reference
API Reference
Close Sidemenu

Twexit

Send a messagesendLegacyMessage

post https://api.telnyx.com/2010-04-01/Accounts/{organization_id}/Messages.json

Send a message using the legacy 2010-04-01 API. The organization_id is equivalent to AccountSid used by other vendors. Requests must be form-encoded.

curl -X POST \
-u "${organization_id}":"${auth_v2_api_key}" \
--data-urlencode 'From=+13232209999' \
--data-urlencode 'To=+13126858888' \
--data-urlencode 'Body=Hello, World!' \
https://api.telnyx.com/2010-04-01/Accounts/{organization_id}/Messages.json
Parameters
In path
organization_id
string (uuid)
required

Unique identifier for the organization that owns the resource.

Example: "6a09cdc3-8948-47f0-aa62-74ac943d6c58"
In body
From
string
required

Message source phone number

To
string
required

Message destination phone number

Body
string
required

Message content

StatusCallback
string
optional

URL to POST message status updates to

Responses
200

Successful response

400

Bad request

401

Unauthorized

Success Response
{
  "sid": "70995504-80ea-4616-bc00-645000000312",
  "date_created": "Tue, 12 Nov 2019 21:17:30 +0000",
  "date_updated": "Tue, 12 Nov 2019 21:17:30 +0000",
  "date_sent": null,
  "account_sid": "4e767ae7-bb87-c3b0-1999-abba00000baa",
  "to": "+16165551111",
  "from": "+13135556666",
  "messaging_service_sid": "0bafa967-0bb4-4202-9100-ebd000000ef7",
  "body": "I would indeed like a 🌮.",
  "status": "queued",
  "num_segments": "1",
  "num_media": "0",
  "direction": "outbound-api",
  "api_version": "2010-04-01",
  "price": null,
  "price_unit": "USD",
  "error_code": null,
  "error_message": null,
  "uri": "/2010-04-01/Accounts/4e767ae7-bb87-c3b0-9700-ab5000000baa/Messages/70995504-80ea-4616-bc00-645000000312.json",
  "subresource_uris": {
    "media": "/2010-04-01/Accounts/4e767ae7-bb87-c3b0-1999-abba00000baa/Messages/70995504-80ea-4616-bc00-645000000312/Media.json"
  }
}
Previous: Short Codes

Was this section helpful?was-this-page-helpful