---
title: "Update Plan"
method: PATCH
path: "/resources/plans/v1/{id}"
tags: ["Plans (Formerly Bundles)"]
---

# Update Plan

`PATCH /resources/plans/v1/{id}`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/plans/v1/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/plans/v1/:id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update an existing plan

## Path parameters

- `id` string, required

## Request body

- UpdatePlanDto
  - `name` string: String that represents the plan name
  - `defaultTreatment` 'true' | 'false': Enum that represents the default treatment
  - `rules` RuleDto[]: Array of rules that represents the set of conditions targeting the plan
    - `description` string, required: String that represents the description of the rule
    - `conditionLogic` 'and', required: Enum that represents the rule conditions logic
    - `conditions` ConditionDto[], required: Array of conditions
      - `attribute` string, required: String representing an attribute with a subset of condition(s) that is used in code to enact targeting rules
      - `attributeType` 'custom' | 'frontegg', required: Enum that represents the attribute type (`frontegg` or `custom`)
      - `negate` boolean, required: Boolean that indicates whether the condition should negate the operation
      - `op` 'in_list' | 'starts_with' | 'ends_with' | 'contains' | 'matches' | 'equal' | 'greater_than' | 'greater_than_equal' | 'lower_than' | 'lower_than_equal' | 'between_numeric' | 'is' | 'on' | 'between_date' | 'on_or_after' | 'on_or_before', required: Enum that represents the operation applied to the condition
      - `value` object, required: Object that contains the condition data according to selected operation, each operation requires different structure (see [documentation](https://docs.frontegg.com/docs/entitlements-backend-sdk#operations-and-corresponding-object-structure))
    - `treatment` 'true' | 'false', required: String that represents the treatment for this rule
  - `description` string: Feature plan description
  - `metadata` string: JSON String
  - `defaultTimeLimitation` number: Number that represents the default time limitation in days for auto-assigned plans
  - `assignOnSignup` boolean: Boolean indicating whether a plan is assigned automatically upon signup

## Response `200`

- PlanDto
  - `id` string, required: UUID string that represents the plan ID
  - `vendorId` string, required: UUID string that represents the vendor ID
  - `name` string, required: String that represents the plan name
  - `defaultTreatment` 'true' | 'false': Enum that represents the default treatment
  - `rules` RuleDto[]: Array of rules that represents the set of conditions targeting the plan
    - `description` string, required: String that represents the description of the rule
    - `conditionLogic` 'and', required: Enum that represents the rule conditions logic
    - `conditions` ConditionDto[], required: Array of conditions
      - `attribute` string, required: String representing an attribute with a subset of condition(s) that is used in code to enact targeting rules
      - `attributeType` 'custom' | 'frontegg', required: Enum that represents the attribute type (`frontegg` or `custom`)
      - `negate` boolean, required: Boolean that indicates whether the condition should negate the operation
      - `op` 'in_list' | 'starts_with' | 'ends_with' | 'contains' | 'matches' | 'equal' | 'greater_than' | 'greater_than_equal' | 'lower_than' | 'lower_than_equal' | 'between_numeric' | 'is' | 'on' | 'between_date' | 'on_or_after' | 'on_or_before', required: Enum that represents the operation applied to the condition
      - `value` object, required: Object that contains the condition data according to selected operation, each operation requires different structure (see [documentation](https://docs.frontegg.com/docs/entitlements-backend-sdk#operations-and-corresponding-object-structure))
    - `treatment` 'true' | 'false', required: String that represents the treatment for this rule
  - `description` string: Feature plan description
  - `metadata` object: JSON String
  - `defaultTimeLimitation` number: Number that represents the default time limitation in days for auto-assigned plans
  - `assignOnSignup` boolean, required: Boolean indicating whether a plan is assigned automatically upon signup
  - `createdAt` string, required: Date when plan was created
  - `updatedAt` string: Date when plan was last updated
  - `features` PlanFeatureDto
    - `id` string, required: UUID string representing the feature ID
    - `name` string, required: String representing the feature name
    - `key` string, required: String representing the feature key
    - `permissions` string[], required: Array of permissions linked to a feature
  - `entitlements` PlanFeatureDto
    - `id` string, required: UUID string representing the feature ID
    - `name` string, required: String representing the feature name
    - `key` string, required: String representing the feature key
    - `permissions` string[], required: Array of permissions linked to a feature

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
