> ## 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.

# Create a connection-scoped TeXML call

> Initiate an outbound TeXML call using a TeXML application connection ID, not an account SID. Request parameter names are case-sensitive. From and To are required; Texml supplies inline instructions and Url overrides the application XML request URL. When neither is supplied, the application configuration supplies the instructions. The response is a flat call object without a data wrapper.



## OpenAPI

````yaml /openapi/source/external/call-scripting/call-scripting.json post /texml/calls/{connection_id}
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    email: support@telnyx.com
  x-responsible-team: squad-telephony-apps
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API
security:
  - bearerAuth: []
tags:
  - name: TeXML REST Commands
    description: TeXML REST Commands
  - name: TeXML Applications
    description: TeXML Applications operations
paths:
  /texml/calls/{connection_id}:
    post:
      tags:
        - TeXML REST Commands
      summary: Create a connection-scoped TeXML call
      description: >-
        Initiate an outbound TeXML call using a TeXML application connection ID,
        not an account SID. Request parameter names are case-sensitive. From and
        To are required; Texml supplies inline instructions and Url overrides
        the application XML request URL. When neither is supplied, the
        application configuration supplies the instructions. The response is a
        flat call object without a data wrapper.
      operationId: CreateTexmlCall
      parameters:
        - name: connection_id
          in: path
          required: true
          description: The ID of the connection holding the TeXML application to call from.
          schema:
            type: string
          example: '1234567890'
      requestBody:
        required: true
        description: Connection-scoped outbound call parameters.
        content:
          application/json:
            schema:
              type: object
              required:
                - From
                - To
              properties:
                From:
                  type: string
                  description: >-
                    The E.164-formatted phone number or SIP URI to present as
                    the caller.
                  example: '+13120001234'
                To:
                  type: string
                  description: The E.164-formatted phone number or SIP URI to call.
                  example: '+13121230000'
                Texml:
                  type: string
                  description: >-
                    Inline TeXML instructions to execute when the call is
                    answered.
                  example: <Response><Say>Hello</Say></Response>
                Url:
                  type: string
                  description: >-
                    The URL from which to retrieve TeXML instructions. Overrides
                    the TeXML application XML request URL.
                  example: https://example.com/instructions.xml
                Method:
                  type: string
                  enum:
                    - GET
                    - POST
                  description: HTTP method used to retrieve TeXML instructions from Url.
                  example: POST
            example:
              From: '+13120001234'
              To: '+13121230000'
              Texml: <Response><Say>Hello</Say></Response>
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - From
                - To
              properties:
                From:
                  type: string
                  description: >-
                    The E.164-formatted phone number or SIP URI to present as
                    the caller.
                  example: '+13120001234'
                To:
                  type: string
                  description: The E.164-formatted phone number or SIP URI to call.
                  example: '+13121230000'
                Texml:
                  type: string
                  description: >-
                    Inline TeXML instructions to execute when the call is
                    answered.
                  example: <Response><Say>Hello</Say></Response>
                Url:
                  type: string
                  description: >-
                    The URL from which to retrieve TeXML instructions. Overrides
                    the TeXML application XML request URL.
                  example: https://example.com/instructions.xml
                Method:
                  type: string
                  enum:
                    - GET
                    - POST
                  description: HTTP method used to retrieve TeXML instructions from Url.
                  example: POST
            example:
              From: '+13120001234'
              To: '+13121230000'
              Texml: <Response><Say>Hello</Say></Response>
      responses:
        '200':
          description: The outbound call was queued.
          content:
            application/json:
              schema:
                type: object
                required:
                  - call_sid
                  - from
                  - to
                  - status
                properties:
                  call_sid:
                    type: string
                    description: The call control ID of the created call.
                    example: v3:call-control-id
                  from:
                    type: string
                    description: The caller address.
                    example: '+13120001234'
                  to:
                    type: string
                    description: The called address.
                    example: '+13121230000'
                  status:
                    type: string
                    description: The initial status of the outbound call.
                    enum:
                      - queued
                    example: queued
              example:
                call_sid: v3:call-control-id
                from: '+13120001234'
                to: '+13121230000'
                status: queued
        '401':
          $ref: '#/components/responses/UnauthenticatedResponse'
        '422':
          description: A required call parameter is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                errors:
                  - code: '10004'
                    detail: 'Can''t be blank: To'
                    source:
                      pointer: /To
                    title: Missing required parameter
components:
  responses:
    UnauthenticatedResponse:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            Authentication Failed:
              value:
                errors:
                  - code: '10009'
                    title: Authentication failed
                    detail: Could not understand the provided credentials.
                    meta:
                      url: https://developers.telnyx.com/docs/overview/errors/10009
  schemas:
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
              detail:
                type: string
              meta:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
              title:
                type: string
              source:
                type: object
                properties:
                  pointer:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````