Skip to main content
err:unkey:data:policy_not_found
The policy ID you sent to gateway.updatePolicy isn’t in the environment’s current policy list. You get HTTP 404.
Example response

Likely causes

  • Someone called gateway.setPolicies since you saved the ID. It replaces the whole list and gives every policy a new ID.
  • The environment has never had policies set, so no ID matches.

How to fix

  1. Get the current list with gateway.listPolicies and use an ID from it.
  2. In automation, replace the whole list with gateway.setPolicies instead of updating by ID, or fetch fresh IDs before each update.
Last modified on October 22, 2026