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

# Create Message Route

> Create a new message route to configure how inbound SMS/MMS messages are handled. Specify webhook URLs for message delivery, fallback URLs, and HTTP methods. Each route is identified by a unique MRID (Message Route ID).

**What this does:** Returns the new route's `MessageRouteId` (`MRID-`). Store this ID — it is required when provisioning numbers and can be assigned to multiple numbers. The webhook URL you configure receives a POST for every inbound message on numbers using this route.

**Next steps:**
- Assign the route to a number at provision time — `POST /v1.0/numbers/provision`
- Update route settings — `POST /v1.0/message/routes/update`



## OpenAPI

````yaml /api-reference/openapi.json post /v1.0/message/routes
openapi: 3.0.3
info:
  title: mPaaS Core APIs
  version: 1.0.8
  description: >-
    The Telegent mPaaS (Mobile Platform as a Service) API gives you full
    programmatic control over mobile phone numbers, messaging, voice routing,
    subscribers, and account management. Use these APIs to provision MVNO and
    IoT numbers, send and receive SMS/MMS, configure intelligent call routing,
    manage subscriber accounts, and apply AI Guardian controls. All requests
    require a Bearer token obtained from the Authentication endpoint. For
    support, visit https://support.telegent.com/support/home
  contact:
    name: Support
    email: support@telegent.com
  termsOfService: https://telegent.com/terms
  license:
    name: Use under LICX
    url: https://telegent.com/license
servers:
  - url: https://api.telegent.com
security:
  - BearerAuth: []
tags:
  - name: OAuth2
  - name: AI Guardian
  - name: Accounts
  - name: Distributors
  - name: Message
  - name: Numbers
  - name: Voicemail
  - name: Packages
  - name: Products
  - name: Schedules
  - name: Services
  - name: Sims
  - name: Subscribers
  - name: Subscriptions
  - name: Voice
  - name: Workgroups
paths:
  /v1.0/message/routes:
    post:
      tags:
        - Message
      summary: Create Message Route
      description: >-
        Create a new message route to configure how inbound SMS/MMS messages are
        handled. Specify webhook URLs for message delivery, fallback URLs, and
        HTTP methods. Each route is identified by a unique MRID (Message Route
        ID).


        **What this does:** Returns the new route's `MessageRouteId` (`MRID-`).
        Store this ID — it is required when provisioning numbers and can be
        assigned to multiple numbers. The webhook URL you configure receives a
        POST for every inbound message on numbers using this route.


        **Next steps:**

        - Assign the route to a number at provision time — `POST
        /v1.0/numbers/provision`

        - Update route settings — `POST /v1.0/message/routes/update`
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - RouteName
                - MessageUrl
                - MessageUrlMethod
              properties:
                RouteName:
                  type: string
                  description: Friendly name for the message route
                  example: Main SMS Webhook
                MessageUrl:
                  type: string
                  format: uri
                  description: Primary webhook URL for inbound messages
                  example: https://apiendpoint.com
                MessageUrlMethod:
                  type: string
                  enum:
                    - GET
                    - POST
                  description: HTTP method for webhook delivery
                  example: POST
                MessageRouteEnabled:
                  type: boolean
                  description: Enable or disable this message route
                  example: true
                  default: true
                MessageAuthenticationType:
                  type: string
                  enum:
                    - None
                    - Basic
                    - Bearer
                  description: Authentication type for primary webhook
                  example: Basic
                MessageUsername:
                  type: string
                  description: Username for Basic auth (if applicable)
                  example: admin
                MessagePasswordToken:
                  type: string
                  description: Password for Basic auth or token for Bearer auth
                  example: passwordORbearerToken
                CallbackMessageUrl:
                  type: string
                  format: uri
                  description: Fallback/callback webhook URL
                  example: https://apiendpoint.com
                CallbackMessageUrlMethod:
                  type: string
                  enum:
                    - GET
                    - POST
                  description: HTTP method for callback webhook
                  example: POST
                CallbackMessageAuthenticationType:
                  type: string
                  enum:
                    - None
                    - Basic
                    - Bearer
                  description: Authentication type for callback webhook
                  example: Basic
                CallbackMessageUsername:
                  type: string
                  description: Username for callback Basic auth
                  example: admin
                CallbackMessagePasswordToken:
                  type: string
                  description: Password/token for callback auth
                  example: password
                InboundBypass:
                  type: boolean
                  description: >-
                    Bypass AI Guardian filtering for inbound messages on this
                    route
                  example: true
                OutboundBypass:
                  type: boolean
                  description: >-
                    Bypass AI Guardian filtering for outbound messages on this
                    route
                  example: true
                IntelligentRouteEnabled:
                  type: boolean
                  description: >-
                    Enable intelligent routing features (AI-assisted message
                    routing)
                  example: true
                AccountId:
                  type: string
                  description: Account ID to associate with this message route
                  example: DID-eab92510-1040-45a5-bb9c-0bad927SDY878W
      responses:
        '200':
          description: Success — returns the newly created Message Route ID (MRID)
          content:
            application/json:
              schema:
                type: object
              examples:
                example:
                  value:
                    MessageRouteId: MRID-ad0ff867-57dc-4aeb-80e9-9d18349080e9
                    AccountId: AID-ab12345-2725-45a1-bd5e-526ed19799xx
                    RouteName: Main SMS Webhook
                    MessageUrl: https://apiendpoint.com
                    MessageUrlMethod: POST
                    MessageRouteEnabled: false
                    MessageAuthenticationType: Basic
                    MessageUsername: admin
                    MessagePasswordToken: passwordORbearerToken
                    CallbackMessageUrl: https://apiendpoint.com
                    CallbackMessageUrlMethod: POST
                    CallbackMessageAuthenticationType: Basic
                    CallbackMessageUsername: admin
                    CallbackMessagePasswordToken: password
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/BadRequest_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest_Result'
              examples:
                example:
                  value:
                    StatusCode: 400
                    Message: >-
                      Bad request: one or more required fields are missing or
                      contain an invalid value.
            text/json:
              schema:
                $ref: '#/components/schemas/BadRequest_Result'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Unauthorized_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized_Result'
              examples:
                example:
                  value:
                    StatusCode: 401
                    Message: >-
                      Unauthorized: Bearer token is missing, expired, or
                      invalid. Re-authenticate via POST /v1.0/oauth2/tokens.
            text/json:
              schema:
                $ref: '#/components/schemas/Unauthorized_Result'
        '403':
          description: Forbidden
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Forbidden_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/Forbidden_Result'
              examples:
                example:
                  value:
                    StatusCode: 403
                    Message: >-
                      Forbidden: your token does not have permission to access
                      this resource. Check the ApiEndpoint scope.
            text/json:
              schema:
                $ref: '#/components/schemas/Forbidden_Result'
        '404':
          description: Not Found
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/NotFound_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound_Result'
              examples:
                example:
                  value:
                    StatusCode: 404
                    Message: >-
                      Not found: the requested resource does not exist or
                      belongs to a different account.
            text/json:
              schema:
                $ref: '#/components/schemas/NotFound_Result'
        '405':
          description: Method Not Allowed
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/MethodNotAllowed_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/MethodNotAllowed_Result'
              examples:
                example:
                  value:
                    StatusCode: 405
                    Message: >-
                      Method not allowed: verify the HTTP method required for
                      this endpoint.
            text/json:
              schema:
                $ref: '#/components/schemas/MethodNotAllowed_Result'
        '408':
          description: Request Timeout
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/RequestTimeout_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimeout_Result'
              examples:
                example:
                  value:
                    StatusCode: 408
                    Message: >-
                      Request timeout: the server did not receive a complete
                      request within the allowed time. Retry with exponential
                      backoff.
            text/json:
              schema:
                $ref: '#/components/schemas/RequestTimeout_Result'
        '429':
          description: Too Many Requests
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/TooManyRequests_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests_Result'
              examples:
                example:
                  value:
                    StatusCode: 429
                    Message: >-
                      Too many requests: rate limit exceeded. Slow your request
                      cadence and retry after a short delay.
            text/json:
              schema:
                $ref: '#/components/schemas/TooManyRequests_Result'
        '500':
          description: Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/InternalServerError_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError_Result'
              examples:
                example:
                  value:
                    StatusCode: 500
                    Message: >-
                      Internal server error: an unexpected error occurred. If
                      the problem persists contact support@telegent.com.
            text/json:
              schema:
                $ref: '#/components/schemas/InternalServerError_Result'
        '503':
          description: Service Unavailable
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ServiceUnavailable_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailable_Result'
              examples:
                example:
                  value:
                    StatusCode: 503
                    Message: >-
                      Service unavailable: the API is temporarily unavailable.
                      Retry after a short delay.
            text/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailable_Result'
        '504':
          description: Gateway Timeout
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/GatewayTimeout_Result'
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayTimeout_Result'
              examples:
                example:
                  value:
                    StatusCode: 504
                    Message: >-
                      Gateway timeout: an upstream service did not respond in
                      time. Retry with exponential backoff.
            text/json:
              schema:
                $ref: '#/components/schemas/GatewayTimeout_Result'
      x-codeSamples:
        - lang: JSON
          source: |-
            {
              "RouteName": "Main SMS Webhook",
              "MessageUrl": "https://apiendpoint.com",
              "MessageUrlMethod": "POST",
              "MessageRouteEnabled": true,
              "MessageAuthenticationType": "Basic",
              "MessageUsername": "admin",
              "MessagePasswordToken": "passwordORbearerToken",
              "CallbackMessageUrl": "https://apiendpoint.com",
              "CallbackMessageUrlMethod": "POST",
              "CallbackMessageAuthenticationType": "Basic",
              "CallbackMessageUsername": "admin",
              "CallbackMessagePasswordToken": "password",
              "InboundBypass": true,
              "OutboundBypass": true,
              "IntelligentRouteEnabled": true,
              "AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx"
            }
        - lang: cURL
          source: |-
            curl -X POST https://api.telegent.com/v1.0/message/routes \
              -H 'Authorization: Bearer YOUR_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{
                "RouteName": "Main SMS Webhook",
                "MessageUrl": "https://apiendpoint.com",
                "MessageUrlMethod": "POST",
                "MessageRouteEnabled": true,
                "MessageAuthenticationType": "Basic",
                "MessageUsername": "admin",
                "MessagePasswordToken": "passwordORbearerToken",
                "CallbackMessageUrl": "https://apiendpoint.com",
                "CallbackMessageUrlMethod": "POST",
                "CallbackMessageAuthenticationType": "Basic",
                "CallbackMessageUsername": "admin",
                "CallbackMessagePasswordToken": "password",
                "InboundBypass": true,
                "OutboundBypass": true,
                "IntelligentRouteEnabled": true,
                "AccountId": "AID-ab12345-2725-45a1-bd5e-526ed19799xx"
              }'
components:
  schemas:
    BadRequest_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    Unauthorized_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    Forbidden_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    NotFound_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    MethodNotAllowed_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    RequestTimeout_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    TooManyRequests_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    InternalServerError_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    ServiceUnavailable_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false
    GatewayTimeout_Result:
      required:
        - StatusCode
      type: object
      properties:
        StatusCode:
          type: integer
          format: int32
        Message:
          type: string
          nullable: true
      additionalProperties: false

````