Skip to main content
POST
/
custom_storage_credentials
/
{connection_id}
JavaScript
import Telnyx from 'telnyx';

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

const customStorageCredential = await client.customStorageCredentials.create('connection_id', {
  backend: 'gcs',
  configuration: { backend: 'gcs' },
});

console.log(customStorageCredential.connection_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
)
custom_storage_credential = client.custom_storage_credentials.create(
connection_id="connection_id",
backend="gcs",
configuration={
"backend": "gcs"
},
)
print(custom_storage_credential.connection_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"),
)
customStorageCredential, err := client.CustomStorageCredentials.New(
context.TODO(),
"connection_id",
telnyx.CustomStorageCredentialNewParams{
CustomStorageConfiguration: telnyx.CustomStorageConfigurationParam{
Backend: telnyx.CustomStorageConfigurationBackendGcs,
Configuration: telnyx.CustomStorageConfigurationConfigurationUnionParam{
OfGcs: &telnyx.GcsConfigurationDataParam{
Backend: telnyx.GcsConfigurationDataBackendGcs,
},
},
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customStorageCredential.ConnectionID)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.customstoragecredentials.CustomStorageConfiguration;
import com.telnyx.sdk.models.customstoragecredentials.CustomStorageCredentialCreateParams;
import com.telnyx.sdk.models.customstoragecredentials.CustomStorageCredentialCreateResponse;
import com.telnyx.sdk.models.customstoragecredentials.GcsConfigurationData;

public final class Main {
private Main() {}

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

CustomStorageCredentialCreateParams params = CustomStorageCredentialCreateParams.builder()
.connectionId("connection_id")
.customStorageConfiguration(CustomStorageConfiguration.builder()
.backend(CustomStorageConfiguration.Backend.GCS)
.configuration(GcsConfigurationData.builder()
.backend(GcsConfigurationData.Backend.GCS)
.build())
.build())
.build();
CustomStorageCredentialCreateResponse customStorageCredential = client.customStorageCredentials().create(params);
}
}
require "telnyx"

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

custom_storage_credential = telnyx.custom_storage_credentials.create("connection_id", backend: :gcs, configuration: {backend: :gcs})

puts(custom_storage_credential)
<?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 {
$customStorageCredential = $client->customStorageCredentials->create(
'connection_id',
backend: 'gcs',
configuration: [
'backend' => 'gcs',
'bucket' => 'example-bucket',
'credentials' => 'OPAQUE_CREDENTIALS_TOKEN',
],
);

var_dump($customStorageCredential);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx custom-storage-credentials create \
--api-key 'My API Key' \
--connection-id connection_id \
--backend gcs \
--configuration '{backend: gcs}'
curl --request POST \
--url https://api.telnyx.com/v2/custom_storage_credentials/{connection_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"backend": "gcs",
"configuration": {
"backend": "gcs",
"credentials": "OPAQUE_CREDENTIALS_TOKEN",
"bucket": "example-bucket"
}
}
'
{
  "data": {
    "backend": "gcs",
    "configuration": {
      "backend": "gcs",
      "credentials": "OPAQUE_CREDENTIALS_TOKEN",
      "bucket": "example-bucket"
    }
  },
  "connection_id": "1234567890",
  "record_type": "custom_storage_credentials"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

connection_id
string
required

Uniquely identifies a Telnyx application (Call Control, TeXML) or Sip connection resource.

Body

application/json

Creates new credentials resource for the specified connection_id.

backend
enum<string>
required
Available options:
gcs,
s3,
azure
Example:

"gcs"

configuration
Google Cloud Storage Configuration Data · object
required

Response

A response containing a credentials resource.

data
Custom Storage Configuration · object
required
connection_id
string
required

Uniquely identifies a Telnyx application (Call Control, TeXML) or Sip connection resource.

Example:

"1234567890"

record_type
enum<string>
required

Identifies record type.

Available options:
custom_storage_credentials