Skip to main content
POST
/
external_connections
/
{id}
/
uploads
JavaScript
import Telnyx from 'telnyx';

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

const upload = await client.externalConnections.uploads.create('1293384261075731499', {
  number_ids: [
    '3920457616934164700',
    '3920457616934164701',
    '3920457616934164702',
    '3920457616934164703',
  ],
});

console.log(upload.ticket_id);
import os
from telnyx import Telnyx

client = Telnyx(
    api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
)
upload = client.external_connections.uploads.create(
    id="1293384261075731499",
    number_ids=["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"],
)
print(upload.ticket_id)
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"),
	)
	upload, err := client.ExternalConnections.Uploads.New(
		context.TODO(),
		"1293384261075731499",
		telnyx.ExternalConnectionUploadNewParams{
			NumberIDs: []string{"3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", upload.TicketID)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateParams;
import com.telnyx.sdk.models.externalconnections.uploads.UploadCreateResponse;
import java.util.List;

public final class Main {
    private Main() {}

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

        UploadCreateParams params = UploadCreateParams.builder()
            .id("1293384261075731499")
            .numberIds(List.of(
              "3920457616934164700",
              "3920457616934164701",
              "3920457616934164702",
              "3920457616934164703"
            ))
            .build();
        UploadCreateResponse upload = client.externalConnections().uploads().create(params);
    }
}
require "telnyx"

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

upload = telnyx.external_connections.uploads.create(
  "1293384261075731499",
  number_ids: ["3920457616934164700", "3920457616934164701", "3920457616934164702", "3920457616934164703"]
)

puts(upload)
<?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 {
  $upload = $client->externalConnections->uploads->create(
    '1293384261075731499',
    numberIDs: [
      '3920457616934164700',
      '3920457616934164701',
      '3920457616934164702',
      '3920457616934164703',
    ],
    additionalUsages: ['calling_user_assignment'],
    civicAddressID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
    locationID: '67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2',
    usage: 'first_party_app_assignment',
  );

  var_dump($upload);
} catch (APIException $e) {
  echo $e->getMessage();
}
telnyx external-connections:uploads create \
  --api-key 'My API Key' \
  --id 1293384261075731499 \
  --number-id "'3920457616934164700'" \
  --number-id "'3920457616934164701'" \
  --number-id "'3920457616934164702'" \
  --number-id "'3920457616934164703'"
curl --request POST \
  --url https://api.telnyx.com/v2/external_connections/{id}/uploads \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "number_ids": [
    "3920457616934164700",
    "3920457616934164701",
    "3920457616934164702",
    "3920457616934164703"
  ],
  "usage": "first_party_app_assignment",
  "location_id": "67ea7693-9cd5-4a68-8c76-abb3aa5bf5d2"
}
'
{
  "success": true,
  "ticket_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Identifies the resource.

Example:

"1293384261075731499"

Body

application/json

Parameters that can be set when creating an Upload request.

number_ids
string[]
required
Minimum array length: 1

Phone number ID from the Telnyx API.

usage
enum<string>

The use case of the upload request. NOTE: calling_user_assignment is not supported for toll free numbers.

Available options:
calling_user_assignment,
first_party_app_assignment
additional_usages
enum<string>[]

Additional use cases of the upload request. If not provided, all supported usages will be used.

Available options:
calling_user_assignment,
first_party_app_assignment
location_id
string<uuid>

Identifies the location to assign all phone numbers to.

civic_address_id
string<uuid>

Identifies the civic address to assign all phone numbers to.

Response

Successful response

success
boolean

Describes wether or not the operation was successful

ticket_id
string<uuid>

Ticket id of the upload request