Create a namespace
For guidance and examples, see Manage namespaces.
Note: This operation is not supported for pod-based indexes.
# To get the unique host for an index,
# see https://docs.pinecone.io/guides/manage-data/target-an-index
PINECONE_API_KEY="YOUR_API_KEY"
INDEX_HOST="INDEX_HOST"
curl "https://$INDEX_HOST/namespaces" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Api-Key: $PINECONE_API_KEY" \
-H "X-Pinecone-Api-Version: 2025-10" \
-d '{
"name": "example-namespace",
"schema": {
"fields": {
"document_id": {"filterable": true},
"document_title": {"filterable": true},
"chunk_number": {"filterable": true},
"document_url": {"filterable": true},
"created_at": {"filterable": true}
}
}
}'POST /namespaces
Parameters
Section titled “Parameters”X-Pinecone-Api-Version(header, string, required) — Required date-based version header
Request body
Section titled “Request body”name(body, string, required) — The name of the namespace.schema(body, object) — Schema for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; whenschemais present, only fields which are present in thefieldsobject with afilterable: trueare indexed. Note thatfilterable: falseis not currently supported.
Responses
Section titled “Responses”200— A successful response.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.