Labels

Create a label version

Changed on

Publishes an immutable version under the label. text is single-label DSL by default; set text_format to TEXT_FORMAT_PLAIN_TEXT to send a plain-language rule instead, which is stored as a single signal. Reads always return the compiled DSL, not the text that was submitted. There is no current/live version: evaluation always uses an explicit version ID. There is no PATCH or DELETE for versions. Requires a label-first account; other accounts receive FAILED_PRECONDITION.

post/v1/labels/{labelId}/versions

Request

Path parameters

labelIdstring required

The label ID this version belongs to

Request body

textstring
descriptionstring

Optional description for this version.

parentLabelVersionIdstring

Optional explicit parent/source version for lineage tracking.

globalContextstring

Optional global context to store on the created label version.

confirmDuplicateboolean

If true, bypass the duplicate-content check. Used by clients to re-submit after the user has acknowledged a duplicate_of response.

textFormat'TEXT_FORMAT_UNSPECIFIED' | 'TEXT_FORMAT_DSL' | 'TEXT_FORMAT_PLAIN_TEXT'

How the text on a version-create request should be interpreted.

  • TEXT_FORMAT_UNSPECIFIED: Unspecified defaults to DSL for backward compatibility.
  • TEXT_FORMAT_DSL: Single-label V3 DSL.
  • TEXT_FORMAT_PLAIN_TEXT: Plain rule text, stored as a single signal. Callers using this do not need to know the DSL; the text is wrapped before compilation.

Response

A successful response.

validboolean

Changes