Skip to main content
GET
Count documents in a collection.

Authorizations

Authorization
string
header
required

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 header returns 403; an invalid or revoked key returns 401.

X-Namespace
string
header
required

Namespace id (ns_...), not the namespace name. This scopes the request rather than authenticating it, and it is required on every operation marked x-mixpeek-namespace-scoped.

Path Parameters

collection_identifier
string
required

The ID of the collection to count documents in.

Response

Successful Response

Response model for the document-count endpoint.

Returned by GET /v1/collections/{collection_id}/documents/count — the obvious REST guess for "how many documents are in this collection?" that previously 404'd (the literal count segment was matched as a {document_id}). See FRUSTRATIONS 2026-06-29.

collection_id
string
required

The collection the count is for (resolved id).

count
integer
required

Total number of documents in the collection.