Skip to main content
POST
/
v1
/
namespaces
Create Namespace
curl --request POST \
  --url https://api.mixpeek.com/v1/namespaces \
  --header 'Content-Type: application/json' \
  --data '{
  "namespace_name": "spotify_playlists_dev",
  "description": "This namespace contains playlists from Spotify",
  "feature_extractors": [
    {
      "feature_extractor_id": "video_extractor_1.0.0",
      "feature_extractor_name": "video_extractor",
      "version": "1.0.0"
    }
  ],
  "payload_indexes": [
    {
      "field_name": "metadata.title",
      "field_schema": {
        "lowercase": true,
        "max_token_len": 15,
        "min_token_len": 2,
        "tokenizer": "word",
        "type": "text"
      },
      "type": "text"
    },
    {
      "field_name": "metadata.description",
      "field_schema": {
        "is_tenant": true,
        "type": "keyword"
      },
      "type": "keyword"
    }
  ]
}'
{
  "namespace_id": "<string>",
  "namespace_name": "spotify_playlists_dev",
  "description": "<string>",
  "feature_extractors": [
    {
      "feature_extractor_name": "<string>",
      "version": "<string>",
      "feature_extractor_id": "<string>"
    }
  ],
  "payload_indexes": [
    {
      "field_name": "<string>",
      "type": "keyword",
      "field_schema": {
        "type": "text",
        "tokenizer": "word",
        "min_token_len": 2,
        "max_token_len": 15,
        "lowercase": true
      }
    }
  ]
}

Headers

Authorization
string | null

Bearer token authentication using your API key. Format: 'Bearer your_api_key'. To get an API key, create an account at mixpeek.com/start and generate a key in your account settings. Example: 'Bearer sk_1234567890abcdef'

Body

application/json

Request schema for creating a new namespace.

namespace_name
string
required

Name of the namespace to create

Example:

"spotify_playlists_dev"

feature_extractors
BaseFeatureExtractorModel · object[]
required

List of feature extractors to use. At least one feature extractor must be provided.

Minimum length: 1
Example:
[
{
"feature_extractor_id": "video_extractor_1.0.0",
"feature_extractor_name": "video_extractor",
"version": "1.0.0"
}
]
description
string | null

Description of the namespace

Example:

"This namespace contains playlists from Spotify"

payload_indexes
PayloadIndexConfig · object[] | null

Optional list of custom payload index configurations. Indexes required by selected feature extractors will be added automatically.

Example:
[
{
"field_name": "metadata.title",
"field_schema": {
"lowercase": true,
"max_token_len": 15,
"min_token_len": 2,
"tokenizer": "word",
"type": "text"
},
"type": "text"
},
{
"field_name": "metadata.description",
"field_schema": { "is_tenant": true, "type": "keyword" },
"type": "keyword"
}
]

Response

Successful Response

Namespace model.

namespace_name
string
required

Name of the namespace

Example:

"spotify_playlists_dev"

namespace_id
string

Unique identifier for the namespace

description
string | null

Description of the namespace

feature_extractors
BaseFeatureExtractorModel · object[]

List of feature extractors configured for this namespace

payload_indexes
PayloadIndexConfig · object[] | null

Custom payload indexes configured for this namespace

I