---
title: "Create a new Rule Assignment for the card identified in the path."
method: POST
path: "/pws/cards/{public_token}/rule-assignments"
tags: ["Card Rule Assignments"]
---

# Create a new Rule Assignment for the card identified in the path.

`POST /pws/cards/{public_token}/rule-assignments`

## Request

- Base URL: `https://api.uat.paymentology.com/ppws/api`
- URL: `https://api.uat.paymentology.com/ppws/api/pws/cards/{public_token}/rule-assignments`
- Auth: none declared. Required headers: `Client-Id`, `Api-Call-Unique-Identifier`

Create a new Rule Assignment for the card identified in the path.

## Path parameters

- `public_token` string, required

## Headers

- `Client-Id` integer, required
- `Api-Call-Unique-Identifier` string, required

## Request body

- PwsCreateRuleAssignmentRequest: Model for creating a rule assignment in the decision engine
  - `rule_id` integer, required: Rule id
  - `rule_params` RuleParamValueModel[]: List of rule parameters
    - `name` string
    - `value` object
  - `state` 'ENABLED' | 'DISABLED': State of the rule assignment
  - `disabled_until` string: UTC timestamp until the rule assignment is disabled, formatted in ISO 8601 style yyyy-MM-dd'T'HH:mm:ss[.SSS]

## Response `200`

success

- PwsRuleAssignmentResponse
  - `header` DecisionEnginePwsResponseHeader
    - `error_id` integer: Error Id
    - `error_desc` string: Error Message
  - `body` RuleAssignment
    - `id` integer
    - `ruleId` integer
    - `cardId` string
    - `parameterOverrides` RuleParamValue[]
      - `name` string
      - `type` string
      - `value` object
    - `state` 'ENABLED' | 'DISABLED'
    - `disabledUntil` string

## Other responses

- `400`: Invalid request (missing headers, etc)
- `404`: If the card or rule doesn’t exist
- `500`: Internal error

---

[API](https://skmtc.dev/paymentology/apis/decision-engine.md) - [All operations](https://skmtc.dev/paymentology/apis/decision-engine/llms.txt) - [OpenAPI document](https://skmtc.dev/paymentology/apis/decision-engine/revisions/23310170026e?raw)
