curl --request GET \
--url https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"namespace_id": "<string>",
"document_count": 0,
"document_count_complete": true,
"bucket_count": 0,
"collection_count": 0,
"object_count": 0,
"readiness": {
"ready": true,
"next_action": "create_bucket",
"next_action_detail": "<string>",
"collections": [
{
"collection_id": "<string>",
"ready": true,
"collection_name": "<string>",
"document_count": 123,
"batch_state": "none",
"batch_id": "<string>"
}
],
"retrievers": [
{
"retriever_id": "<string>",
"ready": true,
"retriever_name": "<string>",
"reason": "<string>"
}
],
"concepts": {
"layers": [
{
"collection_id": "<string>",
"collection_name": "<string>",
"description": "<string>",
"fields": [
{
"path": "<string>",
"type": "<string>",
"values": [
"<string>"
],
"description": "<string>"
}
],
"features": [
"<string>"
],
"retriever_ids": [
"<string>"
],
"taxonomy_ids": [
"<string>"
]
}
],
"taxonomies": [
{
"taxonomy_id": "<string>",
"taxonomy_name": "<string>",
"taxonomy_type": "<string>",
"labels": [
"<string>"
],
"writes": [
"<string>"
],
"applied_to": [
"<string>"
]
}
]
},
"index_state": "not_reported"
}
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Get Namespace Stats
Returns the counts for one namespace: document_count, bucket_count, collection_count and object_count. When document_count_complete is false, the document count did not finish and document_count is a lower bound. Use this instead of the counts in the list endpoint, which can lag. For many namespaces at once, call POST /v1/namespaces/stats/batch. With include_readiness=true the response also carries readiness: whether a search can return documents yet, each collection’s and retriever’s state, next_action, the one step to take next, and concepts: each collection’s fields with the values they hold, its search features and the retrievers that read it, and each taxonomy’s labels and the fields it writes. Answers 404 when no namespace matches.
Namespaces: A namespace is an isolated workspace that holds your buckets, collections, retrievers, taxonomies and clusters. Its settings decide which feature extractors and payload indexes its collections can use. Most other requests name their namespace in the X-Namespace header. Read the guide.
curl --request GET \
--url https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/namespaces/{namespace_identifier}/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"namespace_id": "<string>",
"document_count": 0,
"document_count_complete": true,
"bucket_count": 0,
"collection_count": 0,
"object_count": 0,
"readiness": {
"ready": true,
"next_action": "create_bucket",
"next_action_detail": "<string>",
"collections": [
{
"collection_id": "<string>",
"ready": true,
"collection_name": "<string>",
"document_count": 123,
"batch_state": "none",
"batch_id": "<string>"
}
],
"retrievers": [
{
"retriever_id": "<string>",
"ready": true,
"retriever_name": "<string>",
"reason": "<string>"
}
],
"concepts": {
"layers": [
{
"collection_id": "<string>",
"collection_name": "<string>",
"description": "<string>",
"fields": [
{
"path": "<string>",
"type": "<string>",
"values": [
"<string>"
],
"description": "<string>"
}
],
"features": [
"<string>"
],
"retriever_ids": [
"<string>"
],
"taxonomy_ids": [
"<string>"
]
}
],
"taxonomies": [
{
"taxonomy_id": "<string>",
"taxonomy_name": "<string>",
"taxonomy_type": "<string>",
"labels": [
"<string>"
],
"writes": [
"<string>"
],
"applied_to": [
"<string>"
]
}
]
},
"index_state": "not_reported"
}
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings → API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing, malformed, unknown, revoked, inactive or expired key returns 401; a key without the permission, scope or plan an operation needs returns 403.
Path Parameters
Query Parameters
Also return readiness: whether the namespace can answer a search yet and the next step, with the concepts an agent plans a query from. Reads the namespace's collections, newest batches, retrievers, taxonomies and a sample of 50 documents per collection, so leave it off when you only need counts.
Response
Successful Response
Per-namespace statistics (counts) returned by the stats endpoint.
Total number of documents in this namespace. With document_count_complete false the count did not finish: this is null when nothing was counted, or a lower bound (the documents counted before it stopped). It is never 0 for a count that did not finish, so 0 always means an empty namespace.
Was this page helpful?

