Skip to main content
POST

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required

Path Parameters

validationRuleId
string
required

Unique validation rule ID.

Example:

"val_TU4de3EP4dlL"

Query Parameters

force
boolean

If this flag is set to true, the previous assignment with the same data will be deleted and a new one will be added.

Body

application/json

Specify the resource that you would like to assign the validation rule to.

Request body schema for POST v1/validation-rules/{validationRuleId}/assignments.

Defines the related object, e.g. voucher.

Available options:
voucher,
promotion_tier,
campaign,
earning_rule,
distribution,
reward_assignment

Unique related object ID assigned by Voucherify, e.g. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.

Response

Returns a validation rules assignment object.

Response body for POST v1/validation-rules/{validationRuleId}/assignments.

id
string
required

Validation rule assignment ID.

Example:

"asgm_74F7QZoYbUoljwQO"

rule_id
string
required

Validation rule ID.

Example:

"val_4j7DCRm2IS59"

The resource ID to which the validation rule was assigned.

Example:

"v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT"

The type of resource to which the validation rule was assigned.

Available options:
voucher,
campaign,
earning_rule,
reward_assignment,
promotion_tier,
distribution
created_at
string<date-time>
required

Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.

Example:

"2022-02-17T08:18:15.085Z"

object
enum<string>
default:validation_rules_assignment
required

The type of the object represented by the ID.

Available options:
validation_rules_assignment
Last modified on July 7, 2026