Every Closient API resource accepts aDocumentation Index
Fetch the complete documentation index at: https://docs.closient.com/llms.txt
Use this file to discover all available pages before exploring further.
metadata field — a flat dict of string keys and string values you can attach to bridge our objects to your own systems (internal IDs, workflow state, audit info, A/B-test buckets, feature flags, anything).
Closient never reads metadata for behavior. It’s opaque developer storage, by design — the same trust contract Stripe makes about its metadata. We won’t key any feature, billing, search ranking, or default behavior off the contents.
Shape
- Type: flat dict, string keys mapped to string values. No nested objects, no arrays, no booleans, no numbers. If you want structured data, serialize it yourself (e.g. JSON-encode and store the string).
- Default:
{}— nevernull. The field is always present in responses.
Limits
| Limit | Value |
|---|---|
| Max keys per object | 50 |
| Max key length | 40 characters |
| Max value length | 500 characters |
422 Unprocessable Entity with a descriptive error_code: validation_error envelope.
Reading metadata
Every read response includesmetadata:
{}.
Writing metadata
Sendmetadata to the regular PATCH /v1/{resource}/{id} endpoint. There’s no separate metadata sub-endpoint — that’s how Stripe does it and we match.
Set or overwrite a key
Merge semantics — only changed keys are sent
metadata updates are always merge, never replace. Send only the keys you’re changing; everything else is preserved.
warehouse=west and leaves any other existing keys untouched.
Delete a key — empty-string value
Clear all metadata
Two equivalent forms:Combined: set, delete, leave-alone in one request
internal_sku to a new value, deletes warehouse, and adds campaign_id. Any other existing key is left alone.
Form-encoded shorthand
For curl-style usage, themetadata[key]=value form-encoded shorthand is also accepted:
metadata= (no [key]) clears all metadata.
Webhooks
{resource}.updated webhook events include the full updated metadata. Setting/deleting keys triggers the standard updated event — there’s no separate metadata.updated event type.
Resources that support metadata
Every CRUD-API resource in the Closient API supportsmetadata as of C-2699:
- Products, Brands, Substances
- Retailers, Offers (in-store + online), Promotions
- Webhook Endpoints, Resolver Rules
- Organizations, Users, API Keys, Service Accounts
- Locations, Campaigns, Scan Sessions, Voice Feedback Sessions
- Certifications and Claims
Common patterns
Stamp every object with your internal ID
metadata["erp_id"].
Track migration progress
metadata values must be strings.)
A/B test bucketing
Cleanup of stale keys
What metadata is NOT for
- Identifiers Closient should look up. If you want us to find an object by your ID, that’s a different feature (deep search) — we don’t index
metadatafor behavioral lookups. - Sensitive data. While transport is HTTPS,
metadatapayloads are stored in our database with the rest of the resource and visible to anyone who can read the resource. Don’t put secrets, PII you don’t already share with us, or anything you wouldn’t put in ournamefield. - Schema-heavy data. If you find yourself building rich structures inside
metadata, that’s a sign you want a real schema — talk to us about a first-class field on the resource.