> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a message using an alphanumeric sender ID

> Send an SMS message using an alphanumeric sender ID. This is SMS only.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging/messages.yml post /messages/alphanumeric/sender/id
openapi: 3.1.0
info:
  title: Telnyx Messages API
  version: 2.0.0
  description: API for sending and retrieving messages.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /messages/alphanumeric/sender/id:
    post:
      tags:
        - Messages
      summary: Send a message using an alphanumeric sender ID
      description: Send an SMS message using an alphanumeric sender ID. This is SMS only.
      operationId: SendAlphanumericSenderIdMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - text
                - messaging_profile_id
              properties:
                from:
                  type: string
                  description: A valid alphanumeric sender ID on the user's account.
                  example: MyCompany
                to:
                  $ref: '#/components/schemas/ToNumber'
                  description: Receiving address (+E.164 formatted phone number).
                text:
                  type: string
                  description: The message body.
                messaging_profile_id:
                  type: string
                  format: uuid
                  description: The messaging profile ID to use.
                webhook_url:
                  type:
                    - string
                    - 'null'
                  format: url
                  description: Callback URL for delivery status updates.
                webhook_failover_url:
                  type:
                    - string
                    - 'null'
                  format: url
                  description: Failover callback URL for delivery status updates.
                use_profile_webhooks:
                  type: boolean
                  description: If true, use the messaging profile's webhook settings.
      responses:
        '200':
          description: Successful response with the sent message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutboundMessageResponse'
        '400':
          $ref: '#/components/responses/messaging_BadRequestResponse'
        '401':
          $ref: '#/components/responses/messaging_UnauthorizedResponse'
        '422':
          $ref: '#/components/responses/messaging_UnprocessableEntityResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.messages.sendWithAlphanumericSender({
              from: 'MyCompany',
              messaging_profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              text: 'text',
              to: '+E.164',
            });

            console.log(response.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.messages.send_with_alphanumeric_sender(
                from_="MyCompany",
                messaging_profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                text="text",
                to="+E.164",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Messages.SendWithAlphanumericSender(context.TODO(), telnyx.MessageSendWithAlphanumericSenderParams{\n\t\tFrom:               \"MyCompany\",\n\t\tMessagingProfileID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tText:               \"text\",\n\t\tTo:                 \"+E.164\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.messages.MessageSendWithAlphanumericSenderParams;

            import
            com.telnyx.sdk.models.messages.MessageSendWithAlphanumericSenderResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    MessageSendWithAlphanumericSenderParams params = MessageSendWithAlphanumericSenderParams.builder()
                        .from("MyCompany")
                        .messagingProfileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
                        .text("text")
                        .to("+E.164")
                        .build();
                    MessageSendWithAlphanumericSenderResponse response = client.messages().sendWithAlphanumericSender(params);
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.messages.send_with_alphanumeric_sender(
              from: "MyCompany",
              messaging_profile_id: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
              text: "text",
              to: "+E.164"
            )

            puts(response)
        - lang: CLI
          source: |-
            telnyx messages send-with-alphanumeric-sender \
              --api-key 'My API Key' \
              --from MyCompany \
              --messaging-profile-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --text text \
              --to +E.164
components:
  schemas:
    ToNumber:
      type: string
      description: Receiving address (+E.164 formatted phone number or short code).
      example: +E.164
      x-format: address
    OutboundMessageResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/OutboundMessagePayload'
    OutboundMessagePayload:
      type: object
      properties:
        record_type:
          type: string
          example: message
          enum:
            - message
          description: Identifies the type of the resource.
        direction:
          type: string
          example: outbound
          enum:
            - outbound
          description: >-
            The direction of the message. Inbound messages are sent to you
            whereas outbound messages are sent from you.
        id:
          type: string
          format: uuid
          description: Identifies the type of resource.
        type:
          type: string
          enum:
            - SMS
            - MMS
          description: The type of message.
        messaging_profile_id:
          type: string
          description: Unique identifier for a messaging profile.
        organization_id:
          type: string
          format: uuid
          description: The id of the organization the messaging profile belongs to.
        from:
          type: object
          properties:
            phone_number:
              type: string
              description: >-
                Sending address (+E.164 formatted phone number, alphanumeric
                sender ID, or short code).
              x-format: address
            carrier:
              type: string
              description: The carrier of the receiver.
            line_type:
              type: string
              description: The line-type of the receiver.
              enum:
                - Wireline
                - Wireless
                - VoWiFi
                - VoIP
                - Pre-Paid Wireless
                - ''
        to:
          type: array
          items:
            type: object
            properties:
              phone_number:
                type: string
                description: >-
                  Receiving address (+E.164 formatted phone number or short
                  code).
                x-format: address
              status:
                type: string
                description: The delivery status of the message.
                enum:
                  - queued
                  - sending
                  - sent
                  - expired
                  - sending_failed
                  - delivery_unconfirmed
                  - delivered
                  - delivery_failed
              carrier:
                type: string
                description: The carrier of the receiver.
              line_type:
                type: string
                description: The line-type of the receiver.
                enum:
                  - Wireline
                  - Wireless
                  - VoWiFi
                  - VoIP
                  - Pre-Paid Wireless
                  - ''
        cc:
          type: array
          items:
            type: object
            properties:
              phone_number:
                type: string
                description: >-
                  Receiving address (+E.164 formatted phone number or short
                  code).
                x-format: address
              status:
                type: string
                enum:
                  - queued
                  - sending
                  - sent
                  - delivered
                  - sending_failed
                  - delivery_failed
                  - delivery_unconfirmed
              carrier:
                type: string
                description: The carrier of the receiver.
              line_type:
                type: string
                description: The line-type of the receiver.
                enum:
                  - Wireline
                  - Wireless
                  - VoWiFi
                  - VoIP
                  - Pre-Paid Wireless
                  - ''
        text:
          type: string
          description: |-
            Message body (i.e., content) as a non-empty string.

            **Required for SMS**
        subject:
          type:
            - string
            - 'null'
          description: Subject of multimedia message
        media:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                format: url
                description: The url of the media requested to be sent.
              content_type:
                type:
                  - string
                  - 'null'
                x-format: mime-type
                description: The MIME type of the requested media.
              sha256:
                type:
                  - string
                  - 'null'
                description: The SHA256 hash of the requested media.
              size:
                type:
                  - integer
                  - 'null'
                description: The size of the requested media.
        webhook_url:
          type:
            - string
            - 'null'
          format: url
          description: The URL where webhooks related to this message will be sent.
        webhook_failover_url:
          type:
            - string
            - 'null'
          format: url
          description: >-
            The failover URL where webhooks related to this message will be sent
            if sending to the primary URL fails.
        encoding:
          type: string
          description: Encoding scheme used for the message body.
        parts:
          type: integer
          minimum: 1
          maximum: 10
          description: Number of parts into which the message's body must be split.
        tags:
          type: array
          description: Tags associated with the resource.
          items:
            type: string
        cost:
          type:
            - object
            - 'null'
          properties:
            amount:
              type: string
              description: The amount deducted from your account.
              x-format: decimal
            currency:
              type: string
              description: The ISO 4217 currency identifier.
              x-format: iso4217
        cost_breakdown:
          type:
            - object
            - 'null'
          properties:
            carrier_fee:
              type: object
              properties:
                amount:
                  type: string
                  description: The carrier fee amount.
                  x-format: decimal
                currency:
                  type: string
                  description: The ISO 4217 currency identifier.
                  x-format: iso4217
            rate:
              type: object
              properties:
                amount:
                  type: string
                  description: The rate amount applied.
                  x-format: decimal
                currency:
                  type: string
                  description: The ISO 4217 currency identifier.
                  x-format: iso4217
          description: Detailed breakdown of the message cost components.
        tcr_campaign_id:
          type:
            - string
            - 'null'
          description: The Campaign Registry (TCR) campaign ID associated with the message.
        tcr_campaign_billable:
          type: boolean
          description: Indicates whether the TCR campaign is billable.
        tcr_campaign_registered:
          type:
            - string
            - 'null'
          description: The registration status of the TCR campaign.
          example: REGISTERED
        received_at:
          type: string
          format: date-time
          description: >-
            ISO 8601 formatted date indicating when the message request was
            received.
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 formatted date indicating when the message was sent.
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 formatted date indicating when the message was finalized.
        valid_until:
          type:
            - string
            - 'null'
          description: >-
            Message must be out of the queue by this time or else it will be
            discarded and marked as 'sending_failed'. Once the message moves out
            of the queue, this field will be nulled
          format: date-time
        errors:
          type: array
          description: >-
            These errors may point at addressees when referring to
            unsuccessful/unconfirmed delivery statuses.
          items:
            $ref: '#/components/schemas/messaging_Error'
        smart_encoding_applied:
          type: boolean
          description: >-
            Indicates whether smart encoding was applied to this message. When
            `true`, one or more Unicode characters were automatically replaced
            with GSM-7 equivalents to reduce segment count and cost. The
            original message text is preserved in webhooks.
        wait_seconds:
          type:
            - number
            - 'null'
          format: float
          description: >-
            Seconds the message is queued due to rate limiting before being sent
            to the carrier. Represents the maximum wait across all applicable
            rate limits (account, carrier, campaign). 0.0 = no queuing delay.
          example: 0.5
      example:
        record_type: message
        direction: outbound
        id: 40385f64-5717-4562-b3fc-2c963f66afa6
        type: MMS
        messaging_profile_id: 4000eba1-a0c0-4563-9925-b25e842a7cb6
        organization_id: b448f9cc-a842-4784-98e9-03c1a5872950
        from:
          phone_number: '+18445550001'
          carrier: TELNYX LLC
          line_type: VoIP
        to:
          - phone_number: '+18665550001'
            status: queued
            carrier: T-MOBILE USA, INC.
            line_type: Wireless
        cc: []
        text: Hello, World!
        subject: From Telnyx!
        media:
          - url: >-
              https://pbs.twimg.com/profile_images/1142168442042118144/AW3F4fFD_400x400.png
            content_type: null
            sha256: null
            size: null
        webhook_url: https://www.example.com/hooks
        webhook_failover_url: https://backup.example.com/hooks
        encoding: GSM-7
        parts: 1
        tags:
          - Greetings
        cost:
          amount: '0.0051'
          currency: USD
        cost_breakdown:
          carrier_fee:
            amount: '0.00305'
            currency: USD
          rate:
            amount: '0.00205'
            currency: USD
        tcr_campaign_id: TCPA3X7
        tcr_campaign_billable: true
        tcr_campaign_registered: REGISTERED
        received_at: '2019-01-23T18:10:02.574Z'
        sent_at: null
        completed_at: null
        valid_until: null
        errors: []
        wait_seconds: 0.5
    messaging_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/messaging_Error'
    messaging_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
          x-format: integer
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
              format: json-pointer
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
  responses:
    messaging_BadRequestResponse:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
    messaging_UnauthorizedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
    messaging_UnprocessableEntityResponse:
      description: Unprocessable Entity
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/messaging_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````