> ## 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 new queue

> Creates a new queue resource.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/texml/queues.yml post /texml/Accounts/{account_sid}/Queues
openapi: 3.1.0
info:
  title: Telnyx TeXML Queues API
  version: 2.0.0
  description: API for managing TeXML Queues.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
tags:
  - name: Command
    description: TeXML command operations
  - name: Callbacks
    description: Webhook callbacks for call events
paths:
  /texml/Accounts/{account_sid}/Queues:
    post:
      tags:
        - TeXML REST Commands
      summary: Create a new queue
      description: Creates a new queue resource.
      operationId: CreateTexmlQueue
      parameters:
        - $ref: '#/components/parameters/AccountSid'
      requestBody:
        description: Create Queue request object
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/call-scripting_CreateQueueRequest'
      responses:
        '200':
          $ref: '#/components/responses/GetQueueResponse'
        '404':
          $ref: '#/components/responses/call-scripting_NotFoundResponse'
      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 queue = await
            client.texml.accounts.queues.create('account_sid');


            console.log(queue.account_sid);
        - 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
            )
            queue = client.texml.accounts.queues.create(
                account_sid="account_sid",
            )
            print(queue.account_sid)
        - 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\tqueue, err := client.Texml.Accounts.Queues.New(\n\t\tcontext.TODO(),\n\t\t\"account_sid\",\n\t\ttelnyx.TexmlAccountQueueNewParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", queue.AccountSid)\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.texml.accounts.queues.QueueCreateParams;

            import
            com.telnyx.sdk.models.texml.accounts.queues.QueueCreateResponse;


            public final class Main {
                private Main() {}

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

                    QueueCreateResponse queue = client.texml().accounts().queues().create("account_sid");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

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

            queue = telnyx.texml.accounts.queues.create("account_sid")

            puts(queue)
        - lang: CLI
          source: |-
            telnyx texml:accounts:queues create \
              --api-key 'My API Key' \
              --account-sid account_sid
components:
  parameters:
    AccountSid:
      name: account_sid
      in: path
      required: true
      description: The id of the account the resource belongs to.
      schema:
        type: string
  schemas:
    call-scripting_CreateQueueRequest:
      type: object
      title: Create Queue Request
      properties:
        MaxSize:
          type: integer
          description: The maximum size of the queue.
          example: 10
        FriendlyName:
          description: A human readable name for the queue.
          example: Support Queue
          type: string
      example:
        MaxSize: 10
        FriendlyName: Support Queue
    QueueResource:
      type: object
      title: Queue resource
      example:
        account_sid: 4e71926f-8f13-450e-b91c-23c2ef786aa6
        average_wait_time: 30
        current_size: 3
        date_created: Fri, 27 Oct 2023 07:41:58 +0000
        date_updated: Fri, 27 Oct 2023 07:41:58 +0000
        max_size: 10
        sid: my-queue
        uri: /Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json
        subresource_uris:
          members: >-
            /Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json
      properties:
        account_sid:
          type: string
          description: The id of the account the resource belongs to.
          example: 4e71926f-8f13-450e-b91c-23c2ef786aa6
        average_wait_time:
          type: integer
          description: The average wait time in seconds for members in the queue.
          example: 30
        current_size:
          type: integer
          description: The current number of members in the queue.
          example: 3
        date_created:
          type: string
          description: The timestamp of when the resource was created.
          example: Fri, 27 Oct 2023 07:41:58 +0000
        date_updated:
          type: string
          description: The timestamp of when the resource was last updated.
          example: Fri, 27 Oct 2023 07:41:58 +0000
        max_size:
          type: integer
          description: The maximum size of the queue.
          example: 10
        sid:
          type: string
          description: The unique identifier of the queue.
          example: my-queue
        uri:
          type: string
          description: The relative URI for this queue.
          example: /Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json
        subresource_uris:
          type: object
          description: A list of related resources identified by their relative URIs.
          example:
            members: >-
              /Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json
          additionalProperties: true
    call-scripting_ResourceNotFoundError:
      type: object
      title: Resource not found
      example:
        errors:
          - detail: Resource not found
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
  responses:
    GetQueueResponse:
      description: Queue resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QueueResource'
    call-scripting_NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/call-scripting_ResourceNotFoundError'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````