Skip to main content
POST
Create a label version

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

labelId
string
required

The label ID this version belongs to

Body

application/json
text
string
description
string

Optional description for this version.

parentLabelVersionId
string

Optional explicit parent/source version for lineage tracking.

labelEvalOptions
object

LabelEvalOptions are options that can be set per-label to control evaluation behavior. Field numbers/types intentionally mirror PolicyEvalOptions for parity.

globalContext
string

Optional global context to store on the created label version.

confirmDuplicate
boolean

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

textFormat
enum<string>
default:TEXT_FORMAT_UNSPECIFIED

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.
Available options:
TEXT_FORMAT_UNSPECIFIED,
TEXT_FORMAT_DSL,
TEXT_FORMAT_PLAIN_TEXT

Response

A successful response.

valid
boolean
error
object
labelVersion
object

LabelVersion is an immutable snapshot of a label's DSL + compiled representation.

duplicateOf
object

LabelVersion is an immutable snapshot of a label's DSL + compiled representation.