# Update feature

Source: https://docs.orbytelabs.com/api-reference/features/updateFeature

## PATCH /v1/features/{key}

```json
{
  "operationId": "updateFeature",
  "tags": [
    "Features"
  ],
  "summary": "Update feature",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 80,
        "pattern": "^[a-z0-9][a-z0-9_-]*$"
      },
      "required": true,
      "name": "key",
      "in": "path"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "expectedRevision": {
              "type": "integer",
              "exclusiveMinimum": 0
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            },
            "unit": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "creditKey": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "pattern": "^[a-z0-9][a-z0-9_-]*$"
            },
            "costNanocredits": {
              "type": "string",
              "maxLength": 19,
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "quantityPerUnit": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "pricingMode": {
              "type": "string",
              "enum": [
                "fixed",
                "callback"
              ]
            },
            "deduplicationPeriod": {
              "type": "string",
              "enum": [
                "none",
                "day",
                "week",
                "month",
                "billing"
              ]
            }
          },
          "additionalProperties": false,
          "minProperties": 1
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Feature updated",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "planPricingLocked": {
                "type": "boolean"
              },
              "id": {
                "type": "string"
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "pattern": "^[a-z0-9][a-z0-9_-]*$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "unit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "creditKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80,
                "pattern": "^[a-z0-9][a-z0-9_-]*$"
              },
              "costNanocredits": {
                "type": "string",
                "maxLength": 19,
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "quantityPerUnit": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "pricingMode": {
                "type": "string",
                "enum": [
                  "fixed",
                  "callback"
                ]
              },
              "deduplicationPeriod": {
                "type": "string",
                "enum": [
                  "none",
                  "day",
                  "week",
                  "month",
                  "billing"
                ]
              },
              "deduplicationLocked": {
                "type": "boolean"
              },
              "createdAt": {
                "type": "number"
              }
            },
            "required": [
              "revision",
              "planPricingLocked",
              "id",
              "key",
              "name",
              "unit",
              "creditKey",
              "costNanocredits",
              "quantityPerUnit",
              "pricingMode",
              "deduplicationPeriod",
              "deduplicationLocked",
              "createdAt"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "400": {
      "description": "Invalid request",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "401": {
      "description": "Missing, expired, or revoked API key",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "403": {
      "description": "Insufficient permission or unsupported key kind",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "404": {
      "description": "Resource not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "409": {
      "description": "Conflict or insufficient balance",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "413": {
      "description": "Body exceeds 16 KiB",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "415": {
      "description": "Content-Type must be application/json",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "422": {
      "description": "Unsupported pricing or billing configuration",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded; see Retry-After",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    "500": {
      "description": "Unexpected server error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "error",
              "message"
            ],
            "additionalProperties": false
          }
        }
      }
    }
  }
}
```

Complete schema: [OpenAPI 3.1 document](https://docs.orbytelabs.com/openapi.json)