Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

List namespaces

List all namespaces in a serverless index.

Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the limit parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response includes pagination.next, a token you pass as paginationToken to get the next batch of namespaces. When the response has no pagination, there are no more namespaces to return.

For guidance and examples, see Manage namespaces.

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

curl
# 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 "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2026-07"

GET /namespaces

200
{
  "namespaces": [
    {
      "name": "example-namespace",
      "record_count": "20000",
      "schema": {
        "fields": {
          "description": {
            "filterable": true
          },
          "genre": {
            "filterable": true
          },
          "year": {
            "filterable": true
          }
        }
      },
      "indexed_fields": {
        "fields": [
          "genre",
          "year",
          "author"
        ]
      },
      "size_bytes": "1048576"
    }
  ],
  "pagination": {
    "next": "Tm90aGluZyB0byBzZWUgaGVyZQo="
  },
  "total_count": 25
}
400
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
4XX
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
5XX
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
Api-Keystringrequired

An API Key is required to call Pinecone APIs. Get yours from the console.

X-Pinecone-Api-Versionstringrequired

Required date-based version header

Typestring
Default2026-07
limit?integer

Max number of namespaces to return per page. Defaults to 100.

Required range: 1 <= x <= 100

Typeinteger
Default100
paginationToken?string

Pagination token to continue a previous listing operation.

Typestring
prefix?string

Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. Must be ASCII and must not contain the NUL character, matching the namespace names it filters. An empty prefix matches every namespace.

Required string length: 0 - 512

Typestring

200 — A successful response

namespaces?object[]

The list of namespaces belonging to this index.

Typeobject[]
Show child attributes
name?string

The name of the namespace.

Example: example-namespace

Typestring
record_count?string

The total number of records in the namespace. A 64-bit integer, serialized as a decimal string.

Example: 20000

Typestring
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.

Typeobject
Show child attributes
fields?object

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. At most 50 fields may be declared. Field names may not begin with $, which introduces a filter operator. When declared at index creation, names beginning with _ are also rejected (reserved for internal use).

Typeobject
indexed_fields?object

A list of all indexed metatadata fields in the namespace

Typeobject
Show child attributes
fields?string[]
size_bytes?string

The total size of the namespace's data, in bytes, as a 64-bit integer serialized as a decimal string. Approximate: data written before size tracking reads as 0, and recently deleted data may still be counted; compaction converges the value.

Example: 1048576

Typestring
pagination?object
Show child attributes
nextstringrequired

Example: Tm90aGluZyB0byBzZWUgaGVyZQo=

Typestring
total_count?integer

The total number of namespaces in the index matching the prefix

Example: 25

Typeinteger
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu