pydo.functions.create_namespace()

Generated on 8 May 2026 from pydo version v0.34.0

Usage

client.functions.create_namespace(
    body={
        "region": "nyc1",
        "label": "my namespace",
    },
)
Returns JSONRaises HttpResponseError

Description

Creates a new serverless functions namespace in the desired region and associates it with the provided label. A namespace is a collection of functions and their associated packages, triggers, and project specifications. To create a namespace, send a POST request to /v2/functions/namespaces with the region and label properties.

Parameters

region string required

Example: nyc1

The datacenter region in which to create the namespace.

label string required

Example: my namespace

The namespace's unique name.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "region": "nyc1",
  "label": "my namespace"
}

resp = client.functions.create_namespace(body=req)

Response Example

Show Response Example
{
  "namespace": {
    "api_host": "https://api_host.io",
    "namespace": "fn-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "created_at": "2022-09-14T04:16:45Z",
    "updated_at": "2022-09-14T04:16:45Z",
    "label": "my namespace",
    "region": "nyc1",
    "uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "key": "d1zcd455h01mqjfs4s2eaewyejehi5f2uj4etqq3h7cera8iwkub6xg5of1wdde2"
  }
}

More Information

See /v2/functions/namespaces in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.