For guidance and examples, see [Manage namespaces](/guides/manage-data-manage-namespaces).

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

:::code-group
```bash 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 "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Api-Key: $PINECONE_API_KEY" \
  -H "X-Pinecone-Api-Version: 2026-07" \
  -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`

:::code-group
```json title="200"
{
  "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"
}
```

```json title="400"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="409"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="4XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```

```json title="5XX"
{
  "code": 123,
  "message": "<string>",
  "details": [
    {
      "typeUrl": "<string>",
      "value": "<string>"
    }
  ]
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Api-Key` | `string` | - |  |

An API Key is required to call Pinecone APIs. Get yours from the [console](https://app.pinecone.io/).

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version` | `string` | `2026-07` | Required date-based version header |

#### Body

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` | - | The name of the namespace. Must be ASCII, must not contain the NUL character, and must be 1-512 characters long. __default__ is reserved: it names the namespace requests address when they omit a namespace, so it always exists and cannot be created explicitly. Required string length: 1 - 512. Example: example-namespace |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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). |
:::

#### Response

`200` — A successful response.

A description of a namespace, including the name and record count.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name?` | `string` | - | The name of the namespace. Example: example-namespace |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `record_count?` | `string` | - | The total number of records in the namespace. A 64-bit integer, serialized as a decimal string. Example: 20000 |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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. |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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). |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `indexed_fields?` | `object` | - | A list of all indexed metatadata fields in the namespace |

:::accordion{title="Show child attributes"}
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `fields?` | `string[]` | - |  |
:::

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `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 |

## Related pages

- [List namespaces](./database-data-plane-listnamespaces.md)
- [Describe a namespace](./database-data-plane-describenamespace.md)
- [Delete a namespace](./database-data-plane-deletenamespace.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
