---
title: "Create a namespace"
method: POST
path: "/namespaces"
tags: ["Namespace Operations"]
---

# Create a namespace

`POST /namespaces`

Create a namespace in a serverless index.

For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces).

**Note:** This operation is not supported for pod-based indexes.

## Headers

- `X-Pinecone-Api-Version` string, required

## Request body

- DbDataCreateNamespaceRequest — A request for creating a namespace with the specified namespace name.
  - `name` string, required — The name of the namespace.
  - `schema` object — Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `schema` is present, only fields which are present in the `fields` object with a `filterable: true` are indexed. Note that `filterable: false` is not currently supported.
    - `fields` object, required — A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique.

## Response `200`

A successful response.

- DbDataNamespaceDescription — A description of a namespace, including the name and record count.
  - `name` string — The name of the namespace.
  - `record_count` integer — The total amount of records within the namespace.
  - `schema` object — Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `schema` is present, only fields which are present in the `fields` object with a `filterable: true` are indexed. Note that `filterable: false` is not currently supported.
    - `fields` object, required — A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique.
  - `indexed_fields` object — A list of all indexed metatadata fields in the namespace
    - `fields` string[]

## Other responses

- `400` — Bad request. The request body included invalid request parameters.
- `409` — Namespace of the given name already exists on the index.
- `4XX` — An unexpected error response.
- `5XX` — An unexpected error response.

---

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