Update document metadata
PATCH a document to change its fields. The body is a partial update: send only the fields you want to change; you never resend vectors. Any fields you pass are merged into the document.
Set and remove metadata keys
PUT and PATCH treat metadata the same way. Each key you send is set on the stored
metadata. Keys you omit stay as they are. A key set to null is removed.
metadata.status and removes metadata.stale_field. Every other metadata key
is untouched. A PUT behaves the same way, so a key missing from a PUT body stays.
Where each key lands
A key insidemetadata updates metadata.<key>. A key at the top level of the body
updates the document’s own top-level field of that name. They are separate fields: a
field your collection copies onto the document (a passthrough field such as brand_id)
sits at the top level, so change it by sending it at the top level:
{"metadata": {"brand_id": "brand-b"}} would instead add metadata.brand_id and leave
the top-level brand_id as it was. The response is the whole document, so you can see
which field changed.
"metadata": null returns a 422. To remove keys, name each one with a null value.
To update many documents at once, use PATCH /v1/collections/{collection_id}/documents/bulk.
Send update_data with the field-value pairs to apply, and filters to choose which
documents receive them. Omitting filters updates every document in the collection.
Object fields come back with their keys in alphabetical order. A field written as
{"SKUs": ..., "source": ..., "Keywords": ...} reads back from documents/list and retriever results as {"Keywords": ..., "SKUs": ..., "source": ...}. The values are unchanged. If you show an object’s fields in a set order, keep that order in your application.Updating metadata does not re-run extraction or change vectors. It only edits the stored payload. To change the embedding model, see Migrate Embedding Models.
PATCH /v1/collections/{collection_id}/documents/{document_id}/acl; see Permissions.
Object metadata vs document metadata are separate. The
PATCH above edits a document (a processed, searchable record in a collection). To edit the source object in the bucket, use PATCH /v1/buckets/{bucket_id}/objects/{object_id} and send the object’s custom fields flat at the root of the body, for example {"campaign_id": "camp_002"}. Only the fields you send change. An object created with a metadata object keeps its fields there, and {"metadata": {"tag": "new"}} sets metadata.tag and leaves its other keys as they are. Editing one does not change the other, and re-processing an object regenerates its documents from the object’s current state.Delete data
A namespace under a hold refuses every delete in this table until the hold ends. On an Enterprise plan, Mixpeek takes a
pre_delete snapshot before it deletes a namespace.
Deleting many documents
DELETE /v1/collections/{collection_id}/documents/batch takes document_ids or
filters, and the two are mutually exclusive. Which one you send decides whether the
call is synchronous, so the response shape differs between them.
reason is optional on both modes and is recorded on the DOCUMENT_BULK_SOFT_DELETED
audit entry.
Synced sources
If documents came from a storage sync, the sync’sreconcile.on_delete is true by default, so deleting a file in the source (S3, Google Drive, etc.) automatically removes the corresponding object and its derived documents. Set reconcile.on_delete to false to keep Mixpeek objects when the source asset is deleted.
Expire or hold a namespace
Expire a namespace
Setttl_seconds (60 or more) or expires_at on create or with PATCH /v1/namespaces/{namespace_id}, and Mixpeek deletes the namespace at that time. Send one of the two, not both. Send null to remove the expiry.
namespace_expiring event in the namespace’s mxp_platform_events collection. The namespace is deleted only after that warning is an hour old, so you can still move or remove the expiry.
Hold a namespace’s data
A hold keeps a namespace’s data until a date, for example under a legal or contractual obligation. While it is in force:- No document, file, collection or bucket in the namespace can be deleted, and neither can the namespace.
- No stored document’s customer fields can change.
- New documents can still be added.
PATCH /v1/namespaces/{namespace_id} and a hold of {reason, until}:
- Setting or extending a hold needs an API key with admin permission.
untilmust include a timezone and be at most 100 years ahead.- You can move
untillater. A hold in force cannot be shortened or removed; the request gets a 409. - Send
"hold": nullto remove a hold that has ended. - A namespace with an expiry cannot take a hold. Remove the expiry first.
- The hold needs Mixpeek-managed storage that supports holds. An organization whose storage cannot hold files gets a 400 that names its storage backend.
Related
- Documents: document structure and payload
- Syncs: source-deletion cascade (
on_delete) - Ingest Data: objects, batches, collections

