---
title: "Create Namespace"
method: POST
path: "/v2/functions/namespaces"
tags: ["DigitalOcean-public.v2-new_Functions"]
---

# Create Namespace

`POST /v2/functions/namespaces`

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.

## Request body

- CreateNamespace
  - `region` string, required — The [datacenter region](https://docs.digitalocean.com/products/platform/availability-matrix/#available-datacenters) in which to create the namespace.
  - `label` string, required — The namespace's unique name.

## Response `200`

A JSON response object with a key called `namespace`. The object contains the properties associated
with the namespace.

- object
  - `namespace` NamespaceInfo
    - `api_host` string — The namespace's API hostname. Each function in a namespace is provided an endpoint at the namespace's hostname.
    - `namespace` string — A unique string format of UUID with a prefix fn-.
    - `created_at` string — UTC time string.
    - `updated_at` string — UTC time string.
    - `label` string — The namespace's unique name.
    - `region` string — The namespace's datacenter region.
    - `uuid` string — The namespace's Universally Unique Identifier.
    - `key` string — A random alpha numeric string. This key is used in conjunction with the namespace's UUID to authenticate a user to use the namespace via `doctl`, DigitalOcean's official CLI.

## Other responses

- `401` — Authentication failed due to invalid credentials.
- `404` — Bad Request.
- `422` — Limit Reached
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/versions/cb3bf9b21459/schema)
