publish_label_dimensions
Merge add/update/delete operations onto published label dimensions, then replace the stored document (one feature-engineering refresh, about 10 minutes). Input is operations[], never the full labels array — sibling labels you do not mention are kept. add: sourceKeys (required), optional name/maps (id is generated). update/delete: target by id from list_label_dimensions (or an id created by an earlier add in the same array). Duplicate sourceKeys across labels are rejected; move a key with update on the owner in the same array. Names must be unique across labels and virtual dimension bqNames (default name is a sanitized sourceKeys[0]); a collision rejects the whole operations array — send a different unique name. Deleting a label and adding it back (same name or sourceKeys) in the same array is allowed, in either order. dryRun defaults true (preview the full next labels document, no write). Persist once with dryRun: false and confirm: true. Check list_label_dimension_usages before rename or delete. Demo orgs are read-only; dimensionsAdminOnly requires an org admin. Real write is Clerk MCP only — the service route accepts dry-run only. Do not call publish twice. EXAMPLES: • Preview adding environment + team → { dryRun: true, operations: [{ op: "add", sourceKeys: ["env", "environment"], name: "environment", maps: [{ value: "prd", to: "production" }] }, { op: "add", sourceKeys: ["team"], name: "team" }] } • Persist the same ops once → { dryRun: false, confirm: true, operations: [] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slug | No | Organization slug. Omit to auto-detect from your account (fails if you belong to multiple orgs). | |
| dryRun | No | When true (default), merge and validate only — no Prisma write and no feature-engineering job. | |
| confirm | No | Must be true to persist. Merges add/update/delete onto all existing label dimensions, replaces the stored document, and starts a feature-engineering refresh that takes about 10 minutes. Put every change into this one call. Check list_label_dimension_usages before delete or rename. | |
| operations | Yes | add / update / delete operations applied in order onto the currently published labels. |