Skip to main content
POST
/
storage
/
kvs
JavaScript
import Telnyx from 'telnyx';

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

const KvNamespaceResponseWrapper = await client.storage.kvs.create({
  name: 'my-cache',
});

console.log(KvNamespaceResponseWrapper.data);
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
kv_namespace_response_wrapper = client.storage.kvs.create(
name="my-cache",
)
print(kv_namespace_response_wrapper.data)
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"),
)
kv, err := client.Storage.Kvs.New(
context.TODO(),
telnyx.StorageKvsNewParams{,
Name: telnyx.String("my-cache"),,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", kv.Data)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

public final class Main {
private Main() {}

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

Params params = Params.builder()
.name("my-cache")
.build();
KvNamespaceResponseWrapper response = client.storage()kvs()create(params);
}
}
require "telnyx"

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

kv_namespace_response_wrapper = telnyx.storage.kvs.create(name: "my-cache")

puts(kv_namespace_response_wrapper)
<?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 {
$kv_namespace_response_wrapper = $client->storage->kvs->create(
name: 'my-cache',
);

var_dump($kv_namespace_response_wrapper);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx storage:kvs create \
--api-key 'My API Key' \
--name my-cache
curl --request POST \
--url https://api.telnyx.com/v2/storage/kvs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-cache"
}
'
{
  "data": {
    "record_type": "storage_kv",
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "my-cache",
    "status": "provision_ok",
    "created_at": "2026-06-18T14:48:17Z",
    "updated_at": "2026-06-18T14:48:17Z"
  }
}
{
"errors": [
{
"code": "10005",
"detail": "The requested function does not exist or you don't have access to it",
"meta": {
"url": "https://docs.telnyx.com/api/errors/10005"
},
"source": {
"parameter": "id",
"pointer": "/id"
},
"title": "Function not found"
}
]
}
{
"errors": [
{
"code": "10005",
"detail": "The requested function does not exist or you don't have access to it",
"meta": {
"url": "https://docs.telnyx.com/api/errors/10005"
},
"source": {
"parameter": "id",
"pointer": "/id"
},
"title": "Function not found"
}
]
}
{
"errors": [
{
"code": "10005",
"detail": "The requested function does not exist or you don't have access to it",
"meta": {
"url": "https://docs.telnyx.com/api/errors/10005"
},
"source": {
"parameter": "id",
"pointer": "/id"
},
"title": "Function not found"
}
]
}
{
"errors": [
{
"code": "10005",
"detail": "The requested function does not exist or you don't have access to it",
"meta": {
"url": "https://docs.telnyx.com/api/errors/10005"
},
"source": {
"parameter": "id",
"pointer": "/id"
},
"title": "Function not found"
}
]
}

Authorizations

Authorization
string
header
required

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

Body

application/json

KV namespace creation request

name
string
required

Namespace name. May contain lowercase letters, numbers, and hyphens only.

Required string length: 1 - 255
Pattern: ^[a-z0-9-]+$
Example:

"my-cache"

Response

KV namespace created successfully

data
object