> ## 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 KV namespace

> Creates a new KV namespace. Provisioning is asynchronous: the namespace is returned with status `pending` and becomes usable once it reaches `provision_ok`.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/edge-compute.yml post /storage/kvs
openapi: 3.1.0
info:
  title: Telnyx Edge Compute API
  version: 2.0.0
  description: API for Edge Compute key-value storage (namespaces and keys).
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /storage/kvs:
    post:
      tags:
        - kv namespaces
      summary: Create a KV namespace
      description: >-
        Creates a new KV namespace. Provisioning is asynchronous: the namespace
        is returned with status `pending` and becomes usable once it reaches
        `provision_ok`.
      operationId: CreateKvNamespace
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKvNamespaceRequest'
        description: KV namespace creation request
        required: true
      responses:
        '201':
          description: KV namespace created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KvNamespaceResponseWrapper'
        '400':
          description: Bad request — missing or invalid `name`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '409':
          description: >-
            Conflict — a namespace with this name already exists for your
            organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/edge-compute_Errors'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericErrorResponse'
      security:
        - bearerAuth: []
      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 KvNamespaceResponseWrapper = await client.storage.kvs.create({
              name: 'my-cache',
            });

            console.log(KvNamespaceResponseWrapper.data);
        - 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
            )
            kv_namespace_response_wrapper = client.storage.kvs.create(
                name="my-cache",
            )
            print(kv_namespace_response_wrapper.data)
        - 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\tkv, err := client.Storage.Kvs.New(\n\t\tcontext.TODO(),\n\t\ttelnyx.StorageKvsNewParams{,\n\t\t\t\tName: telnyx.String(\"my-cache\"),,\n\t\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", kv.Data)\n}\n"
        - lang: Java
          source: |-
            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);
                }
            }
        - lang: Ruby
          source: >-
            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)
        - lang: PHP
          source: >-
            <?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();
            }
        - lang: CLI
          source: |-
            telnyx storage:kvs create \
              --api-key 'My API Key' \
              --name my-cache
components:
  schemas:
    CreateKvNamespaceRequest:
      type: object
      properties:
        name:
          type: string
          description: >-
            Namespace name. May contain lowercase letters, numbers, and hyphens
            only.
          pattern: ^[a-z0-9-]+$
          minLength: 1
          maxLength: 255
          example: my-cache
      required:
        - name
    KvNamespaceResponseWrapper:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/KvNamespace'
    edge-compute_Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/edge-compute_Error'
    GenericErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/edge-compute_Error'
    KvNamespace:
      type: object
      properties:
        record_type:
          type: string
          example: storage_kv
        id:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        name:
          type: string
          example: my-cache
        status:
          type: string
          description: >-
            Provisioning status. A namespace is usable once `status` is
            `provision_ok`. Once deletion completes, the namespace no longer
            appears in the API.
          enum:
            - pending
            - provision_ok
            - provision_failed
            - deleting
            - delete_failed
          example: provision_ok
        created_at:
          type: string
          format: date-time
          example: '2026-06-18T14:48:17Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-06-18T14:48:17Z'
    edge-compute_Error:
      type: object
      properties:
        code:
          type: string
          example: '10005'
        detail:
          type: string
          example: The requested function does not exist or you don't have access to it
        meta:
          $ref: '#/components/schemas/ErrorMeta'
        source:
          $ref: '#/components/schemas/ErrorSource'
        title:
          type: string
          example: Function not found
    ErrorMeta:
      type: object
      properties:
        url:
          type: string
          example: https://docs.telnyx.com/api/errors/10005
    ErrorSource:
      type: object
      properties:
        parameter:
          type: string
          example: id
        pointer:
          type: string
          example: /id
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````