Skip to main content
POST
/
texml
/
Accounts
/
{account_sid}
/
Queues
JavaScript
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);
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)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
queue, err := client.Texml.Accounts.Queues.New(
context.TODO(),
"account_sid",
telnyx.TexmlAccountQueueNewParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", queue.AccountSid)
}
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");
}
}
require "telnyx"

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

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

puts(queue)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$queue = $client->texml->accounts->queues->create(
'account_sid', friendlyName: 'Support Queue', maxSize: 10
);

var_dump($queue);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx texml:accounts:queues create \
--api-key 'My API Key' \
--account-sid account_sid
curl --request POST \
--url https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Queues \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data MaxSize=10 \
--data 'FriendlyName=Support Queue'
{
  "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"
  }
}
{
"errors": [
{
"detail": "Resource not found"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_sid
string
required

The id of the account the resource belongs to.

Body

application/x-www-form-urlencoded

Create Queue request object

MaxSize
integer

The maximum size of the queue.

Example:

10

FriendlyName
string

A human readable name for the queue.

Example:

"Support Queue"

Response

Queue resource.

account_sid
string

The id of the account the resource belongs to.

Example:

"4e71926f-8f13-450e-b91c-23c2ef786aa6"

average_wait_time
integer

The average wait time in seconds for members in the queue.

Example:

30

current_size
integer

The current number of members in the queue.

Example:

3

date_created
string

The timestamp of when the resource was created.

Example:

"Fri, 27 Oct 2023 07:41:58 +0000"

date_updated
string

The timestamp of when the resource was last updated.

Example:

"Fri, 27 Oct 2023 07:41:58 +0000"

max_size
integer

The maximum size of the queue.

Example:

10

sid
string

The unique identifier of the queue.

Example:

"my-queue"

uri
string

The relative URI for this queue.

Example:

"/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue.json"

subresource_uris
object

A list of related resources identified by their relative URIs.

Example:
{
"members": "/Accounts/4e71926f-8f13-450e-b91c-23c2ef786aa6/Queues/my-queue/Members.json"
}